[gst-devel] Simple Q: How to set Caps programmatically when assembly a pipeline in C

HaroldJRoth dlafferty at gmail.com
Sat Nov 6 14:39:30 CET 2010



thiagossantos at gmail.com wrote:
> 
> On Sat, Nov 6, 2010 at 9:23 AM, HaroldJRoth <dlafferty at gmail.com> wrote:
>> So, I'm thinking the bit in the middle needs to be something like:
>>
>> GstElement mVideoScaler = gst_element_factory_make("videoscale",
>> "videoscaler");
>> GstElement mDecoderOutput = gst_element_factory_make("decodebin2",
>> "decoder");
>> GstElement mVideoQueue = gst_element_factory_make("queue", "videoqueue");
>>
>> GstCaps* videoCaps = gst_caps_new_simple ("video/x-raw-yuv",
>>             "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('I', '4', '2',
>> '0'),
>>             "width", G_TYPE_INT, 50,
>>             NULL);
>>
>> gst_bin_add_many(GST_BIN(mGstPipeline), mDecoderOutput, mVideoScaler,
>> mVideoQueue, NULL);
>> gst_element_link_filtered (mDecoderOutput, mVideoScaler, videoCaps)
>> gst_element_link_filtered (mVideoScaler, mVideoQueue)
>>
>>
>> Does this seem sensible?
>>
> 
> The caps on the middle of your gst-launch line is syntactic sugar. In the
> pipeline it is converted to a 'capsfilter' element with the 'caps'
> property
> set to the caps you provide. Try creating a capsfilter and setting its
> property with g_object_set.
> 
> 


Seems the same as gst_element_link_filtered that I'm using above.  (The
first one.  The second use has an obvious typo in that an argument is
missing.)

See
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html#gst-element-link-filtered
 
-- 
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Simple-Q-How-to-set-Caps-programmatically-when-assembly-a-pipeline-in-C-tp3029913p3029977.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.




More information about the gstreamer-devel mailing list