Name queue20 is not unique in bin , not adding - when connecting uridecodebin to queue2 (Stuart Gray)

Luciana Fujii luciana at fujii.eti.br
Thu Oct 6 12:04:03 PDT 2011


On Wed, 2011-10-05 at 16:37 +0800, Stuart Gray wrote:
> Hi
> 
> When chaning the code yo improve my debug output I mis-takenly removed
> my uridecodebin.

Didn't you also remove the code to link the queue to the sink? In the
callback you were linking the uridecodebin to the queue, before that you
should link the queue to the audiosink.

Regards,

Luciana Fujii

> Here is the code now, but it still does not link correctly and I get
> no audio out.
> 
>     virtual bool init()
>     {
>         if (!GStreamerPlayerBase::init()) {
>             return false;
>         }
>         
>         pipeline = gst_pipeline_new("");
> 
>         // Audio bin
>         audiobin = gst_bin_new("audiobin");
>         qDebug() << "adding audiobin to pipeline";
>         gst_bin_add(GST_BIN(pipeline), audiobin);
> 
>         qDebug() << "adding elements";
>         _sourceQ = gst_element_factory_make("queue2", NULL);
>         quint64 maxBufferTime = 0; // disable
>         guint maxBufferBytes =
> Settings::getValue<int>(Settings::SECTION_RECEIVE
>             + Settings::RECEIVE_MAX_BUFFER_SIZE);
>         guint highPercent =
> Settings::getValue<int>(Settings::SECTION_RECEIVE
>             + Settings::RECEIVE_BUFFER_HIGHPERC);
>         guint lowPercent =
> Settings::getValue<int>(Settings::SECTION_RECEIVE
>             + Settings::RECEIVE_BUFFER_LOWPERC);
>         bool useBuffering =
> Settings::getValue<int>(Settings::SECTION_RECEIVE
>             + Settings::RECEIVE_USE_BUFFER);
> 
>         //this queue is used to force buffering of more data, the
> intention
>         //being to help with internet radio drop out
>         g_object_set(G_OBJECT(_sourceQ),
>                         "max-size-buffers", 0,
>                         "max-size-time", maxBufferTime,
>                         "max-size-bytes", maxBufferBytes,
>                         "use-buffering", useBuffering,
>                         "high-percent", highPercent,
>                         "low-percent", lowPercent,
>                         NULL);
> 
>         qDebug() << "add source to bin elements";
>         gst_bin_add(GST_BIN(audiobin), _sourceQ);
> 
>         qDebug() << "cret sourceQ sink pad";
>         GstPad* pad = gst_element_get_pad(_sourceQ, "sink");
>         gst_element_add_pad(audiobin, gst_ghost_pad_new("sink", pad));
>         gst_object_unref(pad);
> 
>         uriDecodebin = gst_element_factory_make("uridecodebin", NULL);
>         gst_bin_add(GST_BIN(pipeline), uriDecodebin);
> 
>         g_object_set(G_OBJECT(uriDecodebin), "buffer-size", 150000,
> NULL);
>         g_object_set(G_OBJECT(uriDecodebin), "download", false, NULL);
>         g_object_set(G_OBJECT(uriDecodebin), "use-buffering", false,
> NULL);
>         g_signal_connect(G_OBJECT(uriDecodebin), "drained",
> G_CALLBACK(sourceDrainedCallback), this);
>         /* connect uridecodebin to _sourceQ when it creates its output
> pad */
>         qDebug() << "adding uriDeecode callback";
>         g_signal_connect(G_OBJECT(uriDecodebin), "pad-added",
> G_CALLBACK(callbackPadAdded), this);
> 
>         qDebug() << "init output stage";
>         initOutputStage(GST_BIN(pipeline));
> 
>         qDebug() << "ref elements";
>         gst_object_ref(uriDecodebin);
>         gst_object_ref(_sourceQ);
> 
>         return true;
>     }
> 
> 
> Cheers,
> Stuart





More information about the gstreamer-devel mailing list