How could I push ONE GstBuffer to TWO GstAdapters?

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

How could I push ONE GstBuffer to TWO GstAdapters?

Majaja
Hi:

I want to push "A" GstBuffer to "TWO" GstAdapters.

It is, one is used to deliver data & the other serves as a "CACHE".

Has there already been a convenient way?

One way I tried now is to duplicate the buffer such as:

  gst_buffer_copy_into (new_buf, buffer, GST_BUFFER_COPY_MEMORY | GST_BUFFER_COPY_DEEP ,
            0, gst_buffer_get_size (original_buffer));

push original_buffer into original  adapter such as

 gst_adapter_push (original_adapter, original_buffer);

and then push the new_buffer into the new adapter such as:

 gst_adapter_push (new_adapter, new_buffer);



I believe that it is NOT the best way & would like find a better method instead.

Thank you.

Reply | Threaded
Open this post in threaded view
|

Re: How could I push ONE GstBuffer to TWO GstAdapters?

Sebastian Dröge-3
On Mi, 2016-05-18 at 03:01 -0700, Majaja wrote:
> [...]
> I believe that it is NOT the best way & would like find a better
> method instead.

gst_adapter_push(adapter1, gst_buffer_ref(buffer));
gst_adapter_push(adapter2, buffer);

There is no need for duplicating the buffer.

--
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