Avoid memcpy when passing buffers

Ottavio Campana o.campana at videotec.com
Thu Dec 11 15:48:32 PST 2014


Hi,

I am studying how to implement a source to wrap a very specific api for an embedded system.

Let's say I have a frame grabber, a reseizer and an embedded DSP to perform compression. These devices have an userspace api to interact with them that is based on allocating some buffers that will be used to move the data between them.

I am wrapping the source, I defined the create function that fills one of the allocated buffers and uses this buffer to fill a GstBuffer by doing a copy of the buffer. My question is: can I avoid copying the data? Can I pass in the GstBuffer the pointer of the buffer that I allocated with the proprietary api and have gstreamer not to free the buffer that will be reused by the api? If yes, how?

Thank you for your help,

Ottavio


More information about the gstreamer-devel mailing list