def on_finished (self, event): if event.id == operations.ABORTED: print "Aborted!" if event.id == operations.ERROR: print "Error:", event.error gst.main_quit()
def main(args): if len(args) != 2: print 'Usage: %s file' % args[0] return -1 filename = args[1] play = gst.play.Play() play.connect('stream-length', stream_length_cb) play.connect('have-video-size', have_video_size_cb) play.connect('found-tag', found_tag_cb) play.connect('eos', lambda p: gst.main_quit()) # Setup source and sinks play.set_data_src(gst.element_factory_make('filesrc')) play.set_audio_sink(gst.element_factory_make('osssink')) play.set_video_sink(gst.element_factory_make('fakesink')) # Point location to our filename play.set_location(filename) # Start playing the stream play.set_state(gst.STATE_PLAYING) gst.main()
def on_finished (self, event): gst.main_quit()
def eos(self, sink): self.done() if self.method in ('gtk', 'c'): gst.main_quit()