Null src caps in pad_added for hsldemux2

Nicolas Dufresne nicolas at ndufresne.ca
Wed Mar 1 20:58:02 UTC 2023


Le mercredi 01 mars 2023 à 14:58 +0300, Flash via gstreamer-devel a écrit :
> Hi!
> I am trying to reproduce part of uridecodebin3 pipeline. Something like 
> souphttp => typefind => hlsdemux => multiqueue => %some_decoders%
> 
>  When I call current_caps() in pad_add handler (like in Basic tutorial #3),
> the response always is null.
> Part of debug output:
> 0:00:03.780275220  9547 0x7fddd86411e0 INFO        GST_ELEMENT_PADS
> gstelement.c:758:gst_element_add_pad:<hlsdemux2> adding pad 'video_00'
> 0:00:03.780281654  9547 0x7fddd86411e0 DEBUG        GST_REFCOUNTING
> gstobject.c:708:gst_object_set_parent:<'':video_00> set parent (ref and sink)
> 0:00:03.780292735  9547 0x7fddd86411e0 DEBUG               GST_PADS
> gstpad.c:1103:gst_pad_set_active:<hlsdemux2:video_00> activating pad from none
> 0:00:03.780298194  9547 0x7fddd86411e0 DEBUG               GST_PADS
> gstpad.c:1008:pre_activate:<hlsdemux2:video_00> setting pad into push mode,
> unset flushing
> 0:00:03.803780278  9547 0x7fddd86411e0 DEBUG               GST_PADS
> gstpad.c:1231:activate_mode_internal:<hlsdemux2:video_00> activated in push
> mode
> 0:00:03.803821999  9547 0x7fddd86411e0 DEBUG               GST_CAPS
> gstpad.c:2742:gst_pad_get_current_caps:<hlsdemux2:video_00> get current pad
> caps (NULL)
> 
> The pads do successfully link, however.
> But to understand which decoder (h264? hevc? aac?) to use, I need to know what
> the output of the demuxer pads is. How to get these caps?

current_caps() is set after that CAPS event have passed through the pad. Have
you started your pipeline ? Also, playbin3 uses StreamCollection instead of
waiting for pads to appear.

> 
> In the handler for uridecodebin, caps return normally.
> Gstreamer version: 1.22.0
> Language: rust
> 
> Is there some kind of magic here? Or am I just doing something wrong?
> 
> --
> Regards
> Flashick
> 
> 



More information about the gstreamer-devel mailing list