Print out caps of an element

Nicolas Dufresne nicolas at ndufresne.ca
Mon Jan 20 14:41:36 UTC 2020


Le lun. 20 janv. 2020 05 h 45, m.lenz <m.lenz at kappa-optronics.com> a écrit :

> I tried out the following:
>
>   GstElement *videosink;
>   videosink = gst_element_factory_make ("udpsink", "videosink");
>   ...
>   GstPad *pad = gst_element_get_static_pad (videosink, "sink");
>   GstCaps *caps = gst_pad_get_current_caps(pad);
>
> But the returned pointer in caps is always NULL. The pointer of my pad
> referring to the videosink is found!
>
> Does the udpsink has no caps? Because this is what the documentation says
> about this. I also tried if(gst_pad_has_current_caps(pad)) and this is also
> always false.
>

Caps negotiation happens asynchronously. If your pipeline isn't running,
this is expected. You can also check the allowed caps if you prefer.


udpsink allow pretty much anything, so that won't be very useful.


> Maybe it is a problem, that the caps will not be passed on the next
> element?
> I created caps on appsrc and linked appsrc, rtpvrawpay and udpsink to a
> pipeline at the end of my application.
>

As said, caps will be negotiated asynchronously.


>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20200120/88c6e0c3/attachment.htm>


More information about the gstreamer-devel mailing list