- Update pinned Rust, Slint, DSP and WebRTC dependencies, preserving the local vendor patches and source receipts. - Fix desktop audio scheduling and disconnect handling; include isolated duplex, identity, bookmark and notification checks. - Record measured differences from TeamSpeak 6.0.0.5232; full visual and server-feature parity remain open.
49 lines
3.1 KiB
Python
49 lines
3.1 KiB
Python
"""Compile the actual production decoder factory against the verified pinned archive.
|
|
Invoked only by explicit xtask smoke; no source or SDK downloads.
|
|
"""
|
|
import json
|
|
import pathlib
|
|
import shlex
|
|
import subprocess
|
|
import sys
|
|
|
|
root, archive, output, target, compiler = sys.argv[1:]
|
|
root, archive, output = map(pathlib.Path, (root, archive, output))
|
|
wrapper = root / 'native/vendor/webrtc-sys-0.3.55'
|
|
include = archive / 'include'
|
|
lines = (archive / 'webrtc.ninja').read_text().splitlines()
|
|
definitions = next((line.removeprefix('defines = ') for line in lines if line.startswith('defines = ')), None)
|
|
if definitions is None:
|
|
raise SystemExit('verified archive lacks GN ABI definitions')
|
|
defines = shlex.split(definitions.replace('$$', '$'))
|
|
if not defines or any(not flag.startswith('-D') for flag in defines):
|
|
raise SystemExit('unexpected GN defines format')
|
|
includes = [wrapper / 'include', include, include / 'third_party/abseil-cpp', include / 'third_party/libyuv/include']
|
|
sources = [root / 'native/tools/codec_probe.cpp', wrapper / 'src/video_decoder_factory.cpp']
|
|
windows = 'windows' in target
|
|
exe = output / ('codec_probe.exe' if windows else 'codec_probe')
|
|
if windows:
|
|
command = [compiler, '/nologo', '/std:c++20', '/MT', '/EHsc', '/O2', *defines]
|
|
command += ['/I' + str(p) for p in includes]
|
|
command += [str(p) for p in sources] + ['/Fe:' + str(exe), '/link', str(archive / 'lib/webrtc.lib'), '/OPT:REF']
|
|
command += [name + '.lib' for name in ['msdmo', 'wmcodecdspuuid', 'dmoguids', 'crypt32', 'iphlpapi', 'ole32', 'secur32', 'winmm', 'ws2_32', 'strmiids', 'd3d11', 'gdi32', 'dxgi', 'dwmapi', 'shcore', 'user32', 'advapi32', 'bcrypt']]
|
|
else:
|
|
command = [compiler, '-std=c++20', '-O2', *defines]
|
|
if 'linux' in target:
|
|
includes += [include / 'third_party/libc++/src/include', include / 'third_party/libc++abi/src/include', include / 'buildtools/third_party/libc++']
|
|
command += ['-nostdinc++', '-nostdlib++']
|
|
elif 'darwin' in target:
|
|
includes += [include / 'sdk/objc', include / 'sdk/objc/base', include / 'sdk/objc/components/video_codec', include / 'sdk/objc/components/video_frame_buffer']
|
|
sources += [wrapper / 'src/objc_video_factory.mm', wrapper / 'src/objc_video_frame_buffer.mm']
|
|
sdk = subprocess.check_output(['xcrun', '--sdk', 'macosx', '--show-sdk-path'], text=True).strip()
|
|
command += ['-stdlib=libc++', '-isysroot', sdk, '-mmacosx-version-min=14.2', '-ObjC']
|
|
command += ['-I' + str(p) for p in includes] + [str(p) for p in sources]
|
|
command += [str(archive / 'lib/libwebrtc.a'), '-o', str(exe)]
|
|
if 'linux' in target:
|
|
command += ['-pthread', '-ldl', '-lrt', '-lm']
|
|
else:
|
|
for framework in ['Foundation', 'AVFoundation', 'Security', 'CoreAudio', 'AudioToolbox', 'AppKit', 'CoreMedia', 'CoreGraphics', 'VideoToolbox', 'CoreVideo', 'OpenGL', 'Metal', 'MetalKit', 'QuartzCore', 'IOKit', 'IOSurface', 'ScreenCaptureKit']:
|
|
command += ['-framework', framework]
|
|
(output / 'probe-build-command.json').write_text(json.dumps(command, indent=2))
|
|
subprocess.run(command, cwd=output, check=True)
|