The Interface porting between the 0.10 and 1.0 -- GstCaps

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

The Interface porting between the 0.10 and 1.0 -- GstCaps

FranklinHuang
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?
Reply | Threaded
Open this post in threaded view
|

Re: The Interface porting between the 0.10 and 1.0 -- GstCaps

FranklinHuang
for more information,
We have a API with input the GstAppSink* sink, and gpointer user_data,
and we try to got the GstStructure data from the Caps,
in former way, we just got the buffer and from the buffer we use GST_BUFFER_CAPS to got the Caps,
Now the "GST_BUFFER_CAPS " is gone, so now in 1.0 edition,

How we do this operation ,to get the GstStructure  from a GstAppSink


Reply | Threaded
Open this post in threaded view
|

Re: The Interface porting between the 0.10 and 1.0 -- GstCaps

Sebastian Dröge-3
In reply to this post by FranklinHuang
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


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: The Interface porting between the 0.10 and 1.0 -- GstCaps

FranklinHuang
hi Sebastian,
Thanks your suggestion!
I would try gst_app_sink_get_caps to get the caps,
Reply | Threaded
Open this post in threaded view
|

Re: The Interface porting between the 0.10 and 1.0 -- GstCaps

Sebastian Dröge-3
On So, 2016-05-15 at 01:59 -0700, FranklinHuang wrote:
> hi Sebastian,
> Thanks your suggestion!
> I would try gst_app_sink_get_caps to get the caps,

appsink gives you a GstSample, not a GstBuffer. The GstSample contains
the buffer and its corresponding caps.

Getting the caps via gst_app_sink_get_caps() can give you caps that are
newer than your buffer, and as such wrong.

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


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment