Hi<br><br>When chaning the code yo improve my debug output I mis-takenly removed my uridecodebin.<br><br>Here is the code now, but it still does not link correctly and I get no audio out.<br><br>    virtual bool init()<br>
    {<br>        if (!GStreamerPlayerBase::init()) {<br>            return false;<br>        }<br>        <br>        pipeline = gst_pipeline_new(&quot;&quot;);<br><br>        // Audio bin<br>        audiobin = gst_bin_new(&quot;audiobin&quot;);<br>
        qDebug() &lt;&lt; &quot;adding audiobin to pipeline&quot;;<br>        gst_bin_add(GST_BIN(pipeline), audiobin);<br><br>        qDebug() &lt;&lt; &quot;adding elements&quot;;<br>        _sourceQ = gst_element_factory_make(&quot;queue2&quot;, NULL);<br>
        quint64 maxBufferTime = 0; // disable<br>        guint maxBufferBytes = Settings::getValue&lt;int&gt;(Settings::SECTION_RECEIVE<br>            + Settings::RECEIVE_MAX_BUFFER_SIZE);<br>        guint highPercent = Settings::getValue&lt;int&gt;(Settings::SECTION_RECEIVE<br>
            + Settings::RECEIVE_BUFFER_HIGHPERC);<br>        guint lowPercent = Settings::getValue&lt;int&gt;(Settings::SECTION_RECEIVE<br>            + Settings::RECEIVE_BUFFER_LOWPERC);<br>        bool useBuffering = Settings::getValue&lt;int&gt;(Settings::SECTION_RECEIVE<br>
            + Settings::RECEIVE_USE_BUFFER);<br><br>        //this queue is used to force buffering of more data, the intention<br>        //being to help with internet radio drop out<br>        g_object_set(G_OBJECT(_sourceQ),<br>
                        &quot;max-size-buffers&quot;, 0,<br>                        &quot;max-size-time&quot;, maxBufferTime,<br>                        &quot;max-size-bytes&quot;, maxBufferBytes,<br>                        &quot;use-buffering&quot;, useBuffering,<br>
                        &quot;high-percent&quot;, highPercent,<br>                        &quot;low-percent&quot;, lowPercent,<br>                        NULL);<br><br>        qDebug() &lt;&lt; &quot;add source to bin elements&quot;;<br>
        gst_bin_add(GST_BIN(audiobin), _sourceQ);<br><br>        qDebug() &lt;&lt; &quot;cret sourceQ sink pad&quot;;<br>        GstPad* pad = gst_element_get_pad(_sourceQ, &quot;sink&quot;);<br>        gst_element_add_pad(audiobin, gst_ghost_pad_new(&quot;sink&quot;, pad));<br>
        gst_object_unref(pad);<br><br>        uriDecodebin = gst_element_factory_make(&quot;uridecodebin&quot;, NULL);<br>        gst_bin_add(GST_BIN(pipeline), uriDecodebin);<br><br>        g_object_set(G_OBJECT(uriDecodebin), &quot;buffer-size&quot;, 150000, NULL);<br>
        g_object_set(G_OBJECT(uriDecodebin), &quot;download&quot;, false, NULL);<br>        g_object_set(G_OBJECT(uriDecodebin), &quot;use-buffering&quot;, false, NULL);<br>        g_signal_connect(G_OBJECT(uriDecodebin), &quot;drained&quot;, G_CALLBACK(sourceDrainedCallback), this);<br>
        /* connect uridecodebin to _sourceQ when it creates its output pad */<br>        qDebug() &lt;&lt; &quot;adding uriDeecode callback&quot;;<br>        g_signal_connect(G_OBJECT(uriDecodebin), &quot;pad-added&quot;, G_CALLBACK(callbackPadAdded), this);<br>
<br>        qDebug() &lt;&lt; &quot;init output stage&quot;;<br>        initOutputStage(GST_BIN(pipeline));<br><br>        qDebug() &lt;&lt; &quot;ref elements&quot;;<br>        gst_object_ref(uriDecodebin);<br>        gst_object_ref(_sourceQ);<br>
<br><div class="gmail_quote"><div>        return true;<br>    }<br><br><br>Cheers,<br>Stuart<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Message: 5<br>
Date: Wed, 5 Oct 2011 16:15:50 +0800<br>
From: Stuart Gray &lt;<a href="mailto:stuart68@gmail.com">stuart68@gmail.com</a>&gt;<br>
Subject: Re: Name queue20 is not unique in bin , not adding - when<br>
        connecting      uridecodebin to queue2<br>
To: <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
Message-ID:<br>
        &lt;<a href="mailto:CAG2RAVYtZWYgTumW1-Socf92MAjnytt4oFPTDaY_yRBZ_GLKuw@mail.gmail.com">CAG2RAVYtZWYgTumW1-Socf92MAjnytt4oFPTDaY_yRBZ_GLKuw@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br>
<br>
Hi Tim,<br>
<br>
I had already begun to think of an alternative way to do this. I was<br>
thinking about using BINs.<br>
<br>
As I am running within an embedded system I need to queue2 to put the second<br>
part of the pipeline into a different thread and also to buffer data in a<br>
way that I can control.<br>
<br>
I have re-written the code as following:<br>
<br>
<br>
    virtual bool init()<br>
    {<br>
        if (!GStreamerPlayerBase::init()) {<br>
            return false;<br>
        }<br>
<br>
        pipeline = gst_pipeline_new(&quot;&quot;);<br>
<br>
        // Audio bin<br>
        audiobin = gst_bin_new(&quot;audiobin&quot;);<br>
        qDebug() &lt;&lt; &quot;adding audiobin to pipeline&quot;;<br>
        gst_bin_add(GST_BIN(pipeline), audiobin);<br>
<br>
        qDebug() &lt;&lt; &quot;adding elements&quot;;<br>
        _sourceQ = gst_element_factory_make(&quot;queue2&quot;, NULL);<br>
        quint64 maxBufferTime = 0; // disable<br>
        guint maxBufferBytes =<br>
Settings::getValue&lt;int&gt;(Settings::SECTION_RECEIVE<br>
            + Settings::RECEIVE_MAX_BUFFER_SIZE);<br>
        guint highPercent =<br>
Settings::getValue&lt;int&gt;(Settings::SECTION_RECEIVE<br>
            + Settings::RECEIVE_BUFFER_HIGHPERC);<br>
        guint lowPercent = Settings::getValue&lt;int&gt;(Settings::SECTION_RECEIVE<br>
            + Settings::RECEIVE_BUFFER_LOWPERC);<br>
        bool useBuffering =<br>
Settings::getValue&lt;int&gt;(Settings::SECTION_RECEIVE<br>
            + Settings::RECEIVE_USE_BUFFER);<br>
<br>
        //this queue is used to force buffering of more data, the intention<br>
        //being to help with internet radio drop out<br>
        g_object_set(G_OBJECT(_sourceQ),<br>
                        &quot;max-size-buffers&quot;, 0,<br>
                        &quot;max-size-time&quot;, maxBufferTime,<br>
                        &quot;max-size-bytes&quot;, maxBufferBytes,<br>
                        &quot;use-buffering&quot;, useBuffering,<br>
                        &quot;high-percent&quot;, highPercent,<br>
                        &quot;low-percent&quot;, lowPercent,<br>
                        NULL);<br>
<br>
        qDebug() &lt;&lt; &quot;add source to bin elements&quot;;<br>
        gst_bin_add(GST_BIN(audiobin), _sourceQ);<br>
<br>
        qDebug() &lt;&lt; &quot;create sourceQ sink pad&quot;;<br>
        GstPad* pad = gst_element_get_pad(_sourceQ, &quot;sink&quot;);<br>
        gst_element_add_pad(audiobin, gst_ghost_pad_new(&quot;sink&quot;, pad));<br>
        gst_object_unref(pad);<br>
<br>
<br>
        qDebug() &lt;&lt; &quot;init output stage&quot;;<br>
        initOutputStage(GST_BIN(pipeline));<br>
<br>
        qDebug() &lt;&lt; &quot;ref elements&quot;;<br>
        gst_object_ref(uriDecodebin);<br>
        gst_object_ref(_sourceQ);<br>
        return true;<br>
    }<br>
<br>
my callbackPadAdded is:<br>
<br>
    static void callbackPadAdded(GstElement *uriDecodebin,<br>
                                 GstPad     *pad,<br>
                                 gpointer self)<br>
    {<br>
        GStreamerDecodebinPrivate* obj =<br>
reinterpret_cast&lt;GStreamerDecodebinPrivate*&gt;(self);<br>
        GstPad* const audiopad = gst_element_get_pad(obj-&gt;audiobin, &quot;sink&quot;);<br>
<br>
        qDebug() &lt;&lt; &quot;uridecodebin pad add started&quot;;<br>
        Q_UNUSED(uriDecodebin);<br>
        if (GST_PAD_IS_LINKED(audiopad)) {<br>
            qDebug() &lt;&lt; &quot;audiopad is already linked. Unlinking old pad.&quot;;<br>
            gst_pad_unlink(audiopad, GST_PAD_PEER(audiopad));<br>
        }<br>
<br>
        qDebug() &lt;&lt; &quot;uridecodebin pad added&quot;;<br>
<br>
        gst_pad_link(pad, audiopad);<br>
<br>
        gst_object_unref(audiopad);<br>
    }<br>
<br>
<br>
For the above I would like to add setting of caps to the uridecodebin.<br>
<br>
Setting of the output stage is:<br>
<br>
    void initOutputStage(GstBin* outputBin)<br>
    {<br>
        QString dev = Settings::getValue&lt;QString&gt;( Settings::SECTION_DEVICES<br>
+ Settings::AUDIO_OUTPUT );<br>
        _pcmSink = gst_element_factory_make(&quot;alsasink&quot;, NULL);<br>
        g_object_set(G_OBJECT(_pcmSink), &quot;device&quot;, dev.toLatin1().data(),<br>
NULL);<br>
<br>
        GstBaseAudioSinkSlaveMethod slaveMethod =<br>
GST_BASE_AUDIO_SINK_SLAVE_NONE;<br>
        g_object_set(G_OBJECT(_pcmSink), &quot;sync&quot;, 0,<br>
                                        &quot;async&quot;, 0,<br>
                                        &quot;slave-method&quot;, slaveMethod,<br>
                                        NULL);<br>
<br>
<br>
        gst_bin_add(GST_BIN(outputBin), _pcmSink);<br>
        // link the static parts together<br>
        gst_element_link(_pcmSink, NULL);<br>
<br>
        bool usePlayBin = Settings::getValue&lt;bool&gt;(Settings::SECTION_AUDIO +<br>
Settings::USE_PLAYBIN);<br>
<br>
    }<br>
<br>
<br>
I get no audio from the code when I try to run this. I do not see how to<br>
link the BUN together and get it into the playing state.<br>
<br>
I have the following:<br>
<br>
        gst_element_link_many(uriDecodebin, _sourceQ, _pcmSink, NULL);<br>
<br>
<br>
During initialization I get the following warning:<br>
<br>
ref elements<br>
<br>
(&lt;unknown&gt;:2847): GStreamer-CRITICAL **: gst_object_ref: assertion `object<br>
!= NULL&#39; failed<br>
<br>
When I try to link it all together I get:<br>
<br>
link many in streaming<br>
<br>
(&lt;unknown&gt;:2847): GStreamer-CRITICAL **: gst_element_link_many: assertion<br>
`GST_IS_ELEMENT (element_1)&#39; failed<br>
<br>
Code:<br>
<br>
    virtual void linkStreaming()<br>
    {<br>
        qDebug() &lt;&lt; &quot;linking in streaming&quot;;<br>
<br>
        gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_NULL);<br>
<br>
        if (passThroughLinked) {<br>
            gst_element_set_state(GST_ELEMENT(recPipeline), GST_STATE_NULL);<br>
//            gst_bin_remove_many(GST_BIN(pipeline), passThroughFakeSource,<br>
passThroughCapsFilter, _audioResample, NULL);<br>
        }<br>
<br>
        qDebug() &lt;&lt; &quot;link many in streaming&quot;;<br>
        gst_element_link_many(uriDecodebin, _sourceQ, _pcmSink, NULL);<br>
<br>
        passThroughLinked = false;<br>
    }<br>
<br>
I think if I use the BIN to put _sourceQ into I can get the callBackPadAdded<br>
to work correctly. But with BINs I am unsure how to link them together<br>
correctly and I suspect this is where my error is.<br>
<br>
My goal is to have the very simple pipeline:<br>
<br>
             uridecodebin ! queue2 ! alsasink<br>
