cleanups
authorWim Taymans <wim.taymans@collabora.co.uk>
Tue, 22 Feb 2011 15:04:12 +0000 (16:04 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 22 Feb 2011 15:04:12 +0000 (16:04 +0100)
Fix padding, remove deprecated symbols.

16 files changed:
gst/gstbin.h
gst/gstbuffer.h
gst/gstclock.c
gst/gstclock.h
gst/gstevent.c
gst/gstevent.h
gst/gstindex.h
gst/gstmessage.c
gst/gstmessage.h
gst/gstplugin.h
gst/gstregistry.h
gst/gstsegment.h
gst/gstsystemclock.c
gst/gstsystemclock.h
gst/gsttask.c
gst/gsttask.h

index 2473ef69067fc3f12d2507826b2460764788024f..19c7634a64028001dd5c1dc7770a21dc97df0d1b 100644 (file)
@@ -117,7 +117,7 @@ struct _GstBin {
   /*< private >*/
   GstBinPrivate *priv;
 
-  gpointer _gst_reserved[GST_PADDING - 1];
+  gpointer _gst_reserved[GST_PADDING];
 };
 
 /**
@@ -156,7 +156,7 @@ struct _GstBinClass {
   gboolean     (*do_latency)           (GstBin *bin);
 
   /*< private >*/
-  gpointer _gst_reserved[GST_PADDING-1];
+  gpointer _gst_reserved[GST_PADDING];
 };
 
 GType          gst_bin_get_type                (void);
