The Interface porting between the 0.10 and 1.0 -- GstCaps

Sebastian Dröge sebastian at centricular.com
Sun May 15 08:09:56 UTC 2016


On Sa, 2016-05-14 at 23:59 -0700, FranklinHuang wrote:
> According to the guide,
> 
>     GST_BUFFER_CAPS() is gone, caps are not set on buffers anymore but are
> set
>     on the pads where the buffer is pushed on. Likewise GST_BUFFER_COPY_CAPS
> is
>     not needed anymore. gst_buffer_get/set_caps() are gone too.
> 
> I have a interface API,
>    GstStructure* data_media =
> gst_caps_get_structure(GST_BUFFER_CAPS(buffer), 0);
> try to get the caps from the buffer in 0.10 version, 
> How I could change it to the 1.0 edition?

Either you catch the CAPS event on the sinkpad and cache the caps, or
you could get the current caps of the pad with
gst_pad_get_current_caps().

Depending on where you do all this, it can be racy though. You need to
get the caps from the streaming thread at the time this specific buffer
is arriving, otherwise it might be out of date.

GstSample is a data structure now that can hold buffer, caps and other
things.

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160515/f6431032/attachment.sig>


More information about the gstreamer-devel mailing list