home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- import sys
- import pygst
- pygst.require('0.10')
- import gst
-
- def handoff_cb(sender, *args):
- print sender.get_name(), args
-
-
- def main(args):
- bin = gst.parse_launch('fakesrc name=source silent=1 num-buffers=10 signal-handoffs=true ! ' + 'fakesink name=sink silent=1 signal-handoffs=true')
- source = bin.get_by_name('source')
- source.connect('handoff', handoff_cb)
- source.get_pad('src').connect('have-data', handoff_cb)
- sink = bin.get_by_name('sink')
- sink.connect('handoff', handoff_cb)
- sink.get_pad('sink').connect('have-data', handoff_cb)
- print source, sink
- bus = bin.get_bus()
- res = bin.set_state(gst.STATE_PLAYING)
- if not res:
- raise AssertionError
- while None:
- msg = bus.poll(gst.MESSAGE_EOS | gst.MESSAGE_ERROR, gst.SECOND)
- if msg:
- break
- continue
- continue
- res = bin.set_state(gst.STATE_NULL)
- if not res:
- raise AssertionError
- return None
-
- if __name__ == '__main__':
- sys.exit(main(sys.argv))
-
-