<br><br><div class="gmail_quote">On Sat, Nov 6, 2010 at 9:23 AM, HaroldJRoth <span dir="ltr"><<a href="mailto:dlafferty@gmail.com">dlafferty@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
This is a really simple question that for some reason I can't find an answer<br>
to in the docs. This probably means I'm going about it all wrong, but here<br>
goes:<br>
<br>
I want to convert the following pipeline spec into 'C' code:<br>
<br>
gst-launch filesrc location=videotestsrc.ogg ! decodebin2 ! videoscale !<br>
video/x-raw-yuv, width=50 ! queue ! appsrc<br>
<br>
E.g. I want to scale the video output coming from decodebin2 to a width and<br>
format, then I want to pass it through a queue to my appsrc element.<br>
<br>
And I want to do it with the 'C' API.<br>
<br>
So, I'm thinking the bit in the middle needs to be something like:<br>
<br>
GstElement mVideoScaler = gst_element_factory_make("videoscale",<br>
"videoscaler");<br>
GstElement mDecoderOutput = gst_element_factory_make("decodebin2",<br>
"decoder");<br>
GstElement mVideoQueue = gst_element_factory_make("queue", "videoqueue");<br>
<br>
GstCaps* videoCaps = gst_caps_new_simple ("video/x-raw-yuv",<br>
"format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('I', '4', '2',<br>
'0'),<br>
"width", G_TYPE_INT, 50,<br>
NULL);<br>
<br>
gst_bin_add_many(GST_BIN(mGstPipeline), mDecoderOutput, mVideoScaler,<br>
mVideoQueue, NULL);<br>
gst_element_link_filtered (mDecoderOutput, mVideoScaler, videoCaps)<br>
gst_element_link_filtered (mVideoScaler, mVideoQueue)<br>
<br>
<br>
Does this seem sensible?<br></blockquote><div><br>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. <br>
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
<br>
--<br>
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/Simple-Q-How-to-set-Caps-programmatically-when-assembly-a-pipeline-in-C-tp3029913p3029913.html" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/Simple-Q-How-to-set-Caps-programmatically-when-assembly-a-pipeline-in-C-tp3029913p3029913.html</a><br>
Sent from the GStreamer-devel mailing list archive at Nabble.com.<br>
<br>
------------------------------------------------------------------------------<br>
The Next 800 Companies to Lead America's Growth: New Video Whitepaper<br>
David G. Thomson, author of the best-selling book "Blueprint to a<br>
Billion" shares his insights and actions to help propel your<br>
business during the next growth cycle. Listen Now!<br>
<a href="http://p.sf.net/sfu/SAP-dev2dev" target="_blank">http://p.sf.net/sfu/SAP-dev2dev</a><br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Thiago Sousa Santos<br>