From 8d4f2459428c0d03ff92839a8617fc182b52b8d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 12 Apr 2014 00:28:51 +0100 Subject: [PATCH] testclock: add back gst_test_clock_wait_for_pending_id_count() .. but deprecate it. ABI stability and all that. It's a dangerous and racy function to use. --- libs/gst/check/Makefile.am | 2 +- libs/gst/check/gsttestclock.c | 26 ++++++++++++++++++++++++++ libs/gst/check/gsttestclock.h | 5 +++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/libs/gst/check/Makefile.am b/libs/gst/check/Makefile.am index 73c0cdfb19..cf1328bf04 100644 --- a/libs/gst/check/Makefile.am +++ b/libs/gst/check/Makefile.am @@ -102,7 +102,7 @@ LIBGSTCHECK_EXPORTED_FUNCS = \ gst_test_clock_has_id \ gst_test_clock_peek_next_pending_id \ gst_test_clock_wait_for_next_pending_id \ - gst_test_clock_wait_for_multiple_pending_ids \ + gst_test_clock_wait_for_pending_id_count \ gst_test_clock_process_next_clock_id \ gst_test_clock_get_next_entry_time \ gst_test_clock_wait_for_multiple_pending_ids \ diff --git a/libs/gst/check/gsttestclock.c b/libs/gst/check/gsttestclock.c index bd94070616..d610074cb6 100644 --- a/libs/gst/check/gsttestclock.c +++ b/libs/gst/check/gsttestclock.c @@ -875,6 +875,32 @@ gst_test_clock_wait_for_next_pending_id (GstTestClock * test_clock, GST_OBJECT_UNLOCK (test_clock); } +/** + * gst_test_clock_wait_for_pending_id_count: + * @test_clock: #GstTestClock for which to await having enough pending clock + * @count: the number of pending clock notifications to wait for + * + * Blocks until at least @count clock notifications have been requested from + * @test_clock. There is no timeout for this wait, see the main description of + * #GstTestClock. + * + * Since: 1.2 + * + * Deprecated: use gst_test_clock_wait_for_multiple_pending_ids() instead. + */ +#ifndef GST_REMOVE_DEPRECATED +#ifdef GST_DISABLE_DEPRECATED +void gst_test_clock_wait_for_pending_id_count (GstTestClock * test_clock, + guint count); +#endif +void +gst_test_clock_wait_for_pending_id_count (GstTestClock * test_clock, + guint count) +{ + gst_test_clock_wait_for_multiple_pending_ids (test_clock, count, NULL); +} +#endif + /** * gst_test_clock_process_next_clock_id: * @test_clock: a #GstTestClock for which to retrieve the next pending clock diff --git a/libs/gst/check/gsttestclock.h b/libs/gst/check/gsttestclock.h index 2b54b227de..6527194327 100644 --- a/libs/gst/check/gsttestclock.h +++ b/libs/gst/check/gsttestclock.h @@ -113,6 +113,11 @@ gboolean gst_test_clock_peek_next_pending_id (GstTestClock * test_clock, void gst_test_clock_wait_for_next_pending_id (GstTestClock * test_clock, GstClockID * pending_id); +#ifndef GST_DISABLE_DEPRECATED +void gst_test_clock_wait_for_pending_id_count (GstTestClock * test_clock, + guint count); +#endif + GstClockID gst_test_clock_process_next_clock_id (GstTestClock * test_clock); GstClockTime gst_test_clock_get_next_entry_time (GstTestClock * test_clock);