mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
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.
This commit is contained in:
parent
a50f4736b8
commit
98211a80e9
2 changed files with 49 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2008-01-31 Stefan Kost <ensonic@users.sf.net>
|
||||
|
||||
* examples/video-controller.py:
|
||||
Demo how to use the controller on videomixer.
|
||||
|
||||
2008-01-31 Jan Schmidt <Jan.Schmidt@sun.com>
|
||||
|
||||
* gst/.cvsignore:
|
||||
|
|
44
examples/video-controller.py
Normal file
44
examples/video-controller.py
Normal file
|
@ -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 <ensonic@users.sf.net>
|
||||
# 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()
|
Loading…
Reference in a new issue