diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2011-02-22 16:04:12 +0100 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2011-02-22 16:04:12 +0100 |
commit | 5dd9ab1cab9cd8e2d8c9ee116df9bf5a5e5e7954 (patch) | |
tree | 8de6c7cfae592aa04ca61b508357797fb3528134 | |
parent | 0894ed2053023ad9573d5dd3e7e36b0f17caeb4e (diff) | |
download | gstreamer-5dd9ab1cab9cd8e2d8c9ee116df9bf5a5e5e7954.tar.gz |
cleanups
Fix padding, remove deprecated symbols.
-rw-r--r-- | gst/gstbin.h | 4 | ||||
-rw-r--r-- | gst/gstbuffer.h | 2 | ||||
-rw-r--r-- | gst/gstclock.c | 24 | ||||
-rw-r--r-- | gst/gstclock.h | 13 | ||||
-rw-r--r-- | gst/gstevent.c | 2 | ||||
-rw-r--r-- | gst/gstevent.h | 16 | ||||
-rw-r--r-- | gst/gstindex.h | 6 | ||||
-rw-r--r-- | gst/gstmessage.c | 2 | ||||
-rw-r--r-- | gst/gstmessage.h | 18 | ||||
-rw-r--r-- | gst/gstplugin.h | 4 | ||||
-rw-r--r-- | gst/gstregistry.h | 2 | ||||
-rw-r--r-- | gst/gstsegment.h | 7 | ||||
-rw-r--r-- | gst/gstsystemclock.c | 2 | ||||
-rw-r--r-- | gst/gstsystemclock.h | 2 | ||||
-rw-r--r-- | gst/gsttask.c | 12 | ||||
-rw-r--r-- | gst/gsttask.h | 14 |
16 files changed, 54 insertions, 76 deletions
diff --git a/gst/gstbin.h b/gst/gstbin.h index 2473ef6906..19c7634a64 100644 --- a/gst/gstbin.h +++ b/gst/gstbin.h @@ -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); diff --git a/gst/gstbuffer.h b/gst/gstbuffer.h index ad48315c6a..a6e4bf3168 100644 --- a/gst/gstbuffer.h +++ b/gst/gstbuffer.h @@ -288,7 +288,7 @@ struct _GstBuffer { GstBuffer *parent; /*< private >*/ - gpointer _gst_reserved[GST_PADDING - 2]; + gpointer _gst_reserved[GST_PADDING]; }; struct _GstBufferClass { diff --git a/gst/gstclock.c b/gst/gstclock.c index 45f503e731..b167238b71 100644 --- a/gst/gstclock.c +++ b/gst/gstclock.c @@ -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); diff --git a/gst/gstclock.h b/gst/gstclock.h index cc1ed0940b..a94b3a587a 100644 --- a/gst/gstclock.h +++ b/gst/gstclock.h @@ -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); diff --git a/gst/gstevent.c b/gst/gstevent.c index 07414c7fa4..bc6b754d55 100644 --- a/gst/gstevent.c +++ b/gst/gstevent.c @@ -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); diff --git a/gst/gstevent.h b/gst/gstevent.h index 34983b679b..87ece59d52 100644 --- a/gst/gstevent.h +++ b/gst/gstevent.h @@ -201,6 +201,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 { diff --git a/gst/gstindex.h b/gst/gstindex.h index e5fc6256c0..9447a38c2e 100644 --- a/gst/gstindex.h +++ b/gst/gstindex.h @@ -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 { diff --git a/gst/gstmessage.c b/gst/gstmessage.c index e151042302..8cc3580895 100644 --- a/gst/gstmessage.c +++ b/gst/gstmessage.c @@ -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); diff --git a/gst/gstmessage.h b/gst/gstmessage.h index 0eafac52df..9327e09901 100644 --- a/gst/gstmessage.h +++ b/gst/gstmessage.h @@ -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 { diff --git a/gst/gstplugin.h b/gst/gstplugin.h index 0fa2f62b1c..7eb33e4a5d 100644 --- a/gst/gstplugin.h +++ b/gst/gstplugin.h @@ -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 { diff --git a/gst/gstregistry.h b/gst/gstregistry.h index c3aa9f480b..f2d07c1d9a 100644 --- a/gst/gstregistry.h +++ b/gst/gstregistry.h @@ -66,7 +66,7 @@ struct _GstRegistry { GstRegistryPrivate *priv; /*< private >*/ - gpointer _gst_reserved[GST_PADDING-3]; + gpointer _gst_reserved[GST_PADDING]; }; struct _GstRegistryClass { diff --git a/gst/gstsegment.h b/gst/gstsegment.h index a0c3683202..37ab0b769b 100644 --- a/gst/gstsegment.h +++ b/gst/gstsegment.h @@ -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); diff --git a/gst/gstsystemclock.c b/gst/gstsystemclock.c index 10ad4ed58b..45d12698e0 100644 --- a/gst/gstsystemclock.c +++ b/gst/gstsystemclock.c @@ -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; } diff --git a/gst/gstsystemclock.h b/gst/gstsystemclock.h index 4c7e8b92f7..39d6083e8b 100644 --- a/gst/gstsystemclock.h +++ b/gst/gstsystemclock.h @@ -71,7 +71,7 @@ struct _GstSystemClock { /* ABI added */ GstSystemClockPrivate *priv; - gpointer _gst_reserved[GST_PADDING - 1]; + gpointer _gst_reserved[GST_PADDING]; }; struct _GstSystemClockClass { diff --git a/gst/gsttask.c b/gst/gsttask.c index 5acbc85a10..fba8c385b5 100644 --- a/gst/gsttask.c +++ b/gst/gsttask.c @@ -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; diff --git a/gst/gsttask.h b/gst/gsttask.h index 279d530f7a..ed48b0bfb9 100644 --- a/gst/gsttask.h +++ b/gst/gsttask.h @@ -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 { |