2005-11-19 Andy Wingo <wingo@pobox.com>
+ * 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.
/**
* 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);
/**
* 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;
}
/**
GCond *entries_changed;
/*< private >*/
- guint64 resolution;
+ GstClockTime resolution;
gboolean stats;
GstClockTime _gst_reserved[GST_PADDING];
/*< 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);
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,