I have a question about GstBuffer

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

I have a question about GstBuffer

OhsureBoy

static GstFlowReturn
gst_my_muxer_chain(GstPad *pad, GstObject *parent, GstBuffer *buf)
{
  GstMyMuxer *filter;
 
...
}




When we have the above source code, we have found that data is coming in due
to the change of the offset in the buf.

What I'm curious about here is, is there a way to view buf's data?

This is because we are creating a new plugin by separating the buf header
and payload.

Thank you for reading



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: I have a question about GstBuffer

Nicolas Dufresne-5
Le lundi 12 avril 2021 à 02:26 -0500, OhsureBoy a écrit :

> static GstFlowReturn
> gst_my_muxer_chain(GstPad *pad, GstObject *parent, GstBuffer *buf)
> {
>   GstMyMuxer *filter;
>   
>
>
>
> ...
> }
>
>
>
>
> When we have the above source code, we have found that data is coming in due
> to the change of the offset in the buf.
>
> What I'm curious about here is, is there a way to view buf's data?

GstBuffer are GstMemory container, they will contain one or more GstMemory
appended one after each other. You can "view" the data with a read only mapping
of the memory data, see gst_memory_map/unmap() function. As a convenience, you
may use gst_buffer_map/unmap() or gst_buffer_map_range()/unmao_range() to avoid
having to iterate the GstBuffer. You should though be aware that such mapping
will merge the data if the reselected range is over one or more GstMemory.

>
> This is because we are creating a new plugin by separating the buf header
> and payload.
>
> Thank you for reading
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


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