set caps in a program

Sebastian Dröge sebastian at centricular.com
Tue Nov 5 07:46:33 PST 2013


On Di, 2013-11-05 at 16:35 +0100, Thomas Scheuermann wrote:
> Hello,
> 
> How can I set caps in a program?
> I want to do something like this:
> gst-launch-1.0 videotestsrc pattern=0 !
> "video/x-raw,width=1920,height=1080,framerate=60/1" ! xvimagesink
> I create the videotestsrc element with gst_element_factory_make but I
> don't know how I can then set the caps on the "src" pad of the
> videotestsrc element.
> Is there an example anywhere?

The caps string in the parse-launch syntax is just a shortcut to insert
a capsfilter element.

In your code you could instantiate a capsfilter element, and set the
caps you want via the "caps" property of it. Then properly link it
between source and sink like any other element.

-- 
Sebastian Dröge <sebastian at centricular.com>
Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 966 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20131105/1f76a982/attachment.pgp>


More information about the gstreamer-devel mailing list