<html><head></head><body><div class="ydpd5994787yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div><div><br></div><div dir="ltr" data-setdir="false"><span><span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;">CUSTOM_PARSER_ELEMENT and <span><span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;">audioconvert linked?</span></span></span></span><br></div><div class="ydpd5994787signature"><div><br></div><div><br></div><div>Sent from Yahoo Mail. <a href="https://yho.com/148vdq" rel="nofollow" target="_blank">Get the app</a></div></div></div>
        <div><br></div><div><br></div>
        
        </div><div id="yahoo_quoted_4311858993" class="yahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    On Friday, 5 May, 2023 at 06:03:50 am GMT-5, Bhoomil Chavda via gstreamer-devel <gstreamer-devel@lists.freedesktop.org> wrote:
                </div>
                <div><br></div>
                <div><br></div>
                <div><div id="yiv2319368492"><div dir="ltr"><p>Hi all,<br>I found one issue with appsrc similar like <a rel="nofollow noopener noreferrer" target="_blank" href="https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/372" title="failing to change appsrc caps dynamically on jpeg" class="yiv2319368492gmail-gfm yiv2319368492gmail-gfm-issue">#372 (closed)</a>.</p>
<p>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>Below is my pipeline looks for PCM audio,
<code>appsrc ! audioconvert ! audioresample ! "audio/x-raw, rate=48000, format=F32LE" ! appsink</code></p>
<p>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>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>NOTE: there is detection logic which can detect PCM/compress switching and from the callback I have did,</p><ol><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>
</div></div>
            </div>
        </div></body></html>