2026-05-21 20:53:03 -04:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
# Apply the upstream FFmpeg master decklink SDK-16 compatibility patch on top
|
|
|
|
|
# of the release/7.1 source. The patch renames every IDeckLink* interface and
|
|
|
|
|
# helper to its _v14_2_1 versioned form so the call sites keep working against
|
|
|
|
|
# SDK 16's headers (which only retain the versioned aliases). Cherry-picking
|
|
|
|
|
# individual replacements like the previous regex patch produced inconsistent
|
|
|
|
|
# code that compiled but silently dropped every video frame.
|
|
|
|
|
import subprocess, sys, pathlib
|
|
|
|
|
patch = pathlib.Path('/decklink-sdk16.patch')
|
|
|
|
|
if not patch.exists():
|
|
|
|
|
print('FATAL: /decklink-sdk16.patch not found in build context', file=sys.stderr)
|
|
|
|
|
sys.exit(1)
|
|
|
|
|
# Patch was produced as `git diff HEAD FETCH_HEAD` where HEAD=release/7.1 and
|
|
|
|
|
# FETCH_HEAD=master, so we apply it in REVERSE to move 7.1 → master.
|
|
|
|
|
result = subprocess.run(
|
|
|
|
|
['git', 'apply', '-R', '--verbose', str(patch)],
|
|
|
|
|
cwd='/ffmpeg', capture_output=True, text=True,
|
2026-05-21 19:57:22 -04:00
|
|
|
)
|
2026-05-21 20:53:03 -04:00
|
|
|
print(result.stdout)
|
|
|
|
|
print(result.stderr, file=sys.stderr)
|
|
|
|
|
sys.exit(result.returncode)
|