diff options
author | Mathieu Duponchelle <seeed@laposte.net> | 2011-06-07 19:44:40 +0200 |
---|---|---|
committer | Thibault Saunier <thibault.saunier@collabora.com> | 2011-08-11 14:40:08 +0200 |
commit | f8de22b29c9875d782464c9e38db50d8642578c6 (patch) | |
tree | bdced2cde8393867b0270c427a4aee2211a36d79 /bindings | |
parent | 843df22ec00fb84eb0eccc2b039bf4c3bca647e5 (diff) |
pyges : Add a text overlay test
Diffstat (limited to 'bindings')
-rw-r--r-- | bindings/python/testsuite/test_textoverlay.py | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/bindings/python/testsuite/test_textoverlay.py b/bindings/python/testsuite/test_textoverlay.py new file mode 100644 index 00000000..25571e2a --- /dev/null +++ b/bindings/python/testsuite/test_textoverlay.py @@ -0,0 +1,45 @@ +import gst + +from common import TestCase +from gst import ges + +class Timeline(TestCase): + + def testTimeline(self): + + tl = ges.timeline_new_audio_video() + lyr = ges.SimpleTimelineLayer() + src = ges.TimelineTestSource() + pip = ges.TimelinePipeline() + ovrl = ges.TimelineTextOverlay() + bus = pip.get_bus() + + # Let's add the layer to the timeline, and the sources to the layer. + + tl.add_layer(lyr) + src.set_duration(long(gst.SECOND * 10)) + ovrl.set_duration(long(gst.SECOND * 5)) + ovrl.set_start(long(gst.SECOND * 5)) + ovrl.set_text("Foo") + + lyr.add_object(src, -1) + lyr.add_object(ovrl, -1) + + pip.add_timeline(tl) + bus.set_sync_handler(self.bus_handler) + + self.pipeline = pip + self.layer = lyr + + #Mainloop is finished, tear down. + self.pipeline = None + + + def bus_handler(self, unused_bus, message): + if message.type == gst.MESSAGE_ERROR: + print "ERROR" + self.mainloop.quit() + elif message.type == gst.MESSAGE_EOS: + print "Done" + self.mainloop.quit() + return gst.BUS_PASS |