How do I set the cap in code
William Johnston
wgj at cast.uark.edu
Fri May 8 15:58:01 UTC 2020
I tried that first. And I tried it again just now to make sure. The caps
filter will not bind to EMPTY caps.
On 5/8/2020 1:27 AM, David Ing wrote:
> Setting caps directly on a pad is not always possible because the caps
> are basically negotiated as the pipeline moves from the READY to
> PAUSED state (IIRC). Part of this negotiation involves communicating
> with upstream and downstream elements to determine the caps at each
> stage of the pipeline (at each pad). I don't fully understand how it
> works (I am just a novice).
>
> You do have an option to link your pad to a capsfilter
> <https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-plugins/html/gstreamer-plugins-capsfilter.html> which
> would then place constraints on the caps of your pad. Basically the
> caps negotiation will be forced to come up with something that fits
> your caps filter, otherwise the pipeline will never enter the PAUSED
> state (you would see some kind of error).
>
> On Thu, May 7, 2020 at 8:28 PM William Johnston <wgj at cast.uark.edu
> <mailto:wgj at cast.uark.edu>> wrote:
>
> I have and element that looks like this:
>
> element: misbfixcoordinates1
> pad: videosink
> caps (writable): video/x-raw, format=(string)RGB
> template caps: video/x-raw, format=(string)RGB
> pad: misbsink
> caps (writable): EMPTY
> template caps: meta/klv
> pad: videosrc
> caps (writable): video/x-raw, format=(string)RGB,
> width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ],
> framerate=(fraction)[ 0/1, 2147483647/1 ]
> template caps: video/x-raw, format=(string)RGB
> pad: misbsrc
> caps (writable): EMPTY
> template caps: meta/klv
>
> See those "EMPTY" caps? I want to set them to something else. I
> thought
> this would work:
>
> GstPad*
> misbsinkPad=gst_element_get_static_pad(misbfixcoordinates,"misbsink");
> GstCaps* newCaps1=gst_caps_from_string("meta/klv");
> gst_pad_set_caps(misbsinkPad,newCaps1);
>
> But it doesn't change anything. Anyone know how to do this?
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> <mailto:gstreamer-devel at lists.freedesktop.org>
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
> _______________________________________________
> 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/20200508/df727aad/attachment.htm>
More information about the gstreamer-devel
mailing list