MCPcopy Index your code
hub / github.com/GStreamer/gst-python / main

Function main

old_examples/filesrc.py:63–95  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

61gobject.type_register(FileSource)
62
63def main(args):
64 if len(args) != 3:
65 print 'Usage: %s input output' % (args[0])
66 return -1
67
68 bin = gst.Pipeline('pipeline')
69
70 filesrc = FileSource('filesource')
71 assert filesrc
72 filesrc.set_property('location', args[1])
73
74 filesink = gst.element_factory_make('filesink', 'sink')
75 filesink.set_property('location', args[2])
76
77 bin.add(filesrc, filesink)
78 gst.element_link_many(filesrc, filesink)
79
80 bin.set_state(gst.STATE_PLAYING);
81 mainloop = gobject.MainLoop()
82
83 def bus_event(bus, message):
84 t = message.type
85 if t == gst.MESSAGE_EOS:
86 mainloop.quit()
87 elif t == gst.MESSAGE_ERROR:
88 err, debug = message.parse_error()
89 print "Error: %s" % err, debug
90 mainloop.quit()
91 return True
92 bin.get_bus().add_watch(bus_event)
93
94 mainloop.run()
95 bin.set_state(gst.STATE_NULL)
96
97if __name__ == '__main__':
98 sys.exit(main(sys.argv))

Callers 1

filesrc.pyFile · 0.70

Calls 4

set_propertyMethod · 0.95
FileSourceClass · 0.85
addMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected