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

HaroldJRoth dlafferty at gmail.com
Sat Nov 6 13:23:06 CET 2010


This is a really simple question that for some reason I can't find an answer
to in the docs.  This probably means I'm going about it all wrong, but here
goes:

I want to convert the following pipeline spec into 'C' code:

gst-launch filesrc location=videotestsrc.ogg ! decodebin2 ! videoscale !
video/x-raw-yuv, width=50 ! queue ! appsrc

E.g. I want to scale the video output coming from decodebin2 to a width and
format, then I want to pass it through a queue to my appsrc element.

And I want to do it with the 'C' API.

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?


-- 
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-tp3029913p3029913.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.




More information about the gstreamer-devel mailing list