index ad48315c6a5920ccd207229e5ded09e550d38e4d..a6e4bf316816c22f533167e966b64e10d149603f 100644 (file)
@@ -288,7 +288,7 @@ struct _GstBuffer {
   GstBuffer             *parent;
 
   /*< private >*/
-  gpointer _gst_reserved[GST_PADDING - 2];
+  gpointer _gst_reserved[GST_PADDING];
 };
 
 struct _GstBufferClass {
index 45f503e731661711c791cc6ce8574699676dcd58..b167238b71b4651a6173a25cd49a7de3a9a988e5 100644 (file)
@@ -489,26 +489,10 @@ gst_clock_id_wait (GstClockID id, GstClockTimeDiff * jitter)
   GST_CAT_DEBUG_OBJECT (GST_CAT_CLOCK, clock, "waiting on clock entry %p", id);
 
   /* if we have a wait_jitter function, use that */
-  if (G_LIKELY (cclass->wait_jitter)) {
-    res = cclass->wait_jitter (clock, entry, jitter);
-  } else {
-    /* check if we have a simple _wait function otherwise. The function without
-     * the jitter arg is less optimal as we need to do an additional _get_time()
-     * which is not atomic with the _wait() and a typical _wait() function does
-     * yet another _get_time() anyway. */
-    if (G_UNLIKELY (cclass->wait == NULL))
-      goto not_supported;
-
-    if (jitter) {
-      GstClockTime now = gst_clock_get_time (clock);
-
-      /* jitter is the diff against the clock when this entry is scheduled. Negative
-       * values mean that the entry was in time, a positive value means that the
-       * entry was too late. */
-      *jitter = GST_CLOCK_DIFF (requested, now);
-    }
-    res = cclass->wait (clock, entry);
-  }
+  if (G_UNLIKELY (cclass->wait == NULL))
+    goto not_supported;
+
+  res = cclass->wait (clock, entry, jitter);
 
   GST_CAT_DEBUG_OBJECT (GST_CAT_CLOCK, clock,
       "done waiting entry %p, res: %d", id, res);
index cc1ed0940b6ebb8a3eac98fda1f4a81a26fd234a..a94b3a587afc1e92c2324e72ba961d980900df78 100644 (file)
@@ -468,12 +468,11 @@ struct _GstClock {
  *                     be acceptable. The new resolution should be returned.
  * @get_resolution: get the resolution of the clock.
  * @get_internal_time: get the internal unadjusted time of the clock.
- * @wait: perform a blocking wait for the given #GstClockEntry. Deprecated,
  *        implement @wait_jitter instead.
+ * @wait: perform a blocking wait on the given #GstClockEntry and return
+ *               the jitter.
  * @wait_async: perform an asynchronous wait for the given #GstClockEntry.
  * @unschedule: unblock a blocking or async wait operation.
- * @wait_jitter: perform a blocking wait on the given #GstClockEntry and return
- *               the jitter. (Since: 0.10.10)
  *
  * GStreamer clock class. Override the vmethods to implement the clock
  * functionality.
@@ -491,15 +490,13 @@ struct _GstClockClass {
   GstClockTime         (*get_internal_time)    (GstClock *clock);
 
   /* waiting on an ID */
-  GstClockReturn        (*wait)                        (GstClock *clock, GstClockEntry *entry);
+  GstClockReturn        (*wait)                 (GstClock *clock, GstClockEntry *entry,
+                                                GstClockTimeDiff *jitter);
   GstClockReturn        (*wait_async)           (GstClock *clock, GstClockEntry *entry);
   void                  (*unschedule)          (GstClock *clock, GstClockEntry *entry);
 
-  /* ABI added to replace the deprecated wait */
-  GstClockReturn        (*wait_jitter)         (GstClock *clock, GstClockEntry *entry,
-                                                GstClockTimeDiff *jitter);
   /*< private >*/
-  gpointer _gst_reserved[GST_PADDING - 1];
+  gpointer _gst_reserved[GST_PADDING];
 };
 
 GType                  gst_clock_get_type              (void);
index 07414c7fa4a46a36cb18570de7d532f8975407a9..bc6b754d55c69e6cfd663e90fe84088e553584d6 100644 (file)
@@ -85,8 +85,6 @@
 #include "gstutils.h"
 #include "gstquark.h"
 
-#define GST_EVENT_SEQNUM(e) ((GstEvent*)e)->abidata.seqnum
-
 static void gst_event_finalize (GstEvent * event);
 static GstEvent *_gst_event_copy (GstEvent * event);
 
index 34983b679b30d459565dc2ee3786a6ab3c253e72..87ece59d52e388d19ba21efd17497eafaa33ad65 100644 (file)
@@ -200,6 +200,14 @@ typedef struct _GstEventClass GstEventClass;
  */
 #define GST_EVENT_SRC(event)            (GST_EVENT_CAST(event)->src)
 
+/**
+ * GST_EVENT_SEQNUM:
+ * @event: the event to query
+ *
+ * The sequence number of @event.
+ */
+#define GST_EVENT_SEQNUM(event)         (GST_EVENT_CAST(event)->seqnum)
+
 /**
  * GST_EVENT_IS_UPSTREAM:
  * @ev: the event to query
@@ -347,15 +355,13 @@ struct _GstEvent {
   /*< public >*/ /* with COW */
   GstEventType  type;
   guint64       timestamp;
-  GstObject     *src;
+  GstObject    *src;
+  guint32       seqnum;
 
   GstStructure  *structure;
 
   /*< private >*/
-  union {
-    guint32 seqnum;
-    gpointer _gst_reserved;
-  } abidata;
+  gpointer _gst_reserved[GST_PADDING];
 };
 
 struct _GstEventClass {
index e5fc6256c012808ba5baba1ae42bf6c58c2906d3..9447a38c2ea3a929275e3cadc22c58d953b3933a 100644 (file)
@@ -332,6 +332,7 @@ struct _GstIndex {
   GstIndexResolverMethod method;
   GstIndexResolver       resolver;
   gpointer               resolver_user_data;
+  GDestroyNotify         resolver_user_data_destroy;
 
   GstIndexFilter         filter;
   gpointer               filter_user_data;
@@ -340,11 +341,8 @@ struct _GstIndex {
   GHashTable            *writers;
   gint                   last_id;
 
-  /* ABI added since 0.10.18 */
-  GDestroyNotify         resolver_user_data_destroy;
-
   /*< private >*/
-  gpointer _gst_reserved[GST_PADDING - 1];
+  gpointer _gst_reserved[GST_PADDING];
 };
 
 struct _GstIndexClass {
index e151042302b563bf386d7c1d70d0ca66e80f777f..8cc3580895ddc67e6f2e00b07b9379867a0bf8ad 100644 (file)
@@ -60,8 +60,6 @@
 #include "gstquark.h"
 
 
-#define GST_MESSAGE_SEQNUM(e) ((GstMessage*)e)->abidata.ABI.seqnum
-
 static void gst_message_finalize (GstMessage * message);
 static GstMessage *_gst_message_copy (GstMessage * message);
 
index 0eafac52df185c7ed6741e1f5aa88644404f7375..9327e0990102dbbc5044581da1052f27bdf7aada 100644 (file)
@@ -190,6 +190,15 @@ typedef enum
  * Get the object that posted @message.
  */
 #define GST_MESSAGE_SRC(message)        (GST_MESSAGE_CAST(message)->src)
+
+/**
+ * GST_MESSAGE_SEQNUM:
+ * @message: a #GstMessage
+ *
+ * Get the sequence number of @message.
+ */
+#define GST_MESSAGE_SEQNUM(message)     (GST_MESSAGE_CAST(message)->seqnum)
+
 /**
  * GST_MESSAGE_SRC_NAME:
  * @message: a #GstMessage
@@ -286,17 +295,12 @@ struct _GstMessage
   GstMessageType type;
   guint64 timestamp;
   GstObject *src;
+  guint32 seqnum;
 
   GstStructure *structure;
 
   /*< private >*/
-  union {
-    struct {
-      guint32 seqnum;
-    } ABI;
-    /* + 0 to mark ABI change for future greppage */
-    gpointer _gst_reserved[GST_PADDING + 0];
-  } abidata;
+  gpointer _gst_reserved[GST_PADDING];
 };
 
 struct _GstMessageClass {
index 0fa2f62b1c525e3cd4f195c09f5f84b9526a33a7..7eb33e4a5d85e15eb073e05fb533497e86845709 100644 (file)
@@ -175,7 +175,7 @@ struct _GstPluginDesc {
   const gchar *origin;
   const gchar *release_datetime;
   /*< private >*/
-  gpointer _gst_reserved[GST_PADDING - 1];
+  gpointer _gst_reserved[GST_PADDING];
 };
 
 
@@ -213,7 +213,7 @@ struct _GstPlugin {
                                  * that matches the plugin's basename */
 
   GstPluginPrivate *priv;
-  gpointer _gst_reserved[GST_PADDING - 1];
+  gpointer _gst_reserved[GST_PADDING];
 };
 
 struct _GstPluginClass {
index c3aa9f480bc1199c135848309bfa32009fd8d108..f2d07c1d9accc4d16395d7ce9f5bda4473d36a43 100644 (file)
@@ -66,7 +66,7 @@ struct _GstRegistry {
   GstRegistryPrivate *priv;
 
   /*< private >*/
-  gpointer _gst_reserved[GST_PADDING-3];
+  gpointer _gst_reserved[GST_PADDING];
 };
 
 struct _GstRegistryClass {
index a0c368320234cd80988c725aa82df53b98744b0f..37ab0b769b58143ff3fe7422d0d7c07426c9ea9c 100644 (file)
@@ -53,6 +53,7 @@ struct _GstSegment {
   /*< public >*/
   gdouble        rate;
   gdouble        abs_rate;
+  gdouble        applied_rate;
   GstFormat      format;
   GstSeekFlags   flags;
   gint64         start;
@@ -63,12 +64,8 @@ struct _GstSegment {
   gint64         last_stop;
   gint64         duration;
 
-  /* API added 0.10.6 */
-  gdouble        applied_rate;
-
   /*< private >*/
-  /*gpointer _gst_reserved[GST_PADDING-2];*/
-  guint8 _gst_reserved[(sizeof (gpointer) * GST_PADDING) - sizeof (gdouble)];
+  gpointer _gst_reserved[GST_PADDING];
 };
 
 GType        gst_segment_get_type            (void);
index 10ad4ed58b9a977bad7784eff78d1537f238ef4d..45d12698e0b510333d9aff24d39608be95d319a9 100644 (file)
@@ -152,7 +152,7 @@ gst_system_clock_class_init (GstSystemClockClass * klass)
 
   gstclock_class->get_internal_time = gst_system_clock_get_internal_time;
   gstclock_class->get_resolution = gst_system_clock_get_resolution;
-  gstclock_class->wait_jitter = gst_system_clock_id_wait_jitter;
+  gstclock_class->wait = gst_system_clock_id_wait_jitter;
   gstclock_class->wait_async = gst_system_clock_id_wait_async;
   gstclock_class->unschedule = gst_system_clock_id_unschedule;
 }
index 4c7e8b92f75ab4e7e986b62265b8c6364dec6abf..39d6083e8bdf7e0f74c9a0959812286810c6689e 100644 (file)
@@ -71,7 +71,7 @@ struct _GstSystemClock {
   /* ABI added */
   GstSystemClockPrivate *priv;
 
-  gpointer _gst_reserved[GST_PADDING - 1];
+  gpointer _gst_reserved[GST_PADDING];
 };
 
 struct _GstSystemClockClass {
index 5acbc85a10f9966436229838ef485151c01419aa..fba8c385b5ec929d3e3c787f4d99eadbda07d635 100644 (file)
@@ -185,7 +185,7 @@ gst_task_init (GstTask * task)
 
   task->priv = GST_TASK_GET_PRIVATE (task);
   task->running = FALSE;
-  task->abidata.ABI.thread = NULL;
+  task->thread = NULL;
   task->lock = NULL;
   task->cond = g_cond_new ();
   SET_TASK_STATE (task, GST_TASK_STOPPED);
@@ -274,7 +274,7 @@ gst_task_func (GstTask * task)
   lock = GST_TASK_GET_LOCK (task);
   if (G_UNLIKELY (lock == NULL))
     goto no_lock;
-  task->abidata.ABI.thread = tself;
+  task->thread = tself;
   /* only update the priority when it was changed */
   if (priv->prio_set)
     g_thread_set_priority (tself, priv->priority);
@@ -321,7 +321,7 @@ done:
   g_static_rec_mutex_unlock (lock);
 
   GST_OBJECT_LOCK (task);
-  task->abidata.ABI.thread = NULL;
+  task->thread = NULL;
 
 exit:
   if (priv->thr_callbacks.leave_thread) {
@@ -471,7 +471,7 @@ gst_task_set_priority (GstTask * task, GThreadPriority priority)
   GST_OBJECT_LOCK (task);
   priv->prio_set = TRUE;
   priv->priority = priority;
-  thread = task->abidata.ABI.thread;
+  thread = task->thread;
   if (thread != NULL) {
     /* if this task already has a thread, we can configure the priority right
      * away, else we do that when we assign a thread to the task. */
@@ -812,7 +812,7 @@ gst_task_join (GstTask * task)
   /* we don't use a real thread join here because we are using
    * thread pools */
   GST_OBJECT_LOCK (task);
-  if (G_UNLIKELY (tself == task->abidata.ABI.thread))
+  if (G_UNLIKELY (tself == task->thread))
     goto joining_self;
   SET_TASK_STATE (task, GST_TASK_STOPPED);
   /* signal the state change for when it was blocked in PAUSED. */
@@ -823,7 +823,7 @@ gst_task_join (GstTask * task)
   while (G_LIKELY (task->running))
     GST_TASK_WAIT (task);
   /* clean the thread */
-  task->abidata.ABI.thread = NULL;
+  task->thread = NULL;
   /* get the id and pool to join */
   pool = priv->pool_id;
   id = priv->id;
index 279d530f7aea78cc54ecefef8890007b94ef221d..ed48b0bfb9f2d40d0ba1cafc657d57e8ac4538fe 100644 (file)
@@ -154,15 +154,11 @@ struct _GstTask {
   gboolean         running;
 
   /*< private >*/
-  union {
-    struct {
-      /* thread this task is currently running in */
-      GThread  *thread;
-    } ABI;
-    gpointer _gst_reserved[GST_PADDING - 1];
-  } abidata;
-
-  GstTaskPrivate *priv;
+  GThread         *thread;
+
+  GstTaskPrivate  *priv;
+
+  gpointer _gst_reserved[GST_PADDING];
 };
 
 struct _GstTaskClass {