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 701632 - gstvalue: Add _append_and_take_value() public variants
gstvalue: Add _append_and_take_value() public variants
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other All
: Normal normal
: 1.1.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-06-05 09:15 UTC by Edward Hervey
Modified: 2013-06-05 11:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gstvalue: Add _append_and_take_value() public variants (7.83 KB, patch)
2013-06-05 09:15 UTC, Edward Hervey
accepted-commit_now Details | Review

Description Edward Hervey 2013-06-05 09:15:20 UTC
We were already using this internally, this makes it public for code
which frequently appends values which are expensive to copy (like
structures, arrays, caps, ...).

Avoids copies of the values for users. The passed GValue will also
be 0-memset'ed for re-use.

New users can replace this kind of code:
gst_value_*_append_value(mycontainer, &myvalue);
g_value_unset(&myvalue);

by:

gst_value_*_append_and_take_value(mycontainer, &myvalue);
Comment 1 Edward Hervey 2013-06-05 09:15:22 UTC
Created attachment 246052 [details] [review]
gstvalue: Add _append_and_take_value() public variants
Comment 2 Sebastian Dröge (slomo) 2013-06-05 09:39:33 UTC
Comment on attachment 246052 [details] [review]
gstvalue: Add _append_and_take_value() public variants

Since markers missing from the docs
Comment 3 Edward Hervey 2013-06-05 11:05:09 UTC
commit 2e1db58e112ef7833a1e8ca34bde7d5740dd481d
Author: Edward Hervey <edward@collabora.com>
Date:   Wed Jun 5 11:02:50 2013 +0200

    gstvalue: Add _append_and_take_value() public variants
    
    API: gst_value_array_append_and_take_value
    API: gst_value_list_append_and_take_value
    
    We were already using this internally, this makes it public for code
    which frequently appends values which are expensive to copy (like
    structures, arrays, caps, ...).
    
    Avoids copies of the values for users. The passed GValue will also
    be 0-memset'ed for re-use.
    
    New users can replace this kind of code:
    gst_value_*_append_value(mycontainer, &myvalue);
    g_value_unset(&myvalue);
    
    by:
    
    gst_value_*_append_and_take_value(mycontainer, &myvalue);
    
    https://bugzilla.gnome.org/show_bug.cgi?id=701632