From 8163e51bad606f0143b8460624222b6da005fce0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 11 Jan 2011 17:43:57 +0100 Subject: [PATCH] clock: API: Add function to re-init periodic GstClockIDs --- docs/gst/gstreamer-sections.txt | 1 + gst/gstclock.c | 26 +++++++++++++++++++++++++- gst/gstclock.h | 4 ++++ win32/common/libgstreamer.def | 1 + 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/docs/gst/gstreamer-sections.txt b/docs/gst/gstreamer-sections.txt index 5d63c48..0693472 100644 --- a/docs/gst/gstreamer-sections.txt +++ b/docs/gst/gstreamer-sections.txt @@ -405,6 +405,7 @@ gst_clock_get_time gst_clock_new_single_shot_id gst_clock_new_periodic_id gst_clock_single_shot_id_reinit +gst_clock_periodic_id_reinit gst_clock_get_internal_time gst_clock_adjust_unlocked gst_clock_unadjust_unlocked diff --git a/gst/gstclock.c b/gst/gstclock.c index 9583396..dd71e19 100644 --- a/gst/gstclock.c +++ b/gst/gstclock.c @@ -209,7 +209,7 @@ gst_clock_entry_new (GstClock * clock, GstClockTime time, return (GstClockID) entry; } -/* WARNING : Does not modify the refoucnt +/* WARNING : Does not modify the refcount * WARNING : Do not use if a pending clock operation is happening on that entry */ static gboolean gst_clock_entry_reinit (GstClock * clock, GstClockEntry * entry, @@ -251,6 +251,30 @@ gst_clock_single_shot_id_reinit (GstClock * clock, GstClockID id, } /** + * gst_clock_periodic_id_reinit: + * @clock: a #GstClock + * @id: a #GstClockID + * @start_time: the requested start time + * @interval: the requested interval + * + * Reinitializes the provided periodic @id to the provided start time and + * interval. Does not modify the reference count. + * + * Returns: %TRUE if the GstClockID could be reinitialized to the provided + * @time, else %FALSE. + * + * Since: 0.10.33 + * + */ +gboolean +gst_clock_periodic_id_reinit (GstClock * clock, GstClockID id, + GstClockTime start_time, GstClockTime interval) +{ + return gst_clock_entry_reinit (clock, (GstClockEntry *) id, start_time, + interval, GST_CLOCK_ENTRY_PERIODIC); +} + +/** * gst_clock_id_ref: * @id: The #GstClockID to ref * diff --git a/gst/gstclock.h b/gst/gstclock.h index 2d11aee..cc1ed09 100644 --- a/gst/gstclock.h +++ b/gst/gstclock.h @@ -560,6 +560,10 @@ void gst_clock_id_unschedule (GstClockID id); gboolean gst_clock_single_shot_id_reinit (GstClock * clock, GstClockID id, GstClockTime time); +gboolean gst_clock_periodic_id_reinit (GstClock * clock, + GstClockID id, + GstClockTime start_time, + GstClockTime interval); G_END_DECLS diff --git a/win32/common/libgstreamer.def b/win32/common/libgstreamer.def index b17fc97..eef40de 100644 --- a/win32/common/libgstreamer.def +++ b/win32/common/libgstreamer.def @@ -220,6 +220,7 @@ EXPORTS gst_clock_id_wait_async_full gst_clock_new_periodic_id gst_clock_new_single_shot_id + gst_clock_periodic_id_reinit gst_clock_return_get_type gst_clock_set_calibration gst_clock_set_master -- 2.7.4