MCPcopy Create free account
hub / github.com/GStreamer/gst-python / main

Function main

old_examples/play.py:274–296  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

272 return True
273
274def main(args):
275 def usage():
276 sys.stderr.write("usage: %s URI-OF-MEDIA-FILE\n" % args[0])
277 sys.exit(1)
278
279 # Need to register our derived widget types for implicit event
280 # handlers to get called.
281 gobject.type_register(PlayerWindow)
282 gobject.type_register(VideoWidget)
283
284 w = PlayerWindow()
285
286 if len(args) != 2:
287 usage()
288
289 if not gst.uri_is_valid(args[1]):
290 sys.stderr.write("Error: Invalid URI: %s\n" % args[1])
291 sys.exit(1)
292
293 w.load_file(args[1])
294 w.show_all()
295
296 gtk.main()
297
298if __name__ == '__main__':
299 sys.exit(main(sys.argv))

Callers 1

play.pyFile · 0.70

Calls 3

load_fileMethod · 0.95
PlayerWindowClass · 0.70
usageFunction · 0.70

Tested by

no test coverage detected