summaryrefslogtreecommitdiff
path: root/gst/gstbufferlist.h
diff options
context:
space:
mode:
authorNiels De Graef <nielsdegraef@gmail.com>2018-11-04 19:13:39 +0100
committerSebastian Dröge <slomo@coaxion.net>2018-11-05 11:06:30 +0000
commit63e3edecfdababb839825d59b9881f2696f7dbdd (patch)
treea6715cf5141d12c5646159dbb4a09063bc487d68 /gst/gstbufferlist.h
parente35dc31fda2fce5a65fd3df1ff141d5ff6d9cc44 (diff)
bufferlist: add gst_buffer_list_replace/take()
This makes its API consistent with the other GstMiniObject subclasses.
Diffstat (limited to 'gst/gstbufferlist.h')
-rw-r--r--gst/gstbufferlist.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/gst/gstbufferlist.h b/gst/gstbufferlist.h
index 529a12be33..dc7c10f0d1 100644
--- a/gst/gstbufferlist.h
+++ b/gst/gstbufferlist.h
@@ -130,6 +130,53 @@ gst_buffer_list_copy (const GstBufferList * list)
}
/**
+ * gst_buffer_list_replace:
+ * @old_list: (inout) (transfer full) (nullable): pointer to a pointer to a
+ * #GstBufferList to be replaced.
+ * @new_list: (transfer none) (allow-none): pointer to a #GstBufferList that
+ * will replace the buffer list pointed to by @old_list.
+ *
+ * Modifies a pointer to a #GstBufferList to point to a different
+ * #GstBufferList. 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 buffer list is unreffed, the new is reffed).
+ *
+ * Either @new_list or the #GstBufferList pointed to by @old_list may be %NULL.
+ *
+ * Returns: %TRUE if @new_list was different from @old_list
+ *
+ * Since: 1.16
+ */
+static inline gboolean
+gst_buffer_list_replace (GstBufferList **old_list, GstBufferList *new_list)
+{
+ return gst_mini_object_replace ((GstMiniObject **) old_list,
+ (GstMiniObject *) new_list);
+}
+
+/**
+ * gst_buffer_list_take:
+ * @old_list: (inout) (transfer full): pointer to a pointer to a #GstBufferList
+ * to be replaced.
+ * @new_list: (transfer full) (allow-none): pointer to a #GstBufferList
+ * that will replace the bufferlist pointed to by @old_list.
+ *
+ * Modifies a pointer to a #GstBufferList to point to a different
+ * #GstBufferList. This function is similar to gst_buffer_list_replace() except
+ * that it takes ownership of @new_list.
+ *
+ * Returns: %TRUE if @new_list was different from @old_list
+ *
+ * Since: 1.16
+ */
+static inline gboolean
+gst_buffer_list_take (GstBufferList **old_list, GstBufferList *new_list)
+{
+ return gst_mini_object_take ((GstMiniObject **) old_list,
+ (GstMiniObject *) new_list);
+}
+
+/**
* gst_buffer_list_is_writable:
* @list: a #GstBufferList
*