diff --git a/ChangeLog b/ChangeLog index 693820479d..f0785ac557 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2005-11-19 Andy Wingo + * gst/gstclock.h: + * gst/gstclock.c (GstClock, GstClockClass): Change resolution to + be a GstClockTime. + (gst_clock_set_resolution, gst_clock_get_resolution): Resolution + is a GstClockTime. Fixes #321710. + * gst/gstclock.h (GstClock): Remove offset property. Add internal_calibration and external_calibration. Fix padding. Pad also by GstClockTime so we don't run into problems. diff --git a/gst/gstclock.c b/gst/gstclock.c index ad9dbdc036..c7ac8cb258 100644 --- a/gst/gstclock.c +++ b/gst/gstclock.c @@ -549,20 +549,20 @@ gst_clock_finalize (GObject * object) /** * gst_clock_set_resolution - * @clock: The clock set the resolution on + * @clock: a #GstClock * @resolution: The resolution to set * * Set the accuracy of the clock. * * Returns: the new resolution of the clock. */ -guint64 -gst_clock_set_resolution (GstClock * clock, guint64 resolution) +GstClockTime +gst_clock_set_resolution (GstClock * clock, GstClockTime resolution) { GstClockClass *cclass; - g_return_val_if_fail (GST_IS_CLOCK (clock), G_GINT64_CONSTANT (0)); - g_return_val_if_fail (resolution != 0, G_GINT64_CONSTANT (0)); + g_return_val_if_fail (GST_IS_CLOCK (clock), 0); + g_return_val_if_fail (resolution != 0, 0); cclass = GST_CLOCK_GET_CLASS (clock); @@ -575,27 +575,27 @@ gst_clock_set_resolution (GstClock * clock, guint64 resolution) /** * gst_clock_get_resolution - * @clock: The clock get the resolution of + * @clock: a #GstClock * * Get the accuracy of the clock. * - * Returns: the resolution of the clock in microseconds. + * Returns: the resolution of the clock in units of #GstClockTime. * * MT safe. */ -guint64 +GstClockTime gst_clock_get_resolution (GstClock * clock) { GstClockClass *cclass; - g_return_val_if_fail (GST_IS_CLOCK (clock), G_GINT64_CONSTANT (0)); + g_return_val_if_fail (GST_IS_CLOCK (clock), 0); cclass = GST_CLOCK_GET_CLASS (clock); if (cclass->get_resolution) return cclass->get_resolution (clock); - return G_GINT64_CONSTANT (1); + return 1; } /** diff --git a/gst/gstclock.h b/gst/gstclock.h index 8827a434b5..1044ca57a1 100644 --- a/gst/gstclock.h +++ b/gst/gstclock.h @@ -381,7 +381,7 @@ struct _GstClock { GCond *entries_changed; /*< private >*/ - guint64 resolution; + GstClockTime resolution; gboolean stats; GstClockTime _gst_reserved[GST_PADDING]; @@ -392,9 +392,10 @@ struct _GstClockClass { /*< protected >*/ /* vtable */ - guint64 (*change_resolution) (GstClock *clock, guint64 old_resolution, - guint64 new_resolution); - guint64 (*get_resolution) (GstClock *clock); + GstClockTime (*change_resolution) (GstClock *clock, + GstClockTime old_resolution, + GstClockTime new_resolution); + GstClockTime (*get_resolution) (GstClock *clock); GstClockTime (*get_internal_time) (GstClock *clock); @@ -409,8 +410,9 @@ struct _GstClockClass { GType gst_clock_get_type (void); -guint64 gst_clock_set_resolution (GstClock *clock, guint64 resolution); -guint64 gst_clock_get_resolution (GstClock *clock); +GstClockTime gst_clock_set_resolution (GstClock *clock, + GstClockTime resolution); +GstClockTime gst_clock_get_resolution (GstClock *clock); GstClockTime gst_clock_get_time (GstClock *clock); void gst_clock_set_calibration (GstClock *clock, GstClockTime internal,