<div dir="ltr"><div>Hello,<br><br>I'm facing some problem while playing with gstreamer dynamic pipelines.<br>Need your help / suggestions based on below scenario:<br><br>I have a gstreamer demuxer plugin (not native plugin) with 1 video and 1 audio pad.<br>This plugin has 2 source pads: video pad, audio pad.<br>For each pad there is dedicated gst_buffer_pool allocated which<br>containd pool of buffers to host Video and Audio ES post demuxing.<br>A/V playback is working OK<br><br>Based on requirement, demuxer has to switch to another audio present in the container (MP4) at run time when gstreamer pipeline is in playing state.<br><br>Now demux has to switch to another another as mentioned above which has different codec type. So following the dynamic pipeline principle, following steps are done in sequence:<br>While injection to demux video pad is ongoing (I understand that it should be ok to let continue video inject because we are considering deletetion and creation of audio only chain) ,<br>older audio pad is removed by following below steps:<br>1. gst_pad_push_event (audio_stream->pad, gst_event_new_flush_start ());<br>2. gst_pad_push_event (audio_stream->pad, gst_event_new_flush_stop (TRUE));<br>3. gst_pad_push_event (audio_stream->pad, gst_event_new_eos ());<br>4. Flush the buffer pool associated associated with audio stream<br>5. gst_element_remove_pad (xx, audio_stream->pad);<br>6. gst_element_no_more_pads (xx);<br><br>And then a new audio pad is created with following operations<br>1. gst_pad_set_active pad<br>2. gst_pad_use_fixed_caps<br>3. gst_pad_push_event gst_event_new_stream_start<br>4. gst_pad_set_caps pad<br>5. gst_element_add_pad<br>6. new segment event<br>7. caps event<br>8. push buffers<br><br>gstreamer version: 1.4.5<br><br>The expectation was, after above steps, we can inject audio buffers on new audio pad and overall there should be just change in audio stream with no problem on video.<br><br>But the observations are different !!!<br>Video is stalled for some time when older audio pad is deleted and new audio pad is created.<br>Thereafter video playback is fine but there is no audio and from demux perspective audio packets are pushed without any error on new audio pad.<br>And the pipeline dump gives an idea that older chain is still not deleted and new chain is not built yet.<br><br>Taking dump of GST pipeline it seems that older pipeline is not deleted and new pipeline from new audio pad is partially created upto proxypad16 inside decodebin,<br>This pad is connected with Gstaacparse src pad but the chain meets dead end at this stage !!!!<br><br>gst_pad_push() is always successful on new audio pad. The buffers which are pushed on audio pad are allocated from buffer pool.<br><br><br>Kindly suggest your opinion on handling this dynamic pipeline scenario.<br>Any suggestions for debugging will be helpful<br><br>Thanks <br></div>Nitin<br></div>