0922cc1d68
- Struktur gemäß §8 (Eigentumsgrenzen), PLAN.md als normative Basis - Pflichtdokumente: STATUS.md, ERRORS.md, TEST_REPORT.md, CHANGELOG.md, ADRs - ADR-0001 Python 3.13-Pin, ADR-0002 GStreamer 1.28.6-Pin (Windows), ADR-0003 IPC TCP+MessagePack v1 - Kernpakete: hms_protocol, hms_domain, hms_parameter, hms_artnet, hms_adaptive, hms_capabilities, hms_plugin_sdk - Renderer-Spike: D3D11-Primärpfad + Dev-GL-Pfad (§36 Nr. 4-5) - Control Core: FastAPI REST + WebSocket (§36 Nr. 9) - Beispielplugins: Passthrough + Gaussian Blur (3 Adaptive-Quality- Varianten, HLSL/GLSL/GLES) - Tools: Art-Net-Emulator, Fixture-Generator (Master32/Layer64-CSV), Capability-Probe - JSON-Schemas: IPC, Plugin, Projekt, Cluster - 121 Unit-/Integrationstests grün, Ruff grün Gate 0 bleibt offen: Hardwaremessungen nur auf echter Windows-Referenz- hardware gültig (§29.7, §33).
53 lines
1.6 KiB
Python
53 lines
1.6 KiB
Python
"""Renderer-CLI (Phase-0-Spike).
|
||
|
||
Aufruf:
|
||
python -m hms_renderer --pipeline d3d11 --video-a A --video-b B
|
||
|
||
Ohne GStreamer-Installation: kontrollierter Abbruch mit Exit-Code 2 und
|
||
klarer Meldung – niemals Erfolgssimulation (§1.1 Nr. 5, §33).
|
||
"""
|
||
|
||
from __future__ import annotations
|
||
|
||
import argparse
|
||
import shutil
|
||
import subprocess
|
||
import sys
|
||
|
||
from hms_renderer.pipelines import build_compositor_pipeline, build_single_video_pipeline
|
||
|
||
|
||
def main(argv: list[str] | None = None) -> int:
|
||
parser = argparse.ArgumentParser(prog="hms-renderer")
|
||
parser.add_argument("--pipeline", choices=["d3d11", "devgl"], default="d3d11")
|
||
parser.add_argument("--video-a", required=True)
|
||
parser.add_argument("--video-b", default=None, help="zweite Quelle für Compositing")
|
||
parser.add_argument("--dry-run", action="store_true", help="nur Pipeline-String ausgeben")
|
||
args = parser.parse_args(argv)
|
||
|
||
use_d3d11 = args.pipeline == "d3d11"
|
||
if args.video_b:
|
||
pipeline = build_compositor_pipeline(args.video_a, args.video_b, d3d11=use_d3d11)
|
||
else:
|
||
pipeline = build_single_video_pipeline(args.video_a, d3d11=use_d3d11)
|
||
|
||
if args.dry_run:
|
||
print(pipeline)
|
||
return 0
|
||
|
||
gst_launch = shutil.which("gst-launch-1.0")
|
||
if gst_launch is None:
|
||
print(
|
||
"ERROR: gst-launch-1.0 nicht gefunden. GStreamer 1.28.6 muss gebündelt "
|
||
"oder installiert sein (build/windows/GSTREAMER.md).",
|
||
file=sys.stderr,
|
||
)
|
||
return 2
|
||
|
||
result = subprocess.run([gst_launch, "-v", pipeline], check=False)
|
||
return result.returncode
|
||
|
||
|
||
if __name__ == "__main__":
|
||
sys.exit(main())
|