buffer: rename new gst_buffer_new_copy() to gst_buffer_new_memdup()

https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/826

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/827>
This commit is contained in:
Tim-Philipp Müller 2021-05-24 18:27:08 +01:00
parent 04fe2233f0
commit dd22ec68d2
3 changed files with 6 additions and 6 deletions

View file

@ -1040,7 +1040,7 @@ gst_buffer_new_wrapped_bytes (GBytes * bytes)
} }
/** /**
* gst_buffer_new_copy: * gst_buffer_new_memdup:
* @data: (array length=size) (element-type guint8) (transfer none): data to copy into new buffer * @data: (array length=size) (element-type guint8) (transfer none): data to copy into new buffer
* @size: size of @data in bytes * @size: size of @data in bytes
* *
@ -1051,7 +1051,7 @@ gst_buffer_new_wrapped_bytes (GBytes * bytes)
* Since: 1.20 * Since: 1.20
*/ */
GstBuffer * GstBuffer *
gst_buffer_new_copy (gconstpointer data, gsize size) gst_buffer_new_memdup (gconstpointer data, gsize size)
{ {
gpointer data2 = g_memdup (data, size); gpointer data2 = g_memdup (data, size);

View file

@ -319,7 +319,7 @@ GST_API
GstBuffer * gst_buffer_new_wrapped_bytes (GBytes * bytes); GstBuffer * gst_buffer_new_wrapped_bytes (GBytes * bytes);
GST_API GST_API
GstBuffer * gst_buffer_new_copy (gconstpointer data, gsize size); GstBuffer * gst_buffer_new_memdup (gconstpointer data, gsize size);
/* memory blocks */ /* memory blocks */

View file

@ -923,12 +923,12 @@ GST_START_TEST (test_wrapped_bytes)
GST_END_TEST; GST_END_TEST;
GST_START_TEST (test_new_copy) GST_START_TEST (test_new_memdup)
{ {
GstBuffer *buf; GstBuffer *buf;
GstMemory *mem; GstMemory *mem;
buf = gst_buffer_new_copy (ro_memory, sizeof (ro_memory)); buf = gst_buffer_new_memdup (ro_memory, sizeof (ro_memory));
fail_if (gst_buffer_memcmp (buf, 0, ro_memory, sizeof (ro_memory))); fail_if (gst_buffer_memcmp (buf, 0, ro_memory, sizeof (ro_memory)));
fail_unless_equals_int (gst_buffer_get_size (buf), sizeof (ro_memory)); fail_unless_equals_int (gst_buffer_get_size (buf), sizeof (ro_memory));
@ -969,7 +969,7 @@ gst_buffer_suite (void)
tcase_add_test (tc_chain, test_parent_buffer_meta); tcase_add_test (tc_chain, test_parent_buffer_meta);
tcase_add_test (tc_chain, test_writable_memory); tcase_add_test (tc_chain, test_writable_memory);
tcase_add_test (tc_chain, test_wrapped_bytes); tcase_add_test (tc_chain, test_wrapped_bytes);
tcase_add_test (tc_chain, test_new_copy); tcase_add_test (tc_chain, test_new_memdup);
return s; return s;
} }