From 3eb5b03dfd1b21b5d3d6cf6b6f135151e16237c2 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 18 Nov 2005 19:21:50 +0000 Subject: [PATCH] gst/gstclock.c: Doc and API fixes. Original commit message from CVS: * gst/gstclock.c: (gst_clock_set_calibration), (gst_clock_get_calibration): Doc and API fixes. Callibration can be set with internal time equal to current internal time too. --- ChangeLog | 8 ++++++++ gst/gstclock.c | 28 ++++++++++++++++++---------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index d9256b85b7..69eb5802fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-11-18 Wim Taymans + + * gst/gstclock.c: (gst_clock_set_calibration), + (gst_clock_get_calibration): + Doc and API fixes. + Callibration can be set with internal time equal to current + internal time too. + 2005-11-18 Thomas Vander Stichele * gst/gsterror.c: diff --git a/gst/gstclock.c b/gst/gstclock.c index 5d4d9b4896..7da6bdb53d 100644 --- a/gst/gstclock.c +++ b/gst/gstclock.c @@ -699,6 +699,8 @@ gst_clock_get_time (GstClock * clock) * * Adjusts the time of @clock. This function is buggy and is scheduled to die. * + * Obsolete, do not use. + * * MT safe. */ void @@ -719,6 +721,8 @@ gst_clock_set_time_adjust (GstClock * clock, GstClockTime adjust) * * Adjusts the internal rate and offset of @clock. Obsolete, do not use. * + * Obsolete, do not use. + * * MT safe. */ void @@ -793,7 +797,7 @@ gst_clock_set_calibration (GstClock * clock, GstClockTime internal, GstClockTime { g_return_if_fail (GST_IS_CLOCK (clock)); g_return_if_fail (rate > 0.0); - g_return_if_fail (internal < gst_clock_get_internal_time (clock)); + g_return_if_fail (internal <= gst_clock_get_internal_time (clock)); GST_LOCK (clock); /* these need to be reworked for the api freeze break, we're really abusing @@ -805,14 +809,18 @@ gst_clock_set_calibration (GstClock * clock, GstClockTime internal, GstClockTime } /** - * gst_clock_get_rate_offset - * @clock: a #GstClock to adjust + * gst_clock_get_calibration + * @clock: a #GstClock + * @internal: a location to store the internal time + * @external: a location to store the external time * @rate: a location to store the rate - * @offset: a location to store the offset * * Gets the internal rate and reference time of @clock. See * gst_clock_set_calibration() for more information. * + * @internal, @external and @rate can be left NULL if the caller + * is not interested in the values. + * * MT safe. */ void @@ -820,14 +828,14 @@ gst_clock_get_calibration (GstClock * clock, GstClockTime * internal, GstClockTime * external, gdouble * rate) { g_return_if_fail (GST_IS_CLOCK (clock)); - g_return_if_fail (rate != NULL); - g_return_if_fail (internal != NULL); - g_return_if_fail (external != NULL); GST_LOCK (clock); - *rate = clock->A.rate; - *external = clock->A.offset; - *internal = clock->adjust; + if (rate) + *rate = clock->A.rate; + if (external) + *external = clock->A.offset; + if (internal) + *internal = clock->adjust; GST_UNLOCK (clock); }