Commit 71f58a44 authored by Edward Hervey's avatar Edward Hervey 🤘

examples/: Closes #362290 and #362272

Original commit message from CVS:
* examples/audioconcat.py:
* examples/cp.py:
Port to 0.10 by Jason Gerard DeRose <jderose@jasonderose.org>
Closes #362290 and #362272
* examples/bps.py:
Indentation fixes by Jason Gerard DeRose <jderose@jasonderose.org>
Closes #362011
Also small fix for Usage string
parent 6d8f3a45
2006-10-20 Edward Hervey <edward@fluendo.com>
* examples/audioconcat.py:
* examples/cp.py:
Port to 0.10 by Jason Gerard DeRose <jderose@jasonderose.org>
Closes #362290 and #362272
* examples/bps.py:
Indentation fixes by Jason Gerard DeRose <jderose@jasonderose.org>
Closes #362011
Also small fix for Usage string
2006-10-16 Tim-Philipp Müller <tim at centricular dot net>
* gst/gst.defs:
......
This diff is collapsed.
......@@ -26,15 +26,27 @@
import sys
import gobject
gobject.threads_init()
import pygst
pygst.require('0.10')
import gst
mainloop = gobject.MainLoop()
def on_eos(bus, msg):
mainloop.quit()
def filter(input, output):
"A GStreamer copy pipeline which can add arbitrary filters"
# create a new bin to hold the elements
bin = gst.parse_launch('filesrc name=source ! ' +
'statistics silent=false buffer-update-freq=1 ' +
'update_on_eos=true ! ' +
# This 'statistics' element is depreciated in 0.10
#'statistics silent=false buffer-update-freq=1 ' +
#'update_on_eos=true ! ' +
'filesink name=sink')
filesrc = bin.get_by_name('source')
filesrc.set_property('location', input)
......@@ -42,12 +54,15 @@ def filter(input, output):
filesink = bin.get_by_name('sink')
filesink.set_property('location', output)
bus = bin.get_bus()
bus.add_signal_watch()
bus.connect('message::eos', on_eos)
# start playing
bin.set_state(gst.STATE_PLAYING);
bin.set_state(gst.STATE_PLAYING)
try:
while bin.iterate():
pass
mainloop.run()
except KeyboardInterrupt:
pass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment