mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
python: Remove old material.py example
This commit is contained in:
parent
4367933747
commit
7a1a044354
1 changed files with 0 additions and 44 deletions
|
@ -1,44 +0,0 @@
|
|||
from gi.repository import Gst, GES, GLib
|
||||
|
||||
import os
|
||||
|
||||
class Simple:
|
||||
def __init__(self, uri):
|
||||
timeline = GES.Timeline()
|
||||
trackv = GES.Track.video_raw_new()
|
||||
self.layer = GES.Layer()
|
||||
self.pipeline = GES.TimelinePipeline()
|
||||
self.pipeline.add_timeline(timeline)
|
||||
|
||||
|
||||
timeline.add_track(trackv)
|
||||
timeline.add_layer(self.layer)
|
||||
|
||||
GES.Asset.new_async(GES.UriClip, uri, None, self.discoveredCb, None)
|
||||
self.loop = GLib.MainLoop()
|
||||
self.loop.run()
|
||||
|
||||
def discoveredCb(self, asset, result, blop):
|
||||
self.layer.add_asset(asset, long(0), long(0), long(10 * Gst.SECOND), 1.0, GES.TrackType.VIDEO)
|
||||
self.start()
|
||||
|
||||
def busMessageCb(self, bus, message, udata):
|
||||
if message.type == Gst.MessageType.EOS:
|
||||
print "EOS"
|
||||
self.loop.quit()
|
||||
if message.type == Gst.MessageType.ERROR:
|
||||
print "ERROR"
|
||||
self.loop.quit()
|
||||
|
||||
def start(self):
|
||||
self.pipeline.set_state(Gst.State.PLAYING)
|
||||
self.pipeline.get_bus().add_watch(GLib.PRIORITY_DEFAULT, self.busMessageCb, None)
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(os.sys.argv) < 2:
|
||||
print "You must specify a file URI"
|
||||
exit(-1)
|
||||
GES.init()
|
||||
|
||||
# And try!
|
||||
Simple(os.sys.argv[1])
|
Loading…
Reference in a new issue