gstvalue: Add _append_and_take_value() public variants
authorEdward Hervey <edward@collabora.com>
Wed, 5 Jun 2013 09:02:50 +0000 (11:02 +0200)
committerEdward Hervey <edward@collabora.com>
Wed, 5 Jun 2013 10:58:05 +0000 (12:58 +0200)
commit2e1db58e112ef7833a1e8ca34bde7d5740dd481d
tree24ce6d8632df5a36d9ee7b67ca47aa22456c3296
parente1f520f27c9cc5f6fe73ca8711b8b3173e33cc29
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
gst/gstbufferpool.c
gst/gstvalue.c
gst/gstvalue.h
win32/common/libgstreamer.def