summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorWonchul Lee <chul0812@gmail.com>2013-08-20 17:15:41 +0900
committerSebastian Dröge <slomo@circular-chaos.org>2013-08-21 08:51:34 +0200
commitfacf73ad8da1217efd9ce1b4ebe6a48716c48484 (patch)
treecb1d60b1a339ace4a3a7be4ee43acacc31793620 /gst
parentf90f3cde5f165daa99b9756eba4b98bc26aa1362 (diff)
sample: Add gst_sample_copy()
https://bugzilla.gnome.org/show_bug.cgi?id=706454
Diffstat (limited to 'gst')
-rw-r--r--gst/gstsample.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/gst/gstsample.h b/gst/gstsample.h
index 379690c05..d05ff1eb0 100644
--- a/gst/gstsample.h
+++ b/gst/gstsample.h
@@ -96,6 +96,28 @@ gst_sample_unref (GstSample * sample)
gst_mini_object_unref (GST_MINI_OBJECT_CAST (sample));
}
+/* copy sample */
+/**
+ * gst_sample_copy:
+ * @buf: a #GstSample.
+ *
+ * Create a copy of the given sample. This will also make a newly allocated
+ * copy of the data the source sample contains.
+ *
+ * Returns: (transfer full): a new copy of @buf.
+ *
+ * Since: 1.2
+ */
+#ifdef _FOOL_GTK_DOC_
+G_INLINE_FUNC GstSample * gst_sample_copy (const GstSample * buf);
+#endif
+
+static inline GstSample *
+gst_sample_copy (const GstSample * buf)
+{
+ return GST_SAMPLE_CAST (gst_mini_object_copy (GST_MINI_OBJECT_CONST_CAST (buf)));
+}
+
/**
* gst_value_set_sample:
* @v: a #GValue to receive the data