After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 388201 - [API] add gst_adapter_copy()
[API] add gst_adapter_copy()
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal enhancement
: 0.10.12
Assigned To: Wim Taymans
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-12-21 09:13 UTC by David Schleef
Modified: 2007-01-25 10:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (2.18 KB, patch)
2006-12-21 09:14 UTC, David Schleef
none Details | Review
patch (2.14 KB, patch)
2006-12-21 09:28 UTC, David Schleef
committed Details | Review

Description David Schleef 2006-12-21 09:13:29 UTC
Implementation of gst_adapter_copy().  Could someone code-review this and check it for cases I may have missed?
Comment 1 David Schleef 2006-12-21 09:14:07 UTC
Created attachment 78730 [details] [review]
patch
Comment 2 Edward Hervey 2006-12-21 09:15:38 UTC
First of all it's missing gtk-doc documentation :) What is it meant to do ?
Comment 3 David Schleef 2006-12-21 09:18:59 UTC
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.
Comment 4 David Schleef 2006-12-21 09:28:57 UTC
Created attachment 78731 [details] [review]
patch

Er, how about a patch that compiles.
Comment 5 Tim-Philipp Müller 2006-12-21 09:37:20 UTC
> Implementation of gst_adapter_copy().  Could someone code-review this and check
> it for cases I may have missed?

How about some unit tests? :)
Comment 6 Wim Taymans 2007-01-25 10:50:16 UTC
        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.