Hi
When chaning the code yo improve my debug output I mis-takenly removed my uridecodebin. 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 Message: 5 _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
No matter how I try this, I never see my alsasink linking in the debug.
I have tried putting queue2 into a bin, creating a ghost pad and linking to the bin. I have also tried keeping it all as elements and linking uridecodebin, audioconvert, audioresample and then queue2, but each time I still do not see alsasink being linked. Using the queueBin just to hold queue2: gst_bin_add_many(GST_BIN(pipeline), uriDecodebin, queueBin, NULL); qDebug() << "link many in streaming"; gst_element_link_many(uriDecodebin, queueBin, _pcmSink, NULL); Others seemed to have ad issues linking uridecodebin to queue2, but this part seems to be fine, it is linking the queueBin to the alsasink, _psmSink that I cannot get to work. Do I need to create a src pad on the queueBin? Then add a callBackPadAdded on _pcmSink and when this gets called link it to a src pad on queueBin? I have debug.txttried using queue, but again it is the alsasink that does not get linked. My ideal pipeline would be: uridecodebin ! queue2 ! alsasink Using gst-launch this works really well, but I cannot code it up and get it to produce audio. Stuart |
In reply to this post by stuart68
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 _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |