import pygtk
pygtk.require('2.0')
import gobject
import pygst
pygst.require('0.10')
import gst

# Construct new pipeline
pipeline = gst.Pipeline()

# Construct elements
src = gst.element_factory_make('audiotestsrc')
pay = gst.element_factory_make('gdppay')
progress = gst.element_factory_make('progressreport')
sink = gst.element_factory_make('fakesink')

# Set element properties
progress.set_property('update-freq', 1)
sink.set_property('sync', True)

# Add elements to pipeline
pipeline.add(src)
pipeline.add(pay)
pipeline.add(progress)
pipeline.add(sink)

# Link elements
src.link(pay)
pay.link(progress)
progress.link(sink)

pipeline.set_state(gst.STATE_READY)

for source in pipeline.iterate_sources():
	source.seek_simple(gst.FORMAT_TIME, gst.SEEK_FLAG_NONE, 900000000 * gst.SECOND)

pipeline.set_state(gst.STATE_PLAYING)

gobject.MainLoop().run()
