gst: Add _take and _steal to more mini objects

Those are simple wrappers around mini object API, similar to
what GstEvent does.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9595>
This commit is contained in:
Xavier Claessens 2025-08-21 08:38:03 -04:00 committed by GStreamer Marge Bot
parent 5801dd0593
commit 13eed32842
13 changed files with 577 additions and 0 deletions

View File

@ -3569,6 +3569,45 @@ Either @nbuf or the #GstBuffer pointed to by @obuf may be %NULL.</doc>
</parameter>
</parameters>
</function>
<function name="steal" c:identifier="gst_buffer_steal" version="1.28" introspectable="0">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstbuffer.c">Atomically replace the #GstBuffer pointed to by @old_buffer with %NULL and
return the original buffer.</doc>
<source-position filename="../subprojects/gstreamer/gst/gstbuffer.h"/>
<return-value transfer-ownership="full">
<type name="Buffer" c:type="GstBuffer*"/>
</return-value>
<parameters>
<parameter name="old_buffer" direction="inout" caller-allocates="0" transfer-ownership="full" nullable="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstbuffer.c">pointer to a
pointer to a #GstBuffer to be stolen.</doc>
<type name="Buffer" c:type="GstBuffer**"/>
</parameter>
</parameters>
</function>
<function name="take" c:identifier="gst_buffer_take" version="1.28" introspectable="0">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstbuffer.c">Modifies a pointer to a #GstBuffer to point to a different #GstBuffer. This
function is similar to gst_buffer_replace() except that it takes ownership of
@new_buffer.
Either @new_buffer or the #GstBuffer pointed to by @old_buffer may be %NULL.</doc>
<source-position filename="../subprojects/gstreamer/gst/gstbuffer.h"/>
<return-value transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstbuffer.c">%TRUE if @new_buffer was different from @old_buffer</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="old_buffer" direction="inout" caller-allocates="0" transfer-ownership="full" nullable="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstbuffer.c">pointer to a
pointer to a #GstBuffer to be stolen.</doc>
<type name="Buffer" c:type="GstBuffer**"/>
</parameter>
<parameter name="new_buffer" transfer-ownership="full" nullable="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstbuffer.c">pointer to a #GstBuffer that will
replace the buffer pointed to by @old_buffer.</doc>
<type name="Buffer" c:type="GstBuffer*"/>
</parameter>
</parameters>
</function>
</record>
<bitfield name="BufferCopyFlags" glib:type-name="GstBufferCopyFlags" glib:get-type="gst_buffer_copy_flags_get_type" c:type="GstBufferCopyFlags">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstbuffer.h">A set of flags that can be provided to the gst_buffer_copy_into()
@ -4009,6 +4048,21 @@ Either @new_list or the #GstBufferList pointed to by @old_list may be %NULL.</do
</parameter>
</parameters>
</function>
<function name="steal" c:identifier="gst_buffer_list_steal" version="1.28" introspectable="0">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstbufferlist.c">Atomically replace the #GstBufferList pointed to by @old_list with %NULL and
return the original buffer list.</doc>
<source-position filename="../subprojects/gstreamer/gst/gstbufferlist.h"/>
<return-value transfer-ownership="full">
<type name="BufferList" c:type="GstBufferList*"/>
</return-value>
<parameters>
<parameter name="old_list" direction="inout" caller-allocates="0" transfer-ownership="full" nullable="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstbufferlist.c">pointer to a
pointer to a #GstBufferList to be stolen.</doc>
<type name="BufferList" c:type="GstBufferList**"/>
</parameter>
</parameters>
</function>
<function name="take" c:identifier="gst_buffer_list_take" version="1.16">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstbufferlist.c">Modifies a pointer to a #GstBufferList to point to a different
#GstBufferList. This function is similar to gst_buffer_list_replace() except
@ -8354,6 +8408,21 @@ Either @new_caps or the #GstCaps pointed to by @old_caps may be %NULL.</doc>
</parameter>
</parameters>
</function>
<function name="steal" c:identifier="gst_caps_steal" version="1.28" introspectable="0">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstcaps.c">Atomically replace the #GstCaps pointed to by @old_caps with %NULL and
return the original caps.</doc>
<source-position filename="../subprojects/gstreamer/gst/gstcaps.h"/>
<return-value transfer-ownership="full">
<type name="Caps" c:type="GstCaps*"/>
</return-value>
<parameters>
<parameter name="old_caps" direction="inout" caller-allocates="0" transfer-ownership="full" nullable="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstcaps.c">pointer to a
pointer to a #GstCaps to be stolen.</doc>
<type name="Caps" c:type="GstCaps**"/>
</parameter>
</parameters>
</function>
<function name="take" c:identifier="gst_caps_take" introspectable="0">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstcaps.c">Modifies a pointer to a #GstCaps to point to a different #GstCaps. This
function is similar to gst_caps_replace() except that it takes ownership
@ -25212,6 +25281,70 @@ copy from @offset to the end of the memory region.</doc>
</instance-parameter>
</parameters>
</method>
<function name="replace" c:identifier="gst_memory_replace" version="1.28" introspectable="0">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmemory.c">Modifies a pointer to a #GstMemory to point to a different #GstMemory. The
modification is done atomically (so this is useful for ensuring thread safety
in some cases), and the reference counts are updated appropriately (the old
memory is unreffed, the new is reffed).
Either @new_memory or the #GstMemory pointed to by @old_memory may be %NULL.</doc>
<source-position filename="../subprojects/gstreamer/gst/gstmemory.h"/>
<return-value transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmemory.c">%TRUE when @old_memory was different from @new_memory.</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="old_memory" direction="inout" caller-allocates="0" transfer-ownership="full" nullable="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmemory.c">pointer to a pointer to
a #GstMemory to be replaced.</doc>
<type name="Memory" c:type="GstMemory**"/>
</parameter>
<parameter name="new_memory" transfer-ownership="none" nullable="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmemory.c">pointer to a #GstMemory that will
replace the memory pointed to by @old_memory.</doc>
<type name="Memory" c:type="GstMemory*"/>
</parameter>
</parameters>
</function>
<function name="steal" c:identifier="gst_memory_steal" version="1.28" introspectable="0">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmemory.c">Atomically replace the #GstMemory pointed to by @old_memory with %NULL and
return the original memory.</doc>
<source-position filename="../subprojects/gstreamer/gst/gstmemory.h"/>
<return-value transfer-ownership="full">
<type name="Memory" c:type="GstMemory*"/>
</return-value>
<parameters>
<parameter name="old_memory" direction="inout" caller-allocates="0" transfer-ownership="full" nullable="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmemory.c">pointer to a
pointer to a #GstMemory to be stolen.</doc>
<type name="Memory" c:type="GstMemory**"/>
</parameter>
</parameters>
</function>
<function name="take" c:identifier="gst_memory_take" version="1.28" introspectable="0">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmemory.c">Modifies a pointer to a #GstMemory to point to a different #GstMemory. This
function is similar to gst_memory_replace() except that it takes ownership of
@new_memory.
Either @new_memory or the #GstMemory pointed to by @old_memory may be %NULL.</doc>
<source-position filename="../subprojects/gstreamer/gst/gstmemory.h"/>
<return-value transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmemory.c">%TRUE if @new_memory was different from @old_memory</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="old_memory" direction="inout" caller-allocates="0" transfer-ownership="full" nullable="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmemory.c">pointer to a
pointer to a #GstMemory to be stolen.</doc>
<type name="Memory" c:type="GstMemory**"/>
</parameter>
<parameter name="new_memory" transfer-ownership="full" nullable="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmemory.c">pointer to a #GstMemory that will
replace the memory pointed to by @old_memory.</doc>
<type name="Memory" c:type="GstMemory*"/>
</parameter>
</parameters>
</function>
</record>
<callback name="MemoryCopyFunction" c:type="GstMemoryCopyFunction">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmemory.h">Copy @size bytes from @mem starting at @offset and return them wrapped in a
@ -28113,6 +28246,21 @@ Either @new_message or the #GstMessage pointed to by @old_message may be %NULL.<
</parameter>
</parameters>
</function>
<function name="steal" c:identifier="gst_message_steal" version="1.28" introspectable="0">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmessage.c">Atomically replace the #GstMessage pointed to by @old_message with %NULL and
return the original message.</doc>
<source-position filename="../subprojects/gstreamer/gst/gstmessage.h"/>
<return-value transfer-ownership="full">
<type name="Message" c:type="GstMessage*"/>
</return-value>
<parameters>
<parameter name="old_message" direction="inout" caller-allocates="0" transfer-ownership="full" nullable="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmessage.c">pointer to a
pointer to a #GstMessage to be stolen.</doc>
<type name="Message" c:type="GstMessage**"/>
</parameter>
</parameters>
</function>
<function name="take" c:identifier="gst_message_take" version="1.16">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmessage.c">Modifies a pointer to a #GstMessage to point to a different #GstMessage. This
function is similar to gst_message_replace() except that it takes ownership
@ -40407,6 +40555,21 @@ Either @new_query or the #GstQuery pointed to by @old_query may be %NULL.</doc>
</parameter>
</parameters>
</function>
<function name="steal" c:identifier="gst_query_steal" version="1.28" introspectable="0">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstquery.c">Atomically replace the #GstQuery pointed to by @old_query with %NULL and
return the original query.</doc>
<source-position filename="../subprojects/gstreamer/gst/gstquery.h"/>
<return-value transfer-ownership="full">
<type name="Query" c:type="GstQuery*"/>
</return-value>
<parameters>
<parameter name="old_query" direction="inout" caller-allocates="0" transfer-ownership="full" nullable="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstquery.c">pointer to a
pointer to a #GstQuery to be stolen.</doc>
<type name="Query" c:type="GstQuery**"/>
</parameter>
</parameters>
</function>
<function name="take" c:identifier="gst_query_take" version="1.16">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstquery.c">Modifies a pointer to a #GstQuery to point to a different #GstQuery. This
function is similar to gst_query_replace() except that it takes ownership of
@ -54219,6 +54382,21 @@ Either @new_list or the #GstBufferList pointed to by @old_list may be %NULL.</do
</parameter>
</parameters>
</function>
<function name="buffer_list_steal" c:identifier="gst_buffer_list_steal" moved-to="BufferList.steal" version="1.28" introspectable="0">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstbufferlist.c">Atomically replace the #GstBufferList pointed to by @old_list with %NULL and
return the original buffer list.</doc>
<source-position filename="../subprojects/gstreamer/gst/gstbufferlist.h"/>
<return-value transfer-ownership="full">
<type name="BufferList" c:type="GstBufferList*"/>
</return-value>
<parameters>
<parameter name="old_list" direction="inout" caller-allocates="0" transfer-ownership="full" nullable="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstbufferlist.c">pointer to a
pointer to a #GstBufferList to be stolen.</doc>
<type name="BufferList" c:type="GstBufferList**"/>
</parameter>
</parameters>
</function>
<function name="buffer_list_take" c:identifier="gst_buffer_list_take" moved-to="BufferList.take" version="1.16">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstbufferlist.c">Modifies a pointer to a #GstBufferList to point to a different
#GstBufferList. This function is similar to gst_buffer_list_replace() except
@ -54273,6 +54451,45 @@ Either @nbuf or the #GstBuffer pointed to by @obuf may be %NULL.</doc>
</parameter>
</parameters>
</function>
<function name="buffer_steal" c:identifier="gst_buffer_steal" moved-to="Buffer.steal" version="1.28" introspectable="0">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstbuffer.c">Atomically replace the #GstBuffer pointed to by @old_buffer with %NULL and
return the original buffer.</doc>
<source-position filename="../subprojects/gstreamer/gst/gstbuffer.h"/>
<return-value transfer-ownership="full">
<type name="Buffer" c:type="GstBuffer*"/>
</return-value>
<parameters>
<parameter name="old_buffer" direction="inout" caller-allocates="0" transfer-ownership="full" nullable="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstbuffer.c">pointer to a
pointer to a #GstBuffer to be stolen.</doc>
<type name="Buffer" c:type="GstBuffer**"/>
</parameter>
</parameters>
</function>
<function name="buffer_take" c:identifier="gst_buffer_take" moved-to="Buffer.take" version="1.28" introspectable="0">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstbuffer.c">Modifies a pointer to a #GstBuffer to point to a different #GstBuffer. This
function is similar to gst_buffer_replace() except that it takes ownership of
@new_buffer.
Either @new_buffer or the #GstBuffer pointed to by @old_buffer may be %NULL.</doc>
<source-position filename="../subprojects/gstreamer/gst/gstbuffer.h"/>
<return-value transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstbuffer.c">%TRUE if @new_buffer was different from @old_buffer</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="old_buffer" direction="inout" caller-allocates="0" transfer-ownership="full" nullable="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstbuffer.c">pointer to a
pointer to a #GstBuffer to be stolen.</doc>
<type name="Buffer" c:type="GstBuffer**"/>
</parameter>
<parameter name="new_buffer" transfer-ownership="full" nullable="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstbuffer.c">pointer to a #GstBuffer that will
replace the buffer pointed to by @old_buffer.</doc>
<type name="Buffer" c:type="GstBuffer*"/>
</parameter>
</parameters>
</function>
<function name="calculate_linear_regression" c:identifier="gst_calculate_linear_regression" version="1.12" introspectable="0">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstutils.c">Calculates the linear regression of the values @xy and places the
result in @m_num, @m_denom, @b and @xbase, representing the function
@ -54387,6 +54604,21 @@ Either @new_caps or the #GstCaps pointed to by @old_caps may be %NULL.</doc>
</parameter>
</parameters>
</function>
<function name="caps_steal" c:identifier="gst_caps_steal" moved-to="Caps.steal" version="1.28" introspectable="0">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstcaps.c">Atomically replace the #GstCaps pointed to by @old_caps with %NULL and
return the original caps.</doc>
<source-position filename="../subprojects/gstreamer/gst/gstcaps.h"/>
<return-value transfer-ownership="full">
<type name="Caps" c:type="GstCaps*"/>
</return-value>
<parameters>
<parameter name="old_caps" direction="inout" caller-allocates="0" transfer-ownership="full" nullable="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstcaps.c">pointer to a
pointer to a #GstCaps to be stolen.</doc>
<type name="Caps" c:type="GstCaps**"/>
</parameter>
</parameters>
</function>
<function name="caps_take" c:identifier="gst_caps_take" moved-to="Caps.take" introspectable="0">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstcaps.c">Modifies a pointer to a #GstCaps to point to a different #GstCaps. This
function is similar to gst_caps_replace() except that it takes ownership
@ -56707,6 +56939,70 @@ debug category and flags.</doc>
</parameter>
</parameters>
</function-macro>
<function name="memory_replace" c:identifier="gst_memory_replace" moved-to="Memory.replace" version="1.28" introspectable="0">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmemory.c">Modifies a pointer to a #GstMemory to point to a different #GstMemory. The
modification is done atomically (so this is useful for ensuring thread safety
in some cases), and the reference counts are updated appropriately (the old
memory is unreffed, the new is reffed).
Either @new_memory or the #GstMemory pointed to by @old_memory may be %NULL.</doc>
<source-position filename="../subprojects/gstreamer/gst/gstmemory.h"/>
<return-value transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmemory.c">%TRUE when @old_memory was different from @new_memory.</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="old_memory" direction="inout" caller-allocates="0" transfer-ownership="full" nullable="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmemory.c">pointer to a pointer to
a #GstMemory to be replaced.</doc>
<type name="Memory" c:type="GstMemory**"/>
</parameter>
<parameter name="new_memory" transfer-ownership="none" nullable="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmemory.c">pointer to a #GstMemory that will
replace the memory pointed to by @old_memory.</doc>
<type name="Memory" c:type="GstMemory*"/>
</parameter>
</parameters>
</function>
<function name="memory_steal" c:identifier="gst_memory_steal" moved-to="Memory.steal" version="1.28" introspectable="0">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmemory.c">Atomically replace the #GstMemory pointed to by @old_memory with %NULL and
return the original memory.</doc>
<source-position filename="../subprojects/gstreamer/gst/gstmemory.h"/>
<return-value transfer-ownership="full">
<type name="Memory" c:type="GstMemory*"/>
</return-value>
<parameters>
<parameter name="old_memory" direction="inout" caller-allocates="0" transfer-ownership="full" nullable="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmemory.c">pointer to a
pointer to a #GstMemory to be stolen.</doc>
<type name="Memory" c:type="GstMemory**"/>
</parameter>
</parameters>
</function>
<function name="memory_take" c:identifier="gst_memory_take" moved-to="Memory.take" version="1.28" introspectable="0">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmemory.c">Modifies a pointer to a #GstMemory to point to a different #GstMemory. This
function is similar to gst_memory_replace() except that it takes ownership of
@new_memory.
Either @new_memory or the #GstMemory pointed to by @old_memory may be %NULL.</doc>
<source-position filename="../subprojects/gstreamer/gst/gstmemory.h"/>
<return-value transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmemory.c">%TRUE if @new_memory was different from @old_memory</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="old_memory" direction="inout" caller-allocates="0" transfer-ownership="full" nullable="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmemory.c">pointer to a
pointer to a #GstMemory to be stolen.</doc>
<type name="Memory" c:type="GstMemory**"/>
</parameter>
<parameter name="new_memory" transfer-ownership="full" nullable="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmemory.c">pointer to a #GstMemory that will
replace the memory pointed to by @old_memory.</doc>
<type name="Memory" c:type="GstMemory*"/>
</parameter>
</parameters>
</function>
<function-macro name="memory_unlock" c:identifier="gst_memory_unlock" introspectable="0">
<source-position filename="../subprojects/gstreamer/gst/gstmemory.h"/>
<parameters>
@ -56763,6 +57059,21 @@ Either @new_message or the #GstMessage pointed to by @old_message may be %NULL.<
</parameter>
</parameters>
</function>
<function name="message_steal" c:identifier="gst_message_steal" moved-to="Message.steal" version="1.28" introspectable="0">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmessage.c">Atomically replace the #GstMessage pointed to by @old_message with %NULL and
return the original message.</doc>
<source-position filename="../subprojects/gstreamer/gst/gstmessage.h"/>
<return-value transfer-ownership="full">
<type name="Message" c:type="GstMessage*"/>
</return-value>
<parameters>
<parameter name="old_message" direction="inout" caller-allocates="0" transfer-ownership="full" nullable="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmessage.c">pointer to a
pointer to a #GstMessage to be stolen.</doc>
<type name="Message" c:type="GstMessage**"/>
</parameter>
</parameters>
</function>
<function name="message_take" c:identifier="gst_message_take" moved-to="Message.take" version="1.16">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmessage.c">Modifies a pointer to a #GstMessage to point to a different #GstMessage. This
function is similar to gst_message_replace() except that it takes ownership
@ -57963,6 +58274,21 @@ Either @new_query or the #GstQuery pointed to by @old_query may be %NULL.</doc>
</parameter>
</parameters>
</function>
<function name="query_steal" c:identifier="gst_query_steal" moved-to="Query.steal" version="1.28" introspectable="0">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstquery.c">Atomically replace the #GstQuery pointed to by @old_query with %NULL and
return the original query.</doc>
<source-position filename="../subprojects/gstreamer/gst/gstquery.h"/>
<return-value transfer-ownership="full">
<type name="Query" c:type="GstQuery*"/>
</return-value>
<parameters>
<parameter name="old_query" direction="inout" caller-allocates="0" transfer-ownership="full" nullable="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstquery.c">pointer to a
pointer to a #GstQuery to be stolen.</doc>
<type name="Query" c:type="GstQuery**"/>
</parameter>
</parameters>
</function>
<function name="query_take" c:identifier="gst_query_take" moved-to="Query.take" version="1.16">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstquery.c">Modifies a pointer to a #GstQuery to point to a different #GstQuery. This
function is similar to gst_query_replace() except that it takes ownership of

