GNOME Bugzilla – Bug 388201
[API] add gst_adapter_copy()
Last modified: 2007-01-25 10:50:16 UTC
Implementation of gst_adapter_copy(). Could someone code-review this and check it for cases I may have missed?
Created attachment 78730 [details] [review] patch
First of all it's missing gtk-doc documentation :) What is it meant to do ?
And, er, duh, I'll write some docs before checking it in. Something like: gst_adapter_copy() copies data out of the buffers contained in the #GstAdapter into an array provided by the caller, starting after @offset bytes. The array should be large enough to contain @size bytes. The user should check that the adapter has (@offset + @size) bytes available before calling this function.
Created attachment 78731 [details] [review] patch Er, how about a patch that compiles.
> Implementation of gst_adapter_copy(). Could someone code-review this and check > it for cases I may have missed? How about some unit tests? :)
Patch by: David Schleef <ds at schleef dot org> * docs/libs/gstreamer-libs-sections.txt: * libs/gst/base/gstadapter.c: (gst_adapter_copy): * libs/gst/base/gstadapter.h: API: gst_adapter_copy() that can reduce the amount of memcpy when getting data from the adapter. Fixes #388201.