GNOME Bugzilla – Bug 629831
[API] add gst_structure_take_value() and gst_structure_id_take_value()
Last modified: 2010-09-16 18:44:52 UTC
Created attachment 170404 [details] [review] structure: add gst_structure_{id_}take_value() I propose to add some API to GstStructure that takes ownership of the GValue passed to it instead of copying it. This is useful for setting structure fields to types that aren't refcounted and where a full copy will always be done otherwise (e.g. GValueArray, strings, string arrays etc.).
Created attachment 170405 [details] [review] query: gst_query_add_buffering_range() optimisations Example patch that uses this new API: query: gst_query_add_buffering_range() optimisations Don't create a new GValueArray copy for every single _add_buffering_range() call, but append to the existing value array owned by the structure instead.
Yes, that's also a good idea for nested GstStructures for example.
commit 7e5a9580ef2614111ba20e1c473df2fb02be1ef7 Author: Tim-Philipp Müller <tim.muller@collabora.co.uk> Date: Wed Sep 15 23:42:43 2010 +0100 structure: add gst_structure_{id_}take_value() Add _set_value() variants that take ownership of the value passed instead of making a copy of the value. This is useful for setting values to things that aren't refcounted (e.g. GValueArrays or strings or string arrays, etc.). API: gst_structure_take_value() API: gst_structure_id_take_value() https://bugzilla.gnome.org/show_bug.cgi?id=629831