This commit is contained in:
david rice
2026-04-24 15:37:12 +01:00
parent bc1d5bdc30
commit 0fe208aef6
2 changed files with 47 additions and 2 deletions

View File

@@ -185,6 +185,10 @@ def play_static_color(r: int, g: int, b: int):
Uses videotestsrc pattern=solid-color so every DSI line carries the same
repeating RGB triplet — any deviation in the proto_decoder output is a DSI fault.
Listens on UDP port 5001 for a trigger packet (same as play_kiosk), which
briefly cycles the pipeline through READY→PLAYING to generate the LP→HS
startup sequence that the scope captures on Pass 1.
"""
Gst.init(None)
@@ -214,6 +218,22 @@ def play_static_color(r: int, g: int, b: int):
old, new, _ = msg.parse_state_changed()
print(f"Pipeline: {old.value_nick} -> {new.value_nick}", flush=True)
def _restart_pipeline():
"""Cycle READY→PLAYING to produce the LP→HS startup the scope triggers on."""
print("UDP trigger: restarting pipeline (READY → PLAYING)", flush=True)
pipeline.set_state(Gst.State.READY)
pipeline.set_state(Gst.State.PLAYING)
return False # GLib.idle_add one-shot
def _udp_listener():
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(('127.0.0.1', 5001))
while True:
sock.recv(64)
GLib.idle_add(_restart_pipeline)
threading.Thread(target=_udp_listener, daemon=True).start()
bus.connect("message", on_message)
pipeline.set_state(Gst.State.PLAYING)
print(f"Static colour R:{r} G:{g} B:{b} (0x{argb:08X}) — running", flush=True)