Commit 5dd9ab1c authored by Wim Taymans's avatar Wim Taymans

cleanups

Fix padding, remove deprecated symbols.
parent 0894ed20
......@@ -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);
......
......@@ -288,7 +288,7 @@ struct _GstBuffer {
GstBuffer *parent;
/*< private >*/
gpointer _gst_reserved[GST_PADDING - 2];
gpointer _gst_reserved[GST_PADDING];
};
struct _GstBufferClass {
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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 {
......
......@@ -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 {
......
......@@ -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);
......
......@@ -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 {
......
......@@ -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 {
......
......@@ -66,7 +66,7 @@ struct _GstRegistry {
GstRegistryPrivate *priv;
/*< private >*/
gpointer _gst_reserved[GST_PADDING-3];
gpointer _gst_reserved[GST_PADDING];
};
struct _GstRegistryClass {
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -71,7 +71,7 @@ struct _GstSystemClock {
/* ABI added */
GstSystemClockPrivate *priv;
gpointer _gst_reserved[GST_PADDING - 1];
gpointer _gst_reserved[GST_PADDING];
};
struct _GstSystemClockClass {
......
......@@ -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;
......
......@@ -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 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment