From abc805ca95477ff52f24a43723fbf46d96f63b66 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 13 Nov 2012 23:11:34 +0000 Subject: [PATCH] tests: gst_adapter_prev_timestamp -> gst_adapter_prev_pts https://bugzilla.gnome.org/show_bug.cgi?id=675598 --- gst/gstcompat.h | 8 ++++---- libs/gst/base/gstadapter.c | 2 +- tests/check/libs/adapter.c | 38 +++++++++++++++++++------------------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/gst/gstcompat.h b/gst/gstcompat.h index ae3d4b6..4ccfeb0 100644 --- a/gst/gstcompat.h +++ b/gst/gstcompat.h @@ -52,10 +52,6 @@ G_BEGIN_DECLS #define GST_BUFFER_TIMESTAMP GST_BUFFER_PTS #define GST_BUFFER_TIMESTAMP_IS_VALID GST_BUFFER_PTS_IS_VALID -#define gst_adapter_prev_timestamp gst_adapter_prev_pts - -#define gst_tag_list_free(taglist) gst_tag_list_unref(taglist) - static inline gboolean gst_pad_set_caps (GstPad * pad, GstCaps * caps) { @@ -78,6 +74,10 @@ gst_pad_set_caps (GstPad * pad, GstCaps * caps) #ifndef GST_DISABLE_DEPRECATED +#define gst_adapter_prev_timestamp gst_adapter_prev_pts + +#define gst_tag_list_free(taglist) gst_tag_list_unref(taglist) + #define GST_MESSAGE_DURATION GST_MESSAGE_DURATION_CHANGED #define gst_message_new_duration(src,fmt,dur) \ gst_message_new_duration_changed(src) diff --git a/libs/gst/base/gstadapter.c b/libs/gst/base/gstadapter.c index 21d2cc3..c9b0e83 100644 --- a/libs/gst/base/gstadapter.c +++ b/libs/gst/base/gstadapter.c @@ -84,7 +84,7 @@ * * The adapter will keep track of the timestamps of the buffers * that were pushed. The last seen timestamp before the current position - * can be queried with gst_adapter_prev_timestamp(). This function can + * can be queried with gst_adapter_prev_pts(). This function can * optionally return the amount of bytes between the start of the buffer that * carried the timestamp and the current adapter position. The distance is * useful when dealing with, for example, raw audio samples because it allows diff --git a/tests/check/libs/adapter.c b/tests/check/libs/adapter.c index 153a08b..df740f9 100644 --- a/tests/check/libs/adapter.c +++ b/tests/check/libs/adapter.c @@ -376,7 +376,7 @@ GST_START_TEST (test_timestamp) fail_unless (avail == 100); /* timestamp is now undefined */ - timestamp = gst_adapter_prev_timestamp (adapter, &dist); + timestamp = gst_adapter_prev_pts (adapter, &dist); fail_unless (timestamp == GST_CLOCK_TIME_NONE); fail_unless (dist == 0); @@ -385,7 +385,7 @@ GST_START_TEST (test_timestamp) fail_unless (avail == 50); /* still undefined, dist changed, though */ - timestamp = gst_adapter_prev_timestamp (adapter, &dist); + timestamp = gst_adapter_prev_pts (adapter, &dist); fail_unless (timestamp == GST_CLOCK_TIME_NONE); fail_unless (dist == 50); @@ -398,7 +398,7 @@ GST_START_TEST (test_timestamp) fail_unless (avail == 150); /* timestamp is still undefined */ - timestamp = gst_adapter_prev_timestamp (adapter, &dist); + timestamp = gst_adapter_prev_pts (adapter, &dist); fail_unless (timestamp == GST_CLOCK_TIME_NONE); fail_unless (dist == 50); @@ -407,7 +407,7 @@ GST_START_TEST (test_timestamp) avail = gst_adapter_available (adapter); fail_unless (avail == 100); - timestamp = gst_adapter_prev_timestamp (adapter, &dist); + timestamp = gst_adapter_prev_pts (adapter, &dist); fail_unless (timestamp == 1 * GST_SECOND); fail_unless (dist == 0); @@ -416,7 +416,7 @@ GST_START_TEST (test_timestamp) avail = gst_adapter_available (adapter); fail_unless (avail == 50); - timestamp = gst_adapter_prev_timestamp (adapter, &dist); + timestamp = gst_adapter_prev_pts (adapter, &dist); fail_unless (timestamp == 1 * GST_SECOND); fail_unless (dist == 50); @@ -433,7 +433,7 @@ GST_START_TEST (test_timestamp) fail_unless (avail == 250); /* timestamp still as it was before the push */ - timestamp = gst_adapter_prev_timestamp (adapter, &dist); + timestamp = gst_adapter_prev_pts (adapter, &dist); fail_unless (timestamp == 1 * GST_SECOND); fail_unless (dist == 50); @@ -441,7 +441,7 @@ GST_START_TEST (test_timestamp) gst_adapter_flush (adapter, 50); avail = gst_adapter_available (adapter); fail_unless (avail == 200); - timestamp = gst_adapter_prev_timestamp (adapter, &dist); + timestamp = gst_adapter_prev_pts (adapter, &dist); fail_unless (timestamp == 1 * GST_SECOND); fail_unless (dist == 100); @@ -449,7 +449,7 @@ GST_START_TEST (test_timestamp) gst_adapter_flush (adapter, 50); avail = gst_adapter_available (adapter); fail_unless (avail == 150); - timestamp = gst_adapter_prev_timestamp (adapter, &dist); + timestamp = gst_adapter_prev_pts (adapter, &dist); fail_unless (timestamp == 1 * GST_SECOND); fail_unless (dist == 150); @@ -457,7 +457,7 @@ GST_START_TEST (test_timestamp) gst_adapter_flush (adapter, 50); avail = gst_adapter_available (adapter); fail_unless (avail == 100); - timestamp = gst_adapter_prev_timestamp (adapter, &dist); + timestamp = gst_adapter_prev_pts (adapter, &dist); fail_unless (timestamp == 2 * GST_SECOND); fail_unless (dist == 0); @@ -465,7 +465,7 @@ GST_START_TEST (test_timestamp) gst_adapter_flush (adapter, 100); avail = gst_adapter_available (adapter); fail_unless (avail == 0); - timestamp = gst_adapter_prev_timestamp (adapter, &dist); + timestamp = gst_adapter_prev_pts (adapter, &dist); fail_unless (timestamp == 2 * GST_SECOND); fail_unless (dist == 100); @@ -473,7 +473,7 @@ GST_START_TEST (test_timestamp) gst_adapter_clear (adapter); avail = gst_adapter_available (adapter); fail_unless (avail == 0); - timestamp = gst_adapter_prev_timestamp (adapter, &dist); + timestamp = gst_adapter_prev_pts (adapter, &dist); fail_unless (timestamp == GST_CLOCK_TIME_NONE); fail_unless (dist == 0); @@ -483,7 +483,7 @@ GST_START_TEST (test_timestamp) gst_adapter_push (adapter, buffer); avail = gst_adapter_available (adapter); fail_unless (avail == 0); - timestamp = gst_adapter_prev_timestamp (adapter, &dist); + timestamp = gst_adapter_prev_pts (adapter, &dist); fail_unless (timestamp == 2 * GST_SECOND); fail_unless (dist == 0); @@ -493,7 +493,7 @@ GST_START_TEST (test_timestamp) gst_adapter_push (adapter, buffer); avail = gst_adapter_available (adapter); fail_unless (avail == 0); - timestamp = gst_adapter_prev_timestamp (adapter, &dist); + timestamp = gst_adapter_prev_pts (adapter, &dist); fail_unless (timestamp == 2 * GST_SECOND); fail_unless (dist == 0); @@ -503,14 +503,14 @@ GST_START_TEST (test_timestamp) gst_adapter_push (adapter, buffer); avail = gst_adapter_available (adapter); fail_unless (avail == 100); - timestamp = gst_adapter_prev_timestamp (adapter, &dist); + timestamp = gst_adapter_prev_pts (adapter, &dist); fail_unless (timestamp == 2 * GST_SECOND); fail_unless (dist == 0); gst_adapter_flush (adapter, 1); avail = gst_adapter_available (adapter); fail_unless (avail == 99); - timestamp = gst_adapter_prev_timestamp (adapter, &dist); + timestamp = gst_adapter_prev_pts (adapter, &dist); fail_unless (timestamp == 4 * GST_SECOND); fail_unless (dist == 1); @@ -520,7 +520,7 @@ GST_START_TEST (test_timestamp) gst_adapter_push (adapter, buffer); avail = gst_adapter_available (adapter); fail_unless (avail == 99); - timestamp = gst_adapter_prev_timestamp (adapter, &dist); + timestamp = gst_adapter_prev_pts (adapter, &dist); fail_unless (timestamp == 4 * GST_SECOND); fail_unless (dist == 1); @@ -529,7 +529,7 @@ GST_START_TEST (test_timestamp) gst_adapter_push (adapter, buffer); avail = gst_adapter_available (adapter); fail_unless (avail == 199); - timestamp = gst_adapter_prev_timestamp (adapter, &dist); + timestamp = gst_adapter_prev_pts (adapter, &dist); fail_unless (timestamp == 4 * GST_SECOND); fail_unless (dist == 1); @@ -540,7 +540,7 @@ GST_START_TEST (test_timestamp) gst_buffer_unref (buffer); avail = gst_adapter_available (adapter); fail_unless (avail == 100); - timestamp = gst_adapter_prev_timestamp (adapter, &dist); + timestamp = gst_adapter_prev_pts (adapter, &dist); fail_unless (timestamp == 5 * GST_SECOND); fail_unless (dist == 0); @@ -554,7 +554,7 @@ GST_START_TEST (test_timestamp) g_free (data); avail = gst_adapter_available (adapter); fail_unless (avail == 50); - timestamp = gst_adapter_prev_timestamp (adapter, &dist); + timestamp = gst_adapter_prev_pts (adapter, &dist); fail_unless (timestamp == 5 * GST_SECOND); fail_unless (dist == 50); -- 2.7.4