Avoid memcpy when passing buffers

Sebastian Dröge sebastian at centricular.com
Fri Dec 12 00:42:18 PST 2014


Hi,

in many cases gst_buffer_new_wrapped() is not enough, especially if you
need special operations connected with your memory. In those cases you
will need to implement a custom GstMemory.

See:
https://coaxion.net/blog/2013/10/the-never-ending-story-gstreamer-and-hardware-integration/

And also take a look at the v4l2src element, which is a source element
providing custom memory to downstream elements without copying.

On Fr, 2014-12-12 at 13:21 +1000, Duncan Palmer wrote:
> Are you using gstreamer-1.x? If so, gst_buffer_new_wrapped_full()
> should do what you require.
> 
> On 12 December 2014 at 09:48, Ottavio Campana <o.campana at videotec.com> wrote:
> > 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
> > _______________________________________________
> > gstreamer-devel mailing list
> > gstreamer-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

-- 
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: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20141212/e37d155a/attachment.sig>


More information about the gstreamer-devel mailing list