gst/gstclock.*: Change resolution to be a GstClockTime.
authorAndy Wingo <wingo@pobox.com>
Sat, 19 Nov 2005 18:17:29 +0000 (18:17 +0000)
committerAndy Wingo <wingo@pobox.com>
Sat, 19 Nov 2005 18:17:29 +0000 (18:17 +0000)
Original commit message from CVS:
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.

ChangeLog
gst/gstclock.c
gst/gstclock.h

index 6938204..f0785ac 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 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.
index ad9dbdc..c7ac8cb 100644 (file)
@@ -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;
 }
 
 /**
index 8827a43..1044ca5 100644 (file)
@@ -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,