pipeline = Gst.parse_launch(pipeline_string)
return Player(pipeline)
- def stop(self):
- self.mainloop.quit()
- self.pipeline.set_state(Gst.State.NULL)
-
def bus_message_cb(self, unused_bus, message):
if message.type == Gst.MessageType.EOS:
self.stop()
def play(self):
self.pipeline.set_state(Gst.State.PLAYING)
+ self.mainloop.run()
- try:
- self.mainloop.run()
- except KeyboardInterrupt:
- self.stop()
- return 1
-
- return 0
+ def stop(self):
+ self.mainloop.quit()
+ self.pipeline.set_state(Gst.State.NULL)