View File

@ -3210,3 +3210,42 @@ gst_buffer_make_writable (GstBuffer * buf)
GST_BUFFER_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST
(buf)));
}
/**
* gst_buffer_steal: (skip)
* @old_buffer: (inout) (transfer full) (nullable): pointer to a
* pointer to a #GstBuffer to be stolen.
*
* Atomically replace the #GstBuffer pointed to by @old_buffer with %NULL and
* return the original buffer.
* Since: 1.28
*/
GstBuffer *
gst_buffer_steal (GstBuffer ** old_buffer)
{
return GST_BUFFER_CAST (gst_mini_object_steal ((GstMiniObject **)
old_buffer));
}
/**
* gst_buffer_take: (skip)
* @old_buffer: (inout) (transfer full) (nullable): pointer to a
* pointer to a #GstBuffer to be stolen.
* @new_buffer: (nullable) (transfer full): pointer to a #GstBuffer that will
* replace the buffer pointed to by @old_buffer.
*
* Modifies a pointer to a #GstBuffer to point to a different #GstBuffer. This
* function is similar to gst_buffer_replace() except that it takes ownership of
* @new_buffer.
*
* Either @new_buffer or the #GstBuffer pointed to by @old_buffer may be %NULL.
*
* Returns: %TRUE if @new_buffer was different from @old_buffer
* Since: 1.28
*/
gboolean
gst_buffer_take (GstBuffer ** old_buffer, GstBuffer * new_buffer)
{
return gst_mini_object_take ((GstMiniObject **) old_buffer,
(GstMiniObject *) new_buffer);
}

View File

@ -553,11 +553,30 @@ gst_buffer_replace (GstBuffer **obuf, GstBuffer *nbuf)
{
return gst_mini_object_replace ((GstMiniObject **) obuf, (GstMiniObject *) nbuf);
}
static inline GstBuffer *
gst_buffer_steal(GstBuffer **old_buffer)
{
return GST_BUFFER_CAST(gst_mini_object_steal((GstMiniObject **)old_buffer));
}
static inline gboolean
gst_buffer_take(GstBuffer **old_buffer, GstBuffer *new_buffer)
{
return gst_mini_object_take((GstMiniObject **)old_buffer, (GstMiniObject *)new_buffer);
}
#else /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */
GST_API
gboolean gst_buffer_replace (GstBuffer ** obuf,
GstBuffer * nbuf);
GST_API
GstBuffer *gst_buffer_steal (GstBuffer **old_buffer);
GST_API
gboolean gst_buffer_take (GstBuffer ** old_buffer,
GstBuffer *new_buffer);
GST_API
GstBuffer * gst_buffer_make_writable (GstBuffer * buf) G_GNUC_WARN_UNUSED_RESULT;

View File

@ -658,6 +658,22 @@ gst_buffer_list_take (GstBufferList ** old_list, GstBufferList * new_list)
(GstMiniObject *) new_list);
}
/**
* gst_buffer_list_steal: (skip)
* @old_list: (inout) (transfer full) (nullable): pointer to a
* pointer to a #GstBufferList to be stolen.
*
* Atomically replace the #GstBufferList pointed to by @old_list with %NULL and
* return the original buffer list.
* Since: 1.28
*/
GstBufferList *
gst_buffer_list_steal (GstBufferList ** old_list)
{
return GST_BUFFER_LIST_CAST (gst_mini_object_steal ((GstMiniObject **)
old_list));
}
/**
* gst_buffer_list_is_writable:
* @list: a #GstEvent

View File

@ -100,6 +100,12 @@ gst_buffer_list_take (GstBufferList **old_list, GstBufferList *new_list)
(GstMiniObject *) new_list);
}
static inline GstBufferList *
gst_buffer_list_steal(GstBufferList **old_list)
{
return GST_BUFFER_LIST_CAST(gst_mini_object_steal((GstMiniObject **)old_list));
}
static inline gboolean
gst_buffer_list_is_writable (const GstBufferList * list)
{
@ -132,6 +138,9 @@ GST_API
gboolean gst_buffer_list_take (GstBufferList ** old_list,
GstBufferList * new_list);
GST_API
GstBufferList *gst_buffer_list_steal (GstBufferList **old_list);
GST_API
GstBufferList * gst_buffer_list_make_writable (GstBufferList * list) G_GNUC_WARN_UNUSED_RESULT;
GST_API

View File

@ -3164,6 +3164,22 @@ gst_caps_take (GstCaps ** old_caps, GstCaps * new_caps)
(GstMiniObject *) new_caps);
}
/**
* gst_caps_steal: (skip)
* @old_caps: (inout) (transfer full) (nullable): pointer to a
* pointer to a #GstCaps to be stolen.
*
* Atomically replace the #GstCaps pointed to by @old_caps with %NULL and
* return the original caps.
* Since: 1.28
*/
GstCaps *
gst_caps_steal (GstCaps ** old_caps)
{
return GST_CAPS_CAST (gst_mini_object_steal ((GstMiniObject **)
old_caps));
}
/**
* gst_caps_is_writable:
* @caps: a #GstCaps

View File

@ -227,6 +227,12 @@ gst_caps_take (GstCaps **old_caps, GstCaps *new_caps)
return gst_mini_object_take ((GstMiniObject **) old_caps, (GstMiniObject *) new_caps);
}
static inline GstCaps *
gst_caps_steal(GstCaps **old_caps)
{
return GST_CAPS_CAST(gst_mini_object_steal((GstMiniObject **)old_caps));
}
static inline gboolean
gst_caps_is_writable (const GstCaps * caps)
{
@ -263,6 +269,9 @@ gboolean gst_caps_is_writable (const GstCaps * caps);
GST_API
gboolean gst_caps_take (GstCaps ** old_caps,
GstCaps * new_caps);
GST_API
GstCaps *gst_caps_steal (GstCaps **old_caps);
#endif /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */
/**

View File

@ -534,3 +534,67 @@ gst_memory_make_writable (GstMemory * memory)
GST_MEMORY_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST
(memory)));
}
/**
* gst_memory_replace: (skip)
* @old_memory: (inout) (transfer full) (nullable): pointer to a pointer to
* a #GstMemory to be replaced.
* @new_memory: (transfer none) (allow-none): pointer to a #GstMemory that will
* replace the memory pointed to by @old_memory.
*
* Modifies a pointer to a #GstMemory to point to a different #GstMemory. The
* modification is done atomically (so this is useful for ensuring thread safety
* in some cases), and the reference counts are updated appropriately (the old
* memory is unreffed, the new is reffed).
*
* Either @new_memory or the #GstMemory pointed to by @old_memory may be %NULL.
*
* Returns: %TRUE when @old_memory was different from @new_memory.
*
* Since: 1.28
*/
gboolean
gst_memory_replace (GstMemory ** old_memory, GstMemory * new_memory)
{
return gst_mini_object_replace ((GstMiniObject **) old_memory,
(GstMiniObject *) new_memory);
}
/**
* gst_memory_steal: (skip)
* @old_memory: (inout) (transfer full) (nullable): pointer to a
* pointer to a #GstMemory to be stolen.
*
* Atomically replace the #GstMemory pointed to by @old_memory with %NULL and
* return the original memory.
* Since: 1.28
*/
GstMemory *
gst_memory_steal (GstMemory ** old_memory)
{
return GST_MEMORY_CAST (gst_mini_object_steal ((GstMiniObject **)
old_memory));
}
/**
* gst_memory_take: (skip)
* @old_memory: (inout) (transfer full) (nullable): pointer to a
* pointer to a #GstMemory to be stolen.
* @new_memory: (nullable) (transfer full): pointer to a #GstMemory that will
* replace the memory pointed to by @old_memory.
*
* Modifies a pointer to a #GstMemory to point to a different #GstMemory. This
* function is similar to gst_memory_replace() except that it takes ownership of
* @new_memory.
*
* Either @new_memory or the #GstMemory pointed to by @old_memory may be %NULL.
*
* Returns: %TRUE if @new_memory was different from @old_memory
* Since: 1.28
*/
gboolean
gst_memory_take (GstMemory ** old_memory, GstMemory * new_memory)
{
return gst_mini_object_take ((GstMiniObject **) old_memory,
(GstMiniObject *) new_memory);
}

View File

@ -352,6 +352,24 @@ gst_memory_make_writable (GstMemory * memory)
{
return GST_MEMORY_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST (memory)));
}
static inline gboolean
gst_memory_replace (GstMemory **old_memory, GstMemory *new_memory)
{
return gst_mini_object_replace ((GstMiniObject **) old_memory, (GstMiniObject *) new_memory);
}
static inline GstMemory *
gst_memory_steal(GstMemory **old_memory)
{
return GST_MEMORY_CAST(gst_mini_object_steal((GstMiniObject **)old_memory));
}
static inline gboolean
gst_memory_take(GstMemory **old_memory, GstMemory *new_memory)
{
return gst_mini_object_take((GstMiniObject **)old_memory, (GstMiniObject *)new_memory);
}
#else /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */
GST_API
GstMemory * gst_memory_ref (GstMemory * memory);
@ -363,6 +381,17 @@ GST_API
GstMemory * gst_memory_make_writable (GstMemory * memory) G_GNUC_WARN_UNUSED_RESULT;
GST_API
gboolean gst_memory_is_writable (const GstMemory * memory);
GST_API
gboolean gst_memory_replace (GstMemory ** old_memory,
GstMemory * new_memory);
GST_API
GstMemory *gst_memory_steal (GstMemory **old_memory);
GST_API
gboolean gst_memory_take (GstMemory **old_memory,
GstMemory *new_memory);
#endif /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */
/* getting/setting memory properties */

View File

@ -3590,3 +3590,19 @@ gst_message_make_writable (GstMessage * message)
GST_MESSAGE_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST
(message)));
}
/**
* gst_message_steal: (skip)
* @old_message: (inout) (transfer full) (nullable): pointer to a
* pointer to a #GstMessage to be stolen.
*
* Atomically replace the #GstMessage pointed to by @old_message with %NULL and
* return the original message.
* Since: 1.28
*/
GstMessage *
gst_message_steal (GstMessage ** old_message)
{
return GST_MESSAGE_CAST (gst_mini_object_steal ((GstMiniObject **)
old_message));
}

View File

@ -411,6 +411,12 @@ gst_message_take (GstMessage **old_message, GstMessage *new_message)
return gst_mini_object_take ((GstMiniObject **) old_message,
(GstMiniObject *) new_message);
}
static inline GstMessage *
gst_message_steal(GstMessage **old_message)
{
return GST_MESSAGE_CAST(gst_mini_object_steal((GstMiniObject **)old_message));
}
#else /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */
GST_API
GstMessage * gst_message_ref (GstMessage * msg);
@ -436,6 +442,9 @@ gboolean gst_message_replace (GstMessage ** old_message,
GST_API
gboolean gst_message_take (GstMessage ** old_message,
GstMessage * new_message);
GST_API
GstMessage *gst_message_steal (GstMessage **old_message);
#endif /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */
/* custom messages */

View File

@ -2918,3 +2918,19 @@ gst_query_make_writable (GstQuery * query)
GST_QUERY_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST
(query)));
}
/**
* gst_query_steal: (skip)
* @old_query: (inout) (transfer full) (nullable): pointer to a
* pointer to a #GstQuery to be stolen.
*
* Atomically replace the #GstQuery pointed to by @old_query with %NULL and
* return the original query.
* Since: 1.28
*/
GstQuery *
gst_query_steal (GstQuery ** old_query)
{
return GST_QUERY_CAST (gst_mini_object_steal ((GstMiniObject **)
old_query));
}

View File

@ -293,6 +293,12 @@ gst_query_take (GstQuery **old_query, GstQuery *new_query)
return gst_mini_object_take ((GstMiniObject **) old_query,
(GstMiniObject *) new_query);
}
static inline GstQuery *
gst_query_steal(GstQuery **old_query)
{
return GST_QUERY_CAST(gst_mini_object_steal((GstMiniObject **)old_query));
}
#else /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */
GST_API
GstQuery * gst_query_ref (GstQuery * q);
@ -318,6 +324,9 @@ gboolean gst_query_replace (GstQuery ** old_query,
GST_API
gboolean gst_query_take (GstQuery ** old_query,
GstQuery * new_query);
GST_API
GstQuery *gst_query_steal (GstQuery **old_query);
#endif /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */
/* application specific query */