You forgot to add <span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">vcolorspace to the bin that why you are getting those warnings. </span><br><br><div class="gmail_quote">
On Mon, May 2, 2011 at 7:56 PM, &quot;Andreas Büttner&quot; <span dir="ltr">&lt;<a href="mailto:Andreas.Buettner87@web.de">Andreas.Buettner87@web.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Hi,<br>
<br>
I know the topic was already discussed, but I always receive a mistake by<br>
using the following code(its nearly the code from a member here in the<br>
forum):<br>
<br>
------------------code------------------<br>
#include &lt;gst/gst.h&gt;<br>
#include &lt;glib.h&gt;<br>
#include &lt;string.h&gt;<br>
<br>
static GstElement *source, *demuxer, *vdqueue, *vdsink, *decvd,<br>
*vcolorspace;<br>
<br>
void on_pad_added (GstElement *element, GstPad *pad)<br>
{<br>
<br>
    gchar *name;<br>
    name = gst_pad_get_name (pad);<br>
    g_debug (&quot;A new pad %s was created\n&quot;, name);<br>
<br>
    GstCaps *caps;<br>
    GstStructure *str;<br>
<br>
    caps = gst_pad_get_caps (pad);<br>
    g_assert (caps != NULL);<br>
    str = gst_caps_get_structure (caps, 0);<br>
    g_assert (str != NULL);<br>
<br>
<br>
    if (g_strrstr (gst_structure_get_name (str), &quot;video&quot;)) {<br>
        g_debug (&quot;Linking video pad to dec_vd&quot;);<br>
        // Link it actually<br>
        GstPad *targetsink = gst_element_get_pad (decvd, &quot;sink&quot;);<br>
        g_assert (targetsink != NULL);<br>
        gst_pad_link (pad, targetsink);<br>
        gst_object_unref (targetsink);<br>
    }<br>
<br>
    gst_caps_unref (caps);<br>
<br>
}<br>
<br>
static gboolean<br>
bus_call (GstBus *bus,<br>
        GstMessage *msg,<br>
        gpointer data)<br>
{<br>
    GMainLoop *loop = (GMainLoop *) data;<br>
<br>
    switch (GST_MESSAGE_TYPE (msg)) {<br>
<br>
    case GST_MESSAGE_EOS:<br>
        g_print (&quot;End of stream\n&quot;);<br>
        g_main_loop_quit (loop);<br>
        break;<br>
<br>
    case GST_MESSAGE_ERROR: {<br>
        gchar *debug;<br>
        GError *error;<br>
<br>
        gst_message_parse_error (msg, &amp;error, &amp;debug);<br>
<br>
        g_printerr (&quot;Error: %s (%s) \n&quot;, error-&gt;message, debug);<br>
        g_free (debug);<br>
        g_error_free (error);<br>
<br>
        g_main_loop_quit (loop);<br>
        break;<br>
    }<br>
    default:<br>
        break;<br>
    }<br>
<br>
    return TRUE;<br>
}<br>
<br>
int<br>
main (int argc,<br>
        char *argv[])<br>
{<br>
    GMainLoop *loop;<br>
<br>
    GstElement *pipeline;<br>
    GstBus *bus;<br>
<br>
    /* Initialisation */<br>
    gst_init (&amp;argc, &amp;argv);<br>
<br>
    loop = g_main_loop_new (NULL, FALSE);<br>
<br>
<br>
    /* Check input arguments */<br>
    if (argc != 2) {<br>
        g_printerr (&quot;Usage: %s &lt;AVI filename&gt;\n&quot;, argv[0]);<br>
        return -1;<br>
    }<br>
<br>
<br>
    /* Create gstreamer elements */<br>
    pipeline = gst_pipeline_new (&quot;media-player&quot;);<br>
    source = gst_element_factory_make (&quot;filesrc&quot;, &quot;file-source&quot;);<br>
    demuxer = gst_element_factory_make (&quot;avidemux&quot;, &quot;avi-demuxer&quot;);<br>
    decvd = gst_element_factory_make (&quot;decodebin&quot;, &quot;video-decoder&quot;);<br>
    vcolorspace = gst_element_factory_make (&quot;ffmpegcolorspace&quot;,<br>
&quot;color-space&quot;);<br>
<br>
    vdsink = gst_element_factory_make (&quot;autovideosink&quot;, &quot;video-sink&quot;);<br>
    vdqueue = gst_element_factory_make (&quot;queue&quot;, &quot;video-queue&quot;);<br>
<br>
<br>
    if (!pipeline || !source || !demuxer || !decvd || !vdsink<br>
            || !vdqueue) {<br>
        g_printerr (&quot;One element could not be created. Exiting.\n&quot;);<br>
        return -1;<br>
    }<br>
<br>
    /* Set up the pipeline */<br>
<br>
    /* we set the input filename to the source element */<br>
    g_object_set (G_OBJECT (source), &quot;location&quot;, argv[1], NULL);<br>
<br>
    /* we add a message handler */<br>
    bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));<br>
    gst_bus_add_watch (bus, bus_call, loop);<br>
    gst_object_unref (bus);<br>
