2018-03-20 08:18:38 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
#
|
|
|
|
# Plays a test screen to screen.
|
|
|
|
#
|
|
|
|
# Equivalent to:
|
|
|
|
# gst-launch-1.0 videotestsrc ! videoconvert ! autovideosink
|
|
|
|
#
|
|
|
|
|
|
|
|
import gi
|
|
|
|
gi.require_version('Gst', '1.0')
|
|
|
|
from gi.repository import GObject, Gst
|
|
|
|
import os
|
|
|
|
|
2018-06-08 20:34:49 +00:00
|
|
|
Gst.init(None)
|
2018-03-20 08:18:38 +00:00
|
|
|
mainloop = GObject.MainLoop()
|
|
|
|
|
|
|
|
pipeline = Gst.Pipeline.new("pipe")
|
|
|
|
|
2018-06-08 20:34:49 +00:00
|
|
|
videotestsrc = Gst.ElementFactory.make("videotestsrc")
|
|
|
|
videoconvert = Gst.ElementFactory.make("videoconvert")
|
|
|
|
autovideosink = Gst.ElementFactory.make("autovideosink")
|
2018-03-20 08:18:38 +00:00
|
|
|
|
|
|
|
pipeline.add(videotestsrc)
|
|
|
|
pipeline.add(videoconvert)
|
|
|
|
pipeline.add(autovideosink)
|
|
|
|
|
|
|
|
videotestsrc.link(videoconvert)
|
|
|
|
videoconvert.link(autovideosink)
|
|
|
|
|
|
|
|
pipeline.set_state(Gst.State.PLAYING)
|
|
|
|
mainloop.run()
|