Now it works :-)
[toast/stream2beamer.git] / lagarde.py
index ca70a18f8bcd83f9b86702b9957f1da0b2938531..c33b912339ac13742de2383f6476b6127969c5c1 100755 (executable)
@@ -207,7 +207,6 @@ class WebRTCClient:
                 self.pipe.add(capsfilter)
                 self.pipe.add(flmux)
                 self.pipe.add(sink)
-                self.pipe.sync_children_states()
 
                 q_pad_sink = q.get_static_pad('sink')
                 assert q_pad_sink
@@ -228,6 +227,7 @@ class WebRTCClient:
                 ok = flmux.link(sink)
                 assert ok
                 self.pipe.set_state(Gst.State.PLAYING)
+                self.pipe.sync_children_states()
                 #print(dir(Gst.DebugGraphDetails))
                 #Gst.debug_bin_to_dot_data(element, Gst.DebugGraphDetails.ALL)
 
@@ -317,13 +317,12 @@ async def run_repeated(task):
 async def run(uri):
     try:
         events = Events()
-
         # rtsp = RtspServer()
         webrtc = WebRTCClient(events)
         signaling = SignalingClient(events, uri)
 
-        webrtc_task = asyncio.Task(run_repeated(webrtc.run))
-        signaling_task = asyncio.Task(run_repeated(signaling.run))
+        webrtc_task = asyncio.Task(webrtc.run())
+        signaling_task = asyncio.Task(signaling.run())
 
         done, pending = await asyncio.wait([webrtc_task, signaling_task],
             return_when=asyncio.FIRST_COMPLETED)