From: Stefan Kost Date: Thu, 31 Jan 2008 19:57:26 +0000 (+0000) Subject: examples/video-controller.py: Demo how to use the controller on videomixer. X-Git-Tag: 1.19.3~485^2~616 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=98211a80e9edfc9ceb18535698204753b7e6585a;p=platform%2Fupstream%2Fgstreamer.git examples/video-controller.py: Demo how to use the controller on videomixer. Original commit message from CVS: * examples/video-controller.py: Demo how to use the controller on videomixer. --- diff --git a/ChangeLog b/ChangeLog index 1218e31..d6b9ec2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-01-31 Stefan Kost + + * examples/video-controller.py: + Demo how to use the controller on videomixer. + 2008-01-31 Jan Schmidt * gst/.cvsignore: diff --git a/examples/video-controller.py b/examples/video-controller.py new file mode 100644 index 0000000..4b561d1 --- /dev/null +++ b/examples/video-controller.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python +# -*- Mode: Python -*- +# vi:si:et:sw=4:sts=4:ts=4 + +# videomixer-controller.py +# (c) 2008 Stefan Kost +# Test case for the GstController using videomixer and videotestsrc + +import pygst +pygst.require('0.10') +import gst +import time + +def main(): + pipeline = gst.Pipeline("videocontroller") + src = gst.element_factory_make("videotestsrc", "src") + mix = gst.element_factory_make("videomixer", "mix") + conv = gst.element_factory_make("ffmpegcolorspace", "conv") + sink = gst.element_factory_make("autovideosink", "sink") + pipeline.add(src, mix, conv, sink) + + spad = src.get_static_pad('src') + dpad = mix.get_request_pad('sink_%d') + + spad.link(dpad) + mix.link(conv) + conv.link(sink) + + control = gst.Controller(dpad, "xpos", "ypos") + control.set_interpolation_mode("xpos", gst.INTERPOLATE_LINEAR) + control.set_interpolation_mode("ypos", gst.INTERPOLATE_LINEAR) + + control.set("xpos", 0, 0) + control.set("xpos", 5 * gst.SECOND, 200) + + control.set("ypos", 0, 0) + control.set("ypos", 5 * gst.SECOND, 200) + + pipeline.set_state(gst.STATE_PLAYING) + + time.sleep(7) + +if __name__ == "__main__": + main()