<div dir="ltr"><p dir="auto">Hi all,<br>I found one issue with appsrc similar like <a href="https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/372" title="failing to change appsrc caps dynamically on jpeg" class="gmail-gfm gmail-gfm-issue">#372 (closed)</a>.</p>
<p dir="auto">Actaully I'm feeding my gstreamer pipeline from ALSA source, and to push and pull in application buffer I'm using appsrc and appsink.</p>
<p dir="auto">Below is my pipeline looks for PCM audio,
<code>appsrc ! audioconvert ! audioresample ! "audio/x-raw, rate=48000, format=F32LE" ! appsink</code></p>
<p dir="auto">and for Compressed audio,
<code>appsrc ! CUSTOM_PARSER_ELEMENT ! CUSTOM_DECODER_ELEMENT ! audioconvert ! audioresample ! "audio/x-raw, rate=48000, format=F32LE" ! appsink</code></p>
<p dir="auto">The default caps of appsrc is ANY and when I switch to PCM mode, I'm setting appsrc caps to "audio/x-raw, rate=WHATEVER_ALSA_GIVE_ME", format=WHATEVER_ALSA_GIVE_ME, channels=WHATEVER_ALSA_GIVE_ME". It is working fine. Event 48K to 44.1K switching and updating caps working fine in runtime.
But for compress path, when I switch back to ANY caps then negotiation has been failed. The reason behind setting ANY caps during compress mode is, my CUSTOM_PARSER_ELEMENT caps not known when I start streaming. Actually parser itself produce new caps so I don't want appsrc to deal with that so go with ANY caps <em>(That is not the case with PCM mode and that why I need audio/x-raw with other details so convert and resample can know)</em>****. Now this ANY caps based appsrc and CUSTOM_PARSER_ELEMENT not negotiated.</p>
<p dir="auto">NOTE: there is detection logic which can detect PCM/compress switching and from the callback I have did,</p><ol dir="auto"><li>unlink appsrc and audioconvert</li><li>set appsrc caps to ANY</li><li>link appsrc and CUSTOM_PARSER_ELEMENT.<br></li></ol><p>Regards,</p><p>Bhoomil C.</p></div>