<br>
Thanks,<br>
Stuart<br>
<br>
<br>
On 5 October 2011 03:00, &lt;<a href="mailto:gstreamer-devel-request@lists.freedesktop.org">gstreamer-devel-request@lists.freedesktop.org</a>&gt;wrote:<br>
<br>
&gt; Send gstreamer-devel mailing list submissions to<br>
&gt;        <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
&gt;<br>
&gt; To subscribe or unsubscribe via the World Wide Web, visit<br>
&gt;        <a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
&gt; or, via email, send a message with subject or body &#39;help&#39; to<br>
&gt;        <a href="mailto:gstreamer-devel-request@lists.freedesktop.org">gstreamer-devel-request@lists.freedesktop.org</a><br>
&gt;<br>
&gt; You can reach the person managing the list at<br>
&gt;        <a href="mailto:gstreamer-devel-owner@lists.freedesktop.org">gstreamer-devel-owner@lists.freedesktop.org</a><br>
&gt;<br>
&gt; When replying, please edit your Subject line so it is more specific<br>
&gt; than &quot;Re: Contents of gstreamer-devel digest...&quot;<br>
&gt;<br>
&gt;<br>
&gt; Today&#39;s Topics:<br>
&gt;<br>
&gt;   1. Re: Name queue20 is not unique in bin , not adding - when<br>
&gt;      connecting uridecodebin to queue2 (Tim-Philipp M?ller)<br>
&gt;<br>
&gt;<br>
&gt; ----------------------------------------------------------------------<br>
&gt;<br>
&gt; Message: 1<br>
&gt; Date: Tue, 04 Oct 2011 09:25:52 +0100<br>
&gt; From: Tim-Philipp M?ller &lt;<a href="mailto:t.i.m@zen.co.uk">t.i.m@zen.co.uk</a>&gt;<br>
&gt; Subject: Re: Name queue20 is not unique in bin , not adding - when<br>
&gt;        connecting uridecodebin to queue2<br>
&gt; To: <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
&gt; Message-ID: &lt;1317716752.4063.3.camel@zingle&gt;<br>
&gt; Content-Type: text/plain; charset=&quot;UTF-8&quot;<br>
&gt;<br>
&gt; On Tue, 2011-10-04 at 10:43 +0800, Stuart Gray wrote:<br>
&gt;<br>
&gt; &gt; In trying to connect uridecodebin to queue2 I get the following output<br>
&gt; &gt; from gstreamer:<br>
&gt; &gt;<br>
&gt; &gt; (&lt;unknown&gt;:1363): GStreamer-WARNING **: Name queue20 is not unique in<br>
&gt; &gt; bin , not adding<br>
&gt; &gt;<br>
&gt; &gt; My code is as follows:<br>
&gt; &gt;<br>
&gt; &gt;         pipeline = gst_pipeline_new(&quot;&quot;);<br>
&gt; &gt;<br>
&gt; &gt;         uriDecodebin = gst_element_factory_make(&quot;uridecodebin&quot;, NULL);<br>
&gt; &gt;<br>
&gt; &gt;         g_object_set(G_OBJECT(uriDecodebin), &quot;buffer-size&quot;, 150000,<br>
&gt; &gt; NULL);<br>
&gt; &gt;         g_object_set(G_OBJECT(uriDecodebin), &quot;download&quot;, false, NULL);<br>
&gt; &gt;         g_object_set(G_OBJECT(uriDecodebin), &quot;use-buffering&quot;, false,<br>
&gt; &gt; NULL);<br>
&gt; &gt;         g_signal_connect(G_OBJECT(uriDecodebin), &quot;drained&quot;,<br>
&gt; &gt; G_CALLBACK(sourceDrainedCallback), this);<br>
&gt; &gt;         /* connect uridecodebin to _sourceQ when it creates its output<br>
&gt; &gt; pad */<br>
&gt; &gt;         g_signal_connect(G_OBJECT(uriDecodebin), &quot;pad-added&quot;,<br>
&gt; &gt; G_CALLBACK(callbackPadAdded), this);<br>
&gt; &gt;<br>
&gt; &gt;         outputBin = gst_bin_new(&quot;output-bin&quot;);<br>
&gt; &gt; ...<br>
&gt; &gt;         _sourceQ = gst_element_factory_make(&quot;queue2&quot;, NULL);<br>
&gt; &gt;         gst_bin_add_many(GST_BIN(outputBin), _sourceQ, _pcmSink,<br>
&gt; &gt; NULL);<br>
&gt; &gt; ...<br>
&gt;<br>
&gt; What does your callbackPadAdded look like?<br>
&gt;<br>
&gt; I&#39;m guessing you are creating &quot;queue&quot; elements in there. It&#39;s basically<br>
&gt; a bug in the way GStreamer creates default names for elements if you<br>
&gt; don&#39;t specify one. The first &quot;queue2&quot; instance will get named &quot;queue20&quot;<br>
&gt; and the twentieth &quot;queue&quot; instance will get named &quot;queue20&quot; as well,<br>
&gt; which may cause problems if you are using both at the same time. It&#39;s<br>
&gt; hard to change now though, because it would break code that relies on<br>
&gt; the the naming scheme.<br>
&gt;<br>
&gt; In this case, you could just use a normal queue instead of queue2 before<br>
&gt; the sink (or just not use a queue at all?).<br>
&gt;<br>
&gt; Cheers<br>
&gt;  -Tim<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; ------------------------------<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; gstreamer-devel mailing list<br>
&gt; <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
&gt; <a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
&gt;<br>
&gt;<br>
&gt; End of gstreamer-devel Digest, Vol 9, Issue 8<br>
&gt; *********************************************<br>
&gt;<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href="http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20111005/469630ca/attachment.htm" target="_blank">http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20111005/469630ca/attachment.htm</a>&gt;<br>

<br>
------------------------------<br>
<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>
<br>
<br>
End of gstreamer-devel Digest, Vol 9, Issue 10<br>
**********************************************<br>
</blockquote></div><br>