#!/usr/bin/env python

from gi.repository import GObject, Gst, GstApp

GObject.threads_init()
Gst.init(None)

print Gst.version_string()

pipeline=Gst.ElementFactory.make('pipeline',None)
src=Gst.ElementFactory.make('videotestsrc',None)
src.set_property('num-buffers',1)
sink=Gst.ElementFactory.make('appsink',None)
pipeline.add(src)
pipeline.add(sink)
src.link(sink)

pipeline.set_state(Gst.State.PLAYING)

ret = pipeline.get_state(-1)

pipeline.set_state(Gst.State.NULL)
