Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/glive.py
diff options
context:
space:
mode:
authorerikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0>2008-01-08 15:39:39 (GMT)
committer erikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0>2008-01-08 15:39:39 (GMT)
commit75eb370e7292c5899fdc321bc4e672014d53c5f2 (patch)
treeaa89e49b3f87c028e6220ace1c6c9886bfd2681a /glive.py
parent2c50c3545e90b8c0e5e100e99f2608af180f7fed (diff)
switching media fixes much more robust
git-svn-id: http://mediamods.com/public-svn/camera-activity/tags/50@1006 574bc980-5f2d-0410-acbc-c8f9f0eb14e0
Diffstat (limited to 'glive.py')
-rw-r--r--glive.py34
1 files changed, 31 insertions, 3 deletions
diff --git a/glive.py b/glive.py
index 9c19b2e..ec77cae 100644
--- a/glive.py
+++ b/glive.py
@@ -47,6 +47,10 @@ class Glive:
self.playing = False
+ self.AUDIO_TRANSCODE_ID = 0
+ self.TRANSCODE_ID = 0
+ self.VIDEO_TRANSCODE_ID = 0
+
self.PIPETYPE_SUGAR_JHBUILD = 0
self.PIPETYPE_XV_VIDEO_DISPLAY_RECORD = 1
self.PIPETYPE_X_VIDEO_DISPLAY = 2
@@ -311,7 +315,7 @@ class Glive:
audioBus = audioline.get_bus()
audioBus.add_signal_watch()
- self.AUDIO_MUX_MESSAGE_ID = audioBus.connect('message', self._onMuxedAudioMessageCb, audioline)
+ self.AUDIO_TRANSCODE_ID = audioBus.connect('message', self._onMuxedAudioMessageCb, audioline)
self.TRANSCODE_ID = gobject.timeout_add(self.TRANSCODE_UPDATE_INTERVAL, self._transcodeUpdateCb, audioline)
record.Record.log.debug("post AUDIO_TRANSCODE_ID")
gobject.idle_add( audioline.set_state, gst.STATE_PLAYING )
@@ -487,8 +491,8 @@ class Glive:
record.Record.log.debug("audio gst.MESSAGE_EOS")
self.record = False
self.audio = False
- gobject.source_remove(self.AUDIO_MUX_MESSAGE_ID)
- self.AUDIO_MUX_MESSAGE_ID = 0
+ gobject.source_remove(self.AUDIO_TRANSCODE_ID)
+ self.AUDIO_TRANSCODE_ID = 0
gobject.source_remove(self.TRANSCODE_ID)
self.TRANSCODE_ID = 0
pipe.set_state(gst.STATE_NULL)
@@ -527,6 +531,30 @@ class Glive:
return self._PIPETYPE == self.PIPETYPE_XV_VIDEO_DISPLAY_RECORD
+ def abandonMedia(self):
+ self.stop()
+
+ if (self.AUDIO_TRANSCODE_ID != 0):
+ gobject.source_remove(self.AUDIO_TRANSCODE_ID)
+ self.AUDIO_TRANSCODE_ID = 0
+ if (self.TRANSCODE_ID != 0):
+ gobject.source_remove(self.TRANSCODE_ID)
+ self.TRANSCODE_ID = 0
+ if (self.VIDEO_TRANSCODE_ID != 0):
+ gobject.source_remove(self.VIDEO_TRANSCODE_ID)
+ self.VIDEO_TRANSCODE_ID = 0
+
+ wavFilepath = os.path.join(Instance.instancePath, "output.wav")
+ if (os.path.exists(wavFilepath)):
+ os.remove(wavFilepath)
+ oggFilepath = os.path.join(Instance.instancePath, "output.ogg") #ogv
+ if (os.path.exists(oggFilepath)):
+ os.remove(oggFilepath)
+ muxFilepath = os.path.join(Instance.instancePath, "mux.ogg") #ogv
+ if (os.path.exists(muxFilepath)):
+ os.remove(muxFilepath)
+
+
class LiveVideoWindow(gtk.Window):
def __init__(self, bgd ):
gtk.Window.__init__(self)