You always want to check the return result from any of the link calls. Also, to link the decodebin you have to listen for the pad-added (or is it new-decoded-pad, I can't recall) and link when it's available. It won't be available until the decodebin has setup the decoders and such.<br>
<br>-Tim<br><br><div class="gmail_quote">On Wed, Jan 5, 2011 at 1:50 PM, Nicolas <span dir="ltr"><<a href="mailto:c.r.n.a@wanadoo.fr">c.r.n.a@wanadoo.fr</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;">
Hi,<br>
<br>
In fact, i made a new pipeline just for testing and my problem is, i<br>
don't know what to link together !<br>
In the code below nothing append, no message (gst-launch sample work<br>
perfectly).<br>
<br>
#include <gst/gst.h><br>
<br>
// Build with gcc test.c `pkg-config --cflags --libs gstreamer-0.10<br>
glib-2.0` -o test<br>
// gst-launch filesrc location="/home/niko/jour1.avi" ! decodebin !<br>
videoscale ! capsfilter<br>
caps=video/x-raw-yuv,width=800,height=600,framerate=30/1 !<br>
ffmpegcolorspace ! ximagesink<br>
<br>
int<br>
main (int argc,<br>
char *argv[])<br>
{<br>
GMainLoop *loop;<br>
GstElement *pipeline, *source, *decode, *scale, *filter, *color, *sink;<br>
GstCaps *caps;<br>
<br>
gst_init (&argc, &argv);<br>
loop = g_main_loop_new (NULL, FALSE);<br>
<br>
<br>
pipeline = gst_pipeline_new ("test_pipeline");<br>
<br>
source = gst_element_factory_make ("filesrc", "source");<br>
g_object_set ((GObject*) source, "location", "/home/niko/jour1.avi",<br>
NULL);<br>
<br>
decode = gst_element_factory_make ("decodebin", "decode");<br>
scale = gst_element_factory_make ("videoscale", "scale");<br>
<div class="im"><br>
filter = gst_element_factory_make ("capsfilter", "filter");<br>
caps = gst_caps_new_simple ("video/x-raw-yuv", "format",<br>
GST_TYPE_FOURCC, GST_MAKE_FOURCC ('I', '4', '2', '0'), "width",<br>
</div>G_TYPE_INT, 800, "height", G_TYPE_INT, 600, "framerate",<br>
GST_TYPE_FRACTION, 30, 1, NULL);<br>
g_object_set ((GObject*) filter, "caps", caps, NULL);<br>
gst_caps_unref(caps);<br>
<br>
color = gst_element_factory_make ("ffmpegcolorspace", "color");<br>
sink = gst_element_factory_make ("ximagesink", "output");<br>
<br>
gst_bin_add_many (GST_BIN (pipeline), source, scale, filter, color,<br>
sink, NULL);<br>
<br>
gst_element_link_many(source, scale, filter, color, sink, NULL);<br>
<div class="im"><br>
gst_element_set_state (pipeline, GST_STATE_PLAYING);<br>
<br>
</div> g_main_loop_run (loop);<br>
<br>
gst_element_set_state (pipeline, GST_STATE_NULL);<br>
gst_object_unref (GST_OBJECT (pipeline));<br>
return 0;<br>
}<br>
<br>
Thanks in advance for you help.<br>
<div><div></div><div class="h5">Nicolas.<br>
<br>
------------------------------------------------------------------------------<br>
Learn how Oracle Real Application Clusters (RAC) One Node allows customers<br>
to consolidate database storage, standardize their database environment, and,<br>
should the need arise, upgrade to a full multi-node Oracle RAC database<br>
without downtime or disruption<br>
<a href="http://p.sf.net/sfu/oracle-sfdevnl" target="_blank">http://p.sf.net/sfu/oracle-sfdevnl</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>
</div></div></blockquote></div><br>