<br>
    gst_bin_add_many (GST_BIN (pipeline), source, demuxer, decvd, vdqueue,<br>
vdsink, NULL);<br>
<br>
    gst_element_link (source, demuxer);<br>
    gst_element_link (demuxer,vdqueue);<br>
    gst_element_link (vdqueue, decvd);<br>
    gst_element_link (decvd, vcolorspace);<br>
    gst_element_link (vcolorspace, vdsink);<br>
<br>
    g_signal_connect (demuxer, &quot;pad-added&quot;, G_CALLBACK (on_pad_added),<br>
decvd);<br>
    //g_signal_connect (decvd, &quot;pad-added&quot;, G_CALLBACK (on_pad_added),<br>
NULL);<br>
<br>
    /* Set the pipeline to &quot;playing&quot; state*/<br>
    g_print (&quot;Now playing: %s\n&quot;, argv[1]);<br>
    gst_element_set_state (pipeline, GST_STATE_PLAYING);<br>
<br>
    /* Iterate */<br>
    g_print (&quot;Running...\n&quot;);<br>
    g_main_loop_run (loop);<br>
<br>
    /* Out of the main loop, clean up nicely */<br>
    g_print (&quot;Returned, stopping playback\n&quot;);<br>
    gst_element_set_state (pipeline, GST_STATE_NULL);<br>
<br>
    g_print (&quot;Deleting pipeline\n&quot;);<br>
    gst_object_unref (GST_OBJECT (pipeline));<br>
<br>
    return 0;<br>
}<br>
<br>
------------------code-end--------------<br>
<br>
I get the following mistake:<br>
<br>
(play-avi2:4453): GStreamer-WARNING **: Trying to connect elements that<br>
don&#39;t share a common ancestor: color-space and video-sink<br>
<br>
(play-avi2:4453): GStreamer-WARNING **: Trying to connect elements that<br>
don&#39;t share a common ancestor: color-space and video-sink<br>
Now playing: avi-test2.avi<br>
** (play-avi2:4453): DEBUG: A new pad video_00 was created<br>
<br>
** (play-avi2:4453): DEBUG: Linking video pad to dec_vd<br>
Running...<br>
Error: Interner Datenstromfehler. (gstavidemux.c(5134): gst_avi_demux_loop<br>
(): /GstPipeline:media-player/GstAviDemux:avi-demuxer:<br>
streaming stopped, reason not-linked)<br>
Returned, stopping playback<br>
Deleting pipeline<br>
<br>
<br>
I also tried the command-line tool:  gst-launch filesrc<br>
location=avi-test2.avi ! avidemux name=demux demux.video_00 ! queue !<br>
decodebin ! ffmpegcolorspace ! videoscale ! autovideosink<br>
<br>
On this way it is working, but with the code it is not possible to play the<br>
avi-file. I think the mistake is at the dynamic src-pad from the avidemuxer,<br>
but I have no idea how to fix it.<br>
<br>
<br>
Best regards, Andreas<br>
<br>
<br>
___________________________________________________________<br>
Schon gehört? <a href="http://WEB.DE" target="_blank">WEB.DE</a> hat einen genialen Phishing-Filter in die<br>
Toolbar eingebaut! <a href="http://produkte.web.de/go/toolbar" target="_blank">http://produkte.web.de/go/toolbar</a><br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Regards,<br><br>Sudarshan Bisht<br>