<div dir="ltr"><div><div>My code is is similar to tutorial 3 and schematically looks like this:<br></div><div> - build of elements </div><div> - add and link them to pipeline</div><div> - add connect_pad_added handler for hlsdemux2</div><div> - change pipeline state to Playing</div></div>According to debugging, pipeline changes its state from null to ready, then pad_added handler is triggered, and throws an error because current_caps() returns null.<div>If I do not request caps, then everything works and pads will be attached successfully. I can determine the mediatype by pad name, "audio_00" or "video_00", but in this case I have to use hardcode for decoder, so its works only for test hls stream.<br></div><div><br></div><div>I forgot to mention one detail - the source is Live Stream hls so I set STREAMS_AWARE bin flag for it. Maybe this affects something.<br></div><div>Also i tried to add add_probe handler on gst::PadProbeType::EVENT_BOTH to hlsddemux2 src pad. It displays caps at each trigger. And result is:</div><div>For hlsdemux2:</div><div><a href="https://imgbox.com/Ee9Uz3Gd">https://imgbox.com/Ee9Uz3Gd</a><br></div><div>For uridecodebin3:</div><div><a href="https://imgbox.com/1VBWZqCK">https://imgbox.com/1VBWZqCK</a><br></div><div><br></div><div>It turns out that for uridecodebin3 caps set immediately, and for Demuxer only after some time.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">ср, 1 мар. 2023 г. в 23:58, Nicolas Dufresne <<a href="mailto:nicolas@ndufresne.ca">nicolas@ndufresne.ca</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Le mercredi 01 mars 2023 à 14:58 +0300, Flash via gstreamer-devel a écrit :<br>
> Hi!<br>
> I am trying to reproduce part of uridecodebin3 pipeline. Something like <br>
> souphttp => typefind => hlsdemux => multiqueue => %some_decoders%<br>
> <br>
> When I call current_caps() in pad_add handler (like in Basic tutorial #3),<br>
> the response always is null.<br>
> Part of debug output:<br>
> 0:00:03.780275220 9547 0x7fddd86411e0 INFO GST_ELEMENT_PADS<br>
> gstelement.c:758:gst_element_add_pad:<hlsdemux2> adding pad 'video_00'<br>
> 0:00:03.780281654 9547 0x7fddd86411e0 DEBUG GST_REFCOUNTING<br>
> gstobject.c:708:gst_object_set_parent:<'':video_00> set parent (ref and sink)<br>
> 0:00:03.780292735 9547 0x7fddd86411e0 DEBUG GST_PADS<br>
> gstpad.c:1103:gst_pad_set_active:<hlsdemux2:video_00> activating pad from none<br>
> 0:00:03.780298194 9547 0x7fddd86411e0 DEBUG GST_PADS<br>
> gstpad.c:1008:pre_activate:<hlsdemux2:video_00> setting pad into push mode,<br>
> unset flushing<br>
> 0:00:03.803780278 9547 0x7fddd86411e0 DEBUG GST_PADS<br>
> gstpad.c:1231:activate_mode_internal:<hlsdemux2:video_00> activated in push<br>
> mode<br>
> 0:00:03.803821999 9547 0x7fddd86411e0 DEBUG GST_CAPS<br>
> gstpad.c:2742:gst_pad_get_current_caps:<hlsdemux2:video_00> get current pad<br>
> caps (NULL)<br>
> <br>
> The pads do successfully link, however.<br>
> But to understand which decoder (h264? hevc? aac?) to use, I need to know what<br>
> the output of the demuxer pads is. How to get these caps?<br>
<br>
current_caps() is set after that CAPS event have passed through the pad. Have<br>
you started your pipeline ? Also, playbin3 uses StreamCollection instead of<br>
waiting for pads to appear.<br>
<br>
> <br>
> In the handler for uridecodebin, caps return normally.<br>
> Gstreamer version: 1.22.0<br>
> Language: rust<br>
> <br>
> Is there some kind of magic here? Or am I just doing something wrong?<br>
> <br>
> --<br>
> Regards<br>
> Flashick<br>
> <br>
> <br>
<br>
</blockquote></div>