#! /usr/bin/env python

import gobject
gobject.threads_init()
import gst

pipeline = gst.parse_launch("appsrc ! rsvgdec ! appsink")
appsrc = pipeline.get_by_name("appsrc0")
appsink = pipeline.get_by_name("appsink0")
pipeline.set_state(gst.STATE_PLAYING)

appsrc.set_property('caps', gst.caps_from_string("image/svg+xml"))

before = gst.Buffer("<svg></svg>")
before.timestamp = 987654321
before.duration = 123456789

appsrc.emit('push-buffer', before)
after = appsink.emit('pull-buffer')

if after.timestamp != 987654321:
  print 'rsvgdec stole my timestamp!'

if after.duration != 123456789:
  print 'rsvgdec stole my duration!'

