audio track with input-selector -- pipeline not Playing

karimchtx karim_atiki at hotmail.com
Mon Apr 26 17:15:55 UTC 2021


I have a pipeline for playing an MKV content.

In the demux "pad-added" handler, I used to link the video_0 with a queue
and the remaining video related elems (convert, glsink etc)/.
audio_0 is connected to a queue, ac3_parse, ac3_decode etc.
audio_1 is ignored.
The pipeline works fine.

Now I want to be able to switch the audio track.
For that purpose  I've created an "input-selector" 

in the demux pad-added handler,  audio_0 is linked to input-selector:sink_0
and audio_1 is linked to input-selector:sink_1.

The linking code looks like:


        GstPadTemplate* padtemplate = nullptr;
        padtemplate =
gst_element_class_get_pad_template(GST_ELEMENT_GET_CLASS(data->audio_selector),
"sink_%u");
        sink_pad = gst_element_request_pad(data->audio_selector,
padtemplate, NULL, NULL);
        g_print("Obtained request pad %s for audio branch.\n",
gst_pad_get_name(sink_pad));
        sink_pad = gst_element_get_static_pad(data->audio_selector,
requested_pad.data());
        ...
        ret = gst_pad_link (new_pad, sink_pad);
            if (GST_PAD_LINK_FAILED (ret)) {
                g_print ("Type is '%s' but link failed.\n", new_pad_type);
            } else {
                g_print ("Link succeeded (type '%s').\n", new_pad_type);
               // GST_DEBUG_BIN_TO_DOT_FILE(GST_BIN(data->pipeline), 
               GST_DEBUG_GRAPH_SHOW_ALL, "pipeline");
        }

        g_object_set(data->audio_selector, "active-pad", sink_pad, nullptr);


But finally, the pipeline never goes to GST_STATE_PLAYING.
I don't know what I'm missing.
Knowing that the a "queue" element is just after the "input-selector"
element.

I don't see a relevant log message.

Any suggestion is welcome.

K.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list