From 8ac16e984c7e3bcbaf930c47c41aff49d6cf248e Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Tue, 08 Jul 2008 16:01:34 +0000 Subject: Stop pipeline while linking in video recording elements When you add the video recording elements (theora + wav writing) on-the-fly, there is a very visible freeze to the recorded video output (several seconds). This delay completely goes away if you stop the pipeline while doing the reshuffling, and the visual glitch caused by this is minimal. --- diff --git a/glive.py b/glive.py index 8f4bf29..1c944fc 100644 --- a/glive.py +++ b/glive.py @@ -336,15 +336,11 @@ class Glive: self.record = True self.audio = True - pad = self.videobin.get_static_pad("sink") - pad.set_blocked_async(True, self.blockedCb, None) + self.pipeline.set_state(gst.STATE_NULL) self.pipeline.add(self.videobin) - self.videobin.set_state(gst.STATE_PLAYING) self.pipeline.get_by_name("tee").link(self.videobin) - pad.set_blocked_async(False, self.blockedCb, None) - self.pipeline.add(self.audiobin) - self.audiobin.set_state(gst.STATE_PLAYING) + self.pipeline.set_state(gst.STATE_PLAYING) def startRecordingAudio(self): self.audioPixbuf = None -- cgit v0.9.1