Multiple input sources

Sérgio Agostinho sergio.r.agostinho at gmail.com
Fri Oct 16 06:37:31 PDT 2015


Hey,

For your uridecode bins, you're trying to link them against the
audioconverter instead of the input-selector. (You're also trying to link
your audioconver and output elements 3 times!)

The input-selector has request pads.
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-plugins/html/gstreamer-plugins-input-selector.html

You need to create the request pads through
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html#gst-element-get-request-pad
or preferably (since you specify the name) through
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html#gst-element-request-pad



Cheers

2015-10-15 8:47 GMT+02:00 symeon.mattes <symeon.mattes at gmail.com>:

> Hi,
>
> I'm trying to create a pipeline at which I'll be able to choose on the fly
> a
> different source. If we consider the following
>
> <
> http://gstreamer-devel.966125.n4.nabble.com/file/n4674095/PipelineWithoutInputSelector.png
> >
>
> *and the code*:
> GstElement *pipeline,*input,*audioconvert,*output;
>
> pipeline=gst_pipeline_new("mypipeline");
> input=gst_element_factory_make("osxaudiosrc",NULL);
> audioconvert=gst_element_factory_make("audioconvert",NULL);
> audioconvert=gst_element_factory_make("autoaudiosink",NULL);
>
> gst_bin_add_many(GST_BIN(pipeline),input,audioconvert,output,NULL);
> gst_element_link_many(input,audioconvert,output,NULL);
> gst_element_set_state(pipeline,GST_STATE_PLAYING);
>
> *or in case of of a file src I have*:
> GstElement *pipeline,*input,*audioconvert,*output;
>
> pipeline=gst_pipeline_new("mypipeline");
>
> input=gst_element_factory_make("uridecodebin",NULL);g_object_set(G_OBJECT(input,"uri","file1"));
> audioconvert=gst_element_factory_make("audioconvert",NULL);
> audioconvert=gst_element_factory_make("autoaudiosink",NULL);
>
> gst_bin_add_many(GST_BIN(pipeline),input,audioconvert,output,NULL);
>
> g_signal_connect(input,"pad-added",G_CALLBACK(handle_dynamic_link),gst_element_get_static_pad(audioconvert,"sink"));
> gst_element_link_many(audioconvert,output,NULL);
> gst_element_set_state(pipeline,GST_STATE_PLAYING);
>
>
> *where*
>
> static void handle_dynamic_link(GstPadTemplate *templ, GstPad *newpad,
> gpointer data)
> {
>    GstPad *target = (GstPad *) data;
>    gst_pad_link(newpad,target);
> }
>
> This works just fine!
>
> However, when I try to connect everything through input selector, then I
> don't have the expected result, i.e.
>
> <
> http://gstreamer-devel.966125.n4.nabble.com/file/n4674095/PipelineWithInputSelector.png
> >
>
> *with code:*
>
> GstElement
> *pipeline,*input1,input2,input3,*input_select,*audioconvert,*output;
>
> pipeline=gst_pipeline_new("mypipeline");
> input1=gst_element_factory_make("osxaudiosrc",NULL);
>
> input2=gst_element_factory_make("uridecodebin",NULL);g_object_set(G_OBJECT(input,"uri","file1"));
>
> input3=gst_element_factory_make("uridecodebin",NULL);g_object_set(G_OBJECT(input,"uri","file2"));
> input_select=gst_element_factory_make("input-selector",NULL);
> audioconvert=gst_element_factory_make("audioconvert",NULL);
> audioconvert=gst_element_factory_make("autoaudiosink",NULL);
>
>
> gst_bin_add_many(GST_BIN(pipeline),input1,input2,input3,input_select,audioconvert,output,NULL);
> gst_element_link_many(input1,input_select,,audioconvert,output,NULL);
>
> g_signal_connect(input2,"pad-added",G_CALLBACK(handle_dynamic_link),gst_element_get_static_pad(audioconvert,"sink_1"));
> gst_element_link_many(audioconvert,output,NULL);
>
> g_signal_connect(input2,"pad-added",G_CALLBACK(handle_dynamic_link),gst_element_get_static_pad(audioconvert,"sink_2"));
> gst_element_link_many(audioconvert,output,NULL);
>
> gst_element_set_state(pipeline,GST_STATE_PLAYING);
>
>
>
>
> Then when I change to the sink_1, i.e.
>
>
>
> g_object_set(G_OBJECT(input_select),'active-pad',gst_element_get_static_pad(input_select,"sink_1"))
>
>
>
> Nothing happens. I keep having the stream of the 1st input. I believe it
> has
> something to do with the dynamic pads, but I'm not so sure what/where I
> should look to.
>
>
>
>
>
> --
> View this message in context:
> http://gstreamer-devel.966125.n4.nabble.com/Multiple-input-sources-tp4674095.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20151016/19382b78/attachment.html>


More information about the gstreamer-devel mailing list