<div dir="ltr">Hey, <div><br></div><div>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!)</div><div><br></div><div>The input-selector has request pads. </div><div><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-plugins/html/gstreamer-plugins-input-selector.html">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-plugins/html/gstreamer-plugins-input-selector.html</a><br></div><div><br></div><div>You need to create the request pads through</div><div><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html#gst-element-get-request-pad">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html#gst-element-get-request-pad</a><br></div><div>or preferably (since you specify the name) through</div><div><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html#gst-element-request-pad">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html#gst-element-request-pad</a><br></div><div><br></div><div><br></div><div><br></div><div>Cheers</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-10-15 8:47 GMT+02:00 symeon.mattes <span dir="ltr"><<a href="mailto:symeon.mattes@gmail.com" target="_blank">symeon.mattes@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I'm trying to create a pipeline at which I'll be able to choose on the fly a<br>
different source. If we consider the following<br>
<br>
<<a href="http://gstreamer-devel.966125.n4.nabble.com/file/n4674095/PipelineWithoutInputSelector.png" rel="noreferrer" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/file/n4674095/PipelineWithoutInputSelector.png</a>><br>
<br>
*and the code*:<br>
GstElement *pipeline,*input,*audioconvert,*output;<br>
<br>
pipeline=gst_pipeline_new("mypipeline");<br>
input=gst_element_factory_make("osxaudiosrc",NULL);<br>
audioconvert=gst_element_factory_make("audioconvert",NULL);<br>
audioconvert=gst_element_factory_make("autoaudiosink",NULL);<br>
<br>
gst_bin_add_many(GST_BIN(pipeline),input,audioconvert,output,NULL);<br>
gst_element_link_many(input,audioconvert,output,NULL);<br>
gst_element_set_state(pipeline,GST_STATE_PLAYING);<br>
<br>
*or in case of of a file src I have*:<br>
GstElement *pipeline,*input,*audioconvert,*output;<br>
<br>
pipeline=gst_pipeline_new("mypipeline");<br>
input=gst_element_factory_make("uridecodebin",NULL);g_object_set(G_OBJECT(input,"uri","file1"));<br>
audioconvert=gst_element_factory_make("audioconvert",NULL);<br>
audioconvert=gst_element_factory_make("autoaudiosink",NULL);<br>
<br>
gst_bin_add_many(GST_BIN(pipeline),input,audioconvert,output,NULL);<br>
g_signal_connect(input,"pad-added",G_CALLBACK(handle_dynamic_link),gst_element_get_static_pad(audioconvert,"sink"));<br>
gst_element_link_many(audioconvert,output,NULL);<br>
gst_element_set_state(pipeline,GST_STATE_PLAYING);<br>
<br>
<br>
*where*<br>
<br>
static void handle_dynamic_link(GstPadTemplate *templ, GstPad *newpad,<br>
gpointer data)<br>
{<br>
   GstPad *target = (GstPad *) data;<br>
   gst_pad_link(newpad,target);<br>
}<br>
<br>
This works just fine!<br>
<br>
However, when I try to connect everything through input selector, then I<br>
don't have the expected result, i.e.<br>
<br>
<<a href="http://gstreamer-devel.966125.n4.nabble.com/file/n4674095/PipelineWithInputSelector.png" rel="noreferrer" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/file/n4674095/PipelineWithInputSelector.png</a>><br>
<br>
*with code:*<br>
<br>
GstElement<br>
*pipeline,*input1,input2,input3,*input_select,*audioconvert,*output;<br>
<br>
pipeline=gst_pipeline_new("mypipeline");<br>
input1=gst_element_factory_make("osxaudiosrc",NULL);<br>
input2=gst_element_factory_make("uridecodebin",NULL);g_object_set(G_OBJECT(input,"uri","file1"));<br>
input3=gst_element_factory_make("uridecodebin",NULL);g_object_set(G_OBJECT(input,"uri","file2"));<br>
input_select=gst_element_factory_make("input-selector",NULL);<br>
audioconvert=gst_element_factory_make("audioconvert",NULL);<br>
audioconvert=gst_element_factory_make("autoaudiosink",NULL);<br>
<br>
gst_bin_add_many(GST_BIN(pipeline),input1,input2,input3,input_select,audioconvert,output,NULL);<br>
gst_element_link_many(input1,input_select,,audioconvert,output,NULL);<br>
g_signal_connect(input2,"pad-added",G_CALLBACK(handle_dynamic_link),gst_element_get_static_pad(audioconvert,"sink_1"));<br>
gst_element_link_many(audioconvert,output,NULL);<br>
g_signal_connect(input2,"pad-added",G_CALLBACK(handle_dynamic_link),gst_element_get_static_pad(audioconvert,"sink_2"));<br>
gst_element_link_many(audioconvert,output,NULL);<br>
<br>
gst_element_set_state(pipeline,GST_STATE_PLAYING);<br>
<br>
<br>
<br>
<br>
Then when I change to the sink_1, i.e.<br>
<br>
<br>
g_object_set(G_OBJECT(input_select),'active-pad',gst_element_get_static_pad(input_select,"sink_1"))<br>
<br>
<br>
<br>
Nothing happens. I keep having the stream of the 1st input. I believe it has<br>
something to do with the dynamic pads, but I'm not so sure what/where I<br>
should look to.<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/Multiple-input-sources-tp4674095.html" rel="noreferrer" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/Multiple-input-sources-tp4674095.html</a><br>
Sent from the GStreamer-devel mailing list archive at Nabble.com.<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" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div><br></div>