more pipes, some that work and some that are special
Original commit message from CVS: more pipes, some that work and some that are special
This commit is contained in:
parent
37309ab22b
commit
83196919be
@ -50,7 +50,19 @@ data = (('Video capture via V4L',
|
|||||||
'alsasrc\n'
|
'alsasrc\n'
|
||||||
' ! audio/x-raw-int,rate=22050,depth=16,channels=1,width=16,signed=(boolean)TRUE,endianness=1234\n'
|
' ! audio/x-raw-int,rate=22050,depth=16,channels=1,width=16,signed=(boolean)TRUE,endianness=1234\n'
|
||||||
' ! level signal=true\n'
|
' ! level signal=true\n'
|
||||||
' ! fakesink'))
|
' ! fakesink'),
|
||||||
|
('Streaming Ogg/Theora+Vorbis playback, tee to disk',
|
||||||
|
'gnomevfssrc location=http://gstreamer.freedesktop.org/media/small/cooldance.ogg \n'
|
||||||
|
' ! tee name=tee \n'
|
||||||
|
' tee. ! oggdemux name=demux \n'
|
||||||
|
' demux. ! queue ! theoradec ! xvimagesink \n'
|
||||||
|
' demux. ! queue ! vorbisdec ! audioconvert ! alsasink \n'
|
||||||
|
' tee. ! filesink location=cooldance.ogg'),
|
||||||
|
('Reencode Vorbis to mulaw, play via ALSA',
|
||||||
|
'filesrc location=cooldance.ogg \n'
|
||||||
|
' ! oggdemux \n'
|
||||||
|
' ! vorbisdec ! audioconvert \n'
|
||||||
|
' ! mulawenc ! mulawdec ! alsasink'))
|
||||||
|
|
||||||
|
|
||||||
def escape(s, chars, escaper='\\'):
|
def escape(s, chars, escaper='\\'):
|
||||||
@ -120,6 +132,7 @@ class Window(gtk.Window):
|
|||||||
bu.show()
|
bu.show()
|
||||||
bb.pack_start(bu, True, False, 0)
|
bb.pack_start(bu, True, False, 0)
|
||||||
bu.set_property('has-default', True)
|
bu.set_property('has-default', True)
|
||||||
|
self.button = bu
|
||||||
|
|
||||||
def on_changed(s):
|
def on_changed(s):
|
||||||
m, i = s.get_selected()
|
m, i = s.get_selected()
|
||||||
@ -132,9 +145,9 @@ class Window(gtk.Window):
|
|||||||
l.set_markup('')
|
l.set_markup('')
|
||||||
tv.get_selection().connect('changed', on_changed)
|
tv.get_selection().connect('changed', on_changed)
|
||||||
|
|
||||||
tv.connect('row-activated', lambda *x: self.play_toggled(bu))
|
tv.connect('row-activated', lambda *x: self.play_toggled())
|
||||||
|
|
||||||
bu.connect('clicked', self.play_toggled)
|
bu.connect('clicked', lambda *x: self.play_toggled())
|
||||||
|
|
||||||
def error(self, message, secondary=None):
|
def error(self, message, secondary=None):
|
||||||
m = gtk.MessageDialog(self,
|
m = gtk.MessageDialog(self,
|
||||||
@ -154,10 +167,15 @@ class Window(gtk.Window):
|
|||||||
elif t == gst.MESSAGE_ERROR:
|
elif t == gst.MESSAGE_ERROR:
|
||||||
err, debug = message.parse_error()
|
err, debug = message.parse_error()
|
||||||
self.error("%s" % err, debug)
|
self.error("%s" % err, debug)
|
||||||
|
elif t == gst.MESSAGE_EOS:
|
||||||
|
self.play_toggled()
|
||||||
else:
|
else:
|
||||||
print '%s: %s:' % (message.src.get_path_string(),
|
print '%s: %s:' % (message.src.get_path_string(),
|
||||||
message.type.value_nicks[1])
|
message.type.value_nicks[1])
|
||||||
print ' %s' % message.structure.to_string()
|
if message.structure:
|
||||||
|
print ' %s' % message.structure.to_string()
|
||||||
|
else:
|
||||||
|
print ' (no structure)'
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def play(self):
|
def play(self):
|
||||||
@ -189,15 +207,15 @@ class Window(gtk.Window):
|
|||||||
gobject.source_remove(self.watch_id)
|
gobject.source_remove(self.watch_id)
|
||||||
del self.watch_id
|
del self.watch_id
|
||||||
|
|
||||||
def play_toggled(self, button):
|
def play_toggled(self):
|
||||||
if self.playing:
|
if self.playing:
|
||||||
self.stop()
|
self.stop()
|
||||||
button.set_label(gtk.STOCK_MEDIA_PLAY)
|
self.button.set_label(gtk.STOCK_MEDIA_PLAY)
|
||||||
self.playing = False
|
self.playing = False
|
||||||
else:
|
else:
|
||||||
if self.play():
|
if self.play():
|
||||||
self.playing = True
|
self.playing = True
|
||||||
button.set_label(gtk.STOCK_MEDIA_STOP)
|
self.button.set_label(gtk.STOCK_MEDIA_STOP)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
w = Window()
|
w = Window()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user