Bring PS5 GTA6 to 120FPS with DLSS 5. An advanced Windows video player and capture enhancement tool featuring real-time preview for videos, images, and capture card sources. Combine AI-powered Super Resolution, DLSS5 image enhancement, and Frame Generation to deliver a next-generation visual experience.
C++
"""Scoped PR31/playlist build. Old objects/runtime remain read-only and hashed."""
from pathlib import Path
import ctypes
import hashlib
import json
import os
import re
import subprocess
import time
ROOT=Path(__file__).resolve().parents[2]
BASE=Path('E:/项目/Veyra');TASK='pr31-playlist-20261009'
CACHE=BASE/'build/vfg-next-20261007';OUT=BASE/'build'/TASK
LOG=BASE/'logs'/TASK/('build-'+time.strftime('%Y%m%d-%H%M%S'));TMP=BASE/'tmp'/TASK/'build'
for p in (OUT,LOG,TMP):p.mkdir(parents=True,exist_ok=True)
def sha(p):return hashlib.sha256(p.read_bytes()).hexdigest()
shell=ctypes.WinDLL('shell32');shell.CommandLineToArgvW.argtypes=[ctypes.c_wchar_p,ctypes.POINTER(ctypes.c_int)]
shell.CommandLineToArgvW.restype=ctypes.POINTER(ctypes.c_wchar_p);ctypes.windll.kernel32.LocalFree.argtypes=[ctypes.c_void_p]
def args(s):
n=ctypes.c_int();p=shell.CommandLineToArgvW(s,ctypes.byref(n));a=[p[i] for i in range(n.value)];ctypes.windll.kernel32.LocalFree(p);return a
def unescape(s):return s.replace('$ ',' ').replace('$:',':').replace('$$','$')
tool=re.search(r'^CMAKE_MAKE_PROGRAM:FILEPATH=(.*)$',(CACHE/'CMakeCache.txt').read_text(encoding='utf8'),re.M).group(1)
ninja=(CACHE/'build.ninja').read_text(encoding='utf8');inputs={};sources={};commands=[];start=time.monotonic()
def protect(p):
p=Path(p);p=p if p.is_absolute() else CACHE/p
assert p.is_file(),p
if str(p) not in inputs:inputs[str(p)]=sha(p)
return p
def rule(name,objectsRequired=True):
lines=re.search(r'^build '+re.escape(name)+r': .*?(?=\n\n)',ninja,re.M|re.S).group().splitlines()
var=dict(re.match(r' ([A-Z_]+) = (.*)',l).groups() for l in lines[1:] if re.match(r' ([A-Z_]+) = (.*)',l))
objects=[unescape(n).replace('\\','/') for n in lines[0].split('Release ',1)[1].split(' | ',1)[0].split(' ')]
if objectsRequired:
for p in objects:protect(p)
for value in args(unescape(var.get('LINK_LIBRARIES',''))):
if value.lower().endswith('.lib') and (Path(value).is_file() or (CACHE/value).is_file()):protect(value)
return objects,var
def compiler(name):
return args(subprocess.check_output([tool,'-t','commands',name],cwd=CACHE,text=True,encoding='utf8').splitlines()[-1])
env=dict(os.environ);env.update(TEMP=str(TMP),TMP=str(TMP))
setup=subprocess.run(['cmd.exe','/u','/d','/c',r'call C:\PROGRA~2\MICROS~3\2022\BUILDT~1\VC\Auxiliary\Build\vcvars64.bat >nul && set'],capture_output=True,text=True,encoding='utf-16-le',env=env,check=True)
for line in setup.stdout.splitlines():
if '=' in line:
key,value=line.split('=',1)
if key and not key.startswith('='):env[key]=value
env.update(TEMP=str(TMP),TMP=str(TMP))
def run(command,name):
commands.append(command);remaining=890-(time.monotonic()-start);assert remaining>0
with (LOG/(name+'.log')).open('wb') as stream:r=subprocess.run(command,cwd=CACHE,env=env,stdout=stream,stderr=subprocess.STDOUT,timeout=min(300,remaining))
print(name,'exit',r.returncode,flush=True)
if r.returncode:print((LOG/(name+'.log')).read_text(encoding='utf8',errors='replace')[-5000:]);raise SystemExit(r.returncode)
def compile(source,name,a):
sources[str(source)]=sha(source);target=OUT/(name+'.obj')
command=a[:1]+['/utf-8','/I'+str(ROOT/'include'),'/I'+str(ROOT/'src')]+[v for v in a[1:-1] if not v.startswith(('/Fo','/Fd')) and v!='/showIncludes']
run(command+['/Fo'+str(target),'/Fd'+str(OUT/(name+'.pdb')),str(source)],'compile-'+name)
return target
# The cached CMake build predates HDR compatibility and the BMD follow-up.
# Retain ALL current-main overrides, verifying sources and immutable objects.
previous=json.loads((BASE/'logs/subtitle-formats-20261009/build-20261009-133206/receipt.json').read_text(encoding='utf8'))
overrides={}
for name,row in previous['overrides'].items():
if name.endswith(('QmlPlayerBridge.cpp.obj','qrc_veyra_i18n.cpp.obj')):continue
source=name.split('.dir/',1)[1][:-4]
if source.startswith(('src/','apps/')):
original=next((p for p in previous['sources'] if p.replace('\\','/').endswith('/'+source) and
Path(p).is_file() and sha(Path(p))==previous['sources'][p] and
Path(p).read_bytes().replace(b'\r\n',b'\n')==(ROOT/source).read_bytes().replace(b'\r\n',b'\n')),None)
assert original,source # Git autocrlf may change bytes, never source content.
protect(original)
sources[str(ROOT/source)]=sha(ROOT/source)
assert sha(Path(row['path']))==row['sha256'],name
overrides[name]=protect(row['path'])
for relative,group in (('src/ui/QmlPlayerBridge.cpp','veyra_qml_bridge'),('src/sink/CaptureAudioSession.cpp','veyra_sinks')):
name=f'CMakeFiles/{group}.dir/{relative}.obj'
overrides[name]=compile(ROOT/relative,Path(relative).stem,compiler(name))
sources[str(ROOT/'include/veyra/engine/Subtitles.h')]=sha(ROOT/'include/veyra/engine/Subtitles.h')
# Both Q_OBJECT headers changed/new: rebuild the bridge's complete meta-object
# group, retaining the other two unmodified objects from immutable generation.
autogen=json.loads(protect(CACHE/'CMakeFiles/veyra_qml_bridge_autogen.dir/AutogenInfo.json').read_text(encoding='utf8'))
mocArgs=[autogen['QT_MOC_EXECUTABLE']]+['-D'+d for d in autogen['MOC_DEFINITIONS']]+['-I'+str(ROOT/'include')]+['-I'+d for d in autogen['MOC_INCLUDES']]
for stem in ('QmlPlayerBridge','PlaylistModel'):
header=ROOT/f'include/veyra/ui/{stem}.h';sources[str(header)]=sha(header)
run(mocArgs+['-o',str(OUT/f'moc_{stem}.cpp'),str(header)],'moc-'+stem)
mocs=OUT/'mocs_compilation.cpp'
retained=[protect(CACHE/f'veyra_qml_bridge_autogen/EC3QK4C7QJ/moc_{name}.cpp') for name in ('MoonlightInputCapture','QmlExportQueueModel')]
mocs.write_text(''.join('#include "'+p.as_posix()+'"\n' for p in retained)+'#include "moc_QmlPlayerBridge.cpp"\n',encoding='utf8')
bridgeCompiler=compiler('CMakeFiles/veyra_qml_bridge.dir/src/ui/QmlPlayerBridge.cpp.obj')
overrides['CMakeFiles/veyra_qml_bridge.dir/veyra_qml_bridge_autogen/mocs_compilation.cpp.obj']=compile(mocs,'bridge-mocs',bridgeCompiler)
playlistObject=compile(ROOT/'src/ui/PlaylistModel.cpp','PlaylistModel',bridgeCompiler)
playlistMoc=compile(OUT/'moc_PlaylistModel.cpp','playlist-moc',bridgeCompiler)
gui=rule('veyra_qml_ui.exe')
resource=next(p for p in gui[0] if p.endswith('/qrc_veyra_i18n.cpp.obj'))
lines=subprocess.check_output([tool,'-t','commands',resource],cwd=CACHE,text=True,encoding='utf8').splitlines()
rccLine=next(l for l in lines if 'rcc.exe' in l.lower() and 'veyra_i18n' in l)
rcc=next(a for part in args(rccLine) for a in args(part) if a.lower().endswith('rcc.exe'))
qrc=OUT/'i18n.qrc';qrc.write_text('<RCC><qresource prefix="/i18n"><file alias="catalog.json">'+(ROOT/'i18n/catalog.json').as_posix()+'</file></qresource></RCC>',encoding='utf8')
generated=OUT/'qrc_veyra_i18n.cpp';run([rcc,'--name','veyra_i18n','--no-zstd','-o',str(generated),str(qrc)],'generate-i18n')
sources[str(ROOT/'i18n/catalog.json')]=sha(ROOT/'i18n/catalog.json')
overrides[resource]=compile(generated,'qrc_veyra_i18n',compiler(resource))
core=[p for name,p in overrides.items() if name.startswith(('CMakeFiles/veyra_engine.','CMakeFiles/veyra_sources.'))]
assert any(p.name=='Subtitles.obj' for p in core) and len(core)==11
cmake=r'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe'
link=r'C:\PROGRA~2\MICROS~3\2022\BUILDT~1\VC\Tools\MSVC\1444~1.352\bin\Hostx64\x64\link.exe'
executables=[]
def linkTarget(name,objects,variables):
rsp=OUT/(name+'.rsp')
rsp.write_text('\n'.join(subprocess.list2cmdline([str(p)]) for p in objects)+'\n'+unescape(variables.get('LINK_PATH',''))+'\n'+unescape(variables['LINK_LIBRARIES']),encoding='utf8')
directory=OUT/('manifest-'+name);directory.mkdir(exist_ok=True)
flags=[('/MANIFESTINPUT:'+str(CACHE/'veyra-qml.manifest')) if a.startswith('/MANIFESTINPUT:') else a for a in args(unescape(variables.get('LINK_FLAGS','')))]
protect(CACHE/'veyra-qml.manifest')
command=[cmake,'-E','vs_link_exe','--msvc-ver=1944','--intdir='+str(directory),r'--rc=C:\PROGRA~2\WI3CF2~1\10\bin\100261~1.0\x64\rc.exe',r'--mt=C:\PROGRA~2\WI3CF2~1\10\bin\100261~1.0\x64\mt.exe','--manifests','--',link,'/nologo','@'+str(rsp),'/out:'+str(OUT/(name+'.exe')),'/implib:'+str(OUT/(name+'.lib')),'/pdb:'+str(OUT/(name+'.pdb')),'/version:0.0']+flags
run(command,'link-'+name);executables.append(OUT/(name+'.exe'))
linkTarget('veyra_qml_ui',list(overrides.values())+[playlistObject,playlistMoc]+[CACHE/p for p in gui[0] if p not in overrides],gui[1])
objects,var=rule('veyra_capture_audio_tests.exe',False)
obj=compile(ROOT/'tests/integration/CaptureAudioTests.cpp','test-audio',compiler(objects[0]))
linkTarget('capture-audio-tests',[overrides['CMakeFiles/veyra_sinks.dir/src/sink/CaptureAudioSession.cpp.obj'],obj],var)
objects,var=rule('veyra_qml_easing_tests.exe',False)
# These tests exercise the production model, not a reimplementation. Qt GUI
# link libraries are reused; no engine singleton/worker is started in unit UI.
obj=compile(ROOT/'tests/unit/PlaylistModelTests.cpp','test-playlist',bridgeCompiler)
linkTarget('playlist-tests',[playlistObject,playlistMoc,obj],var)
qtRoot=Path(autogen['QT_MOC_EXECUTABLE']).parent.parent
testCompiler=bridgeCompiler[:-1]+['/I'+str(qtRoot/'include/QtTest'),'/DVEYRA_QML_DIR="'+ROOT.joinpath('qml').as_posix()+'"',bridgeCompiler[-1]]
obj=compile(ROOT/'tests/qml/PlaylistWindowTests.cpp','test-playlist-window',testCompiler)
testVar=dict(var);testVar['LINK_LIBRARIES']+=' '+subprocess.list2cmdline([str(protect(qtRoot/'lib/Qt6Test.lib'))])
linkTarget('playlist-window-tests',[playlistObject,playlistMoc,obj],testVar)
for p,d in inputs.items():assert sha(Path(p))==d,p
for relative in ('CMakeLists.txt','qml/Veyra/DialogHost.qml','qml/Veyra/Main.qml','qml/Veyra/CineBar.qml','qml/Veyra/FullscreenBar.qml','qml/Veyra/HomePage.qml','qml/Veyra/PlaylistWindow.qml','qml/Veyra/qmldir'):sources[str(ROOT/relative)]=sha(ROOT/relative)
receipt={'commands':commands,'sources':sources,'overrides':{n:{'path':str(p),'sha256':sha(p)} for n,p in overrides.items()},'inputsUnchanged':inputs,'seconds':time.monotonic()-start,'executables':{p.name:sha(p) for p in executables}}
(LOG/'receipt.json').write_text(json.dumps(receipt,ensure_ascii=False,indent=2),encoding='utf8')
(BASE/'reports'/TASK/'build-current.json').write_text(json.dumps({'receipt':str(LOG/'receipt.json')},indent=2),encoding='utf8')
print('Built current GUI, PR31 audio and playlist tests; original inputs unchanged;',LOG,flush=True)