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

cleanups

Fix padding, remove deprecated symbols.
parent 0894ed20
...@@ -117,7 +117,7 @@ struct _GstBin { ...@@ -117,7 +117,7 @@ struct _GstBin {
/*< private >*/ /*< private >*/
GstBinPrivate *priv; GstBinPrivate *priv;
gpointer _gst_reserved[GST_PADDING - 1]; gpointer _gst_reserved[GST_PADDING];
}; };
/** /**
...@@ -156,7 +156,7 @@ struct _GstBinClass { ...@@ -156,7 +156,7 @@ struct _GstBinClass {
gboolean (*do_latency) (GstBin *bin); gboolean (*do_latency) (GstBin *bin);
/*< private >*/ /*< private >*/
gpointer _gst_reserved[GST_PADDING-1]; gpointer _gst_reserved[GST_PADDING];
}; };
GType gst_bin_get_type (void); GType gst_bin_get_type (void);
......
...@@ -288,7 +288,7 @@ struct _GstBuffer { ...@@ -288,7 +288,7 @@ struct _GstBuffer {
GstBuffer *parent; GstBuffer *parent;
/*< private >*/ /*< private >*/
gpointer _gst_reserved[GST_PADDING - 2]; gpointer _gst_reserved[GST_PADDING];
}; };
struct _GstBufferClass { struct _GstBufferClass {
......
...@@ -489,26 +489,10 @@ gst_clock_id_wait (GstClockID id, GstClockTimeDiff * jitter) ...@@ -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); GST_CAT_DEBUG_OBJECT (GST_CAT_CLOCK, clock, "waiting on clock entry %p", id);
/* if we have a wait_jitter function, use that */ /* if we have a wait_jitter function, use that */
if (G_LIKELY (cclass->wait_jitter)) { if (G_UNLIKELY (cclass->wait == NULL))
res = cclass->wait_jitter (clock, entry, jitter); goto not_supported;
} else {
/* check if we have a simple _wait function otherwise. The function without res = cclass->wait (clock, entry, jitter);
* 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);
}
GST_CAT_DEBUG_OBJECT (GST_CAT_CLOCK, clock, GST_CAT_DEBUG_OBJECT (GST_CAT_CLOCK, clock,
"done waiting entry %p, res: %d", id, res); "done waiting entry %p, res: %d", id, res);
......
...@@ -468,12 +468,11 @@ struct _GstClock { ...@@ -468,12 +468,11 @@ struct _GstClock {
* be acceptable. The new resolution should be returned. * be acceptable. The new resolution should be returned.
* @get_resolution: get the resolution of the clock. * @get_resolution: get the resolution of the clock.
* @get_internal_time: get the internal unadjusted time 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. * 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. * @wait_async: perform an asynchronous wait for the given #GstClockEntry.
* @unschedule: unblock a blocking or async wait operation. * @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 * GStreamer clock class. Override the vmethods to implement the clock
* functionality. * functionality.
...@@ -491,15 +490,13 @@ struct _GstClockClass { ...@@ -491,15 +490,13 @@ struct _GstClockClass {
GstClockTime (*get_internal_time) (GstClock *clock); GstClockTime (*get_internal_time) (GstClock *clock);
/* waiting on an ID */ /* 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); GstClockReturn (*wait_async) (GstClock *clock, GstClockEntry *entry);
void (*unschedule) (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 >*/ /*< private >*/
gpointer _gst_reserved[GST_PADDING - 1]; gpointer _gst_reserved[GST_PADDING];
}; };
GType gst_clock_get_type (void); GType gst_clock_get_type (void);
......
...@@ -85,8 +85,6 @@ ...@@ -85,8 +85,6 @@
#include "gstutils.h" #include "gstutils.h"
#include "gstquark.h" #include "gstquark.h"
#define GST_EVENT_SEQNUM(e) ((GstEvent*)e)->abidata.seqnum
static void gst_event_finalize (GstEvent * event); static void gst_event_finalize (GstEvent * event);
static GstEvent *_gst_event_copy (GstEvent * event); static GstEvent *_gst_event_copy (GstEvent * event);
......
...@@ -200,6 +200,14 @@ typedef struct _GstEventClass GstEventClass; ...@@ -200,6 +200,14 @@ typedef struct _GstEventClass GstEventClass;
*/ */
#define GST_EVENT_SRC(event) (GST_EVENT_CAST(event)->src) #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: * GST_EVENT_IS_UPSTREAM:
* @ev: the event to query * @ev: the event to query
...@@ -347,15 +355,13 @@ struct _GstEvent { ...@@ -347,15 +355,13 @@ struct _GstEvent {
/*< public >*/ /* with COW */ /*< public >*/ /* with COW */
GstEventType type; GstEventType type;
guint64 timestamp; guint64 timestamp;
GstObject *src; GstObject *src;
guint32 seqnum;
GstStructure *structure; GstStructure *structure;
/*< private >*/ /*< private >*/
union { gpointer _gst_reserved[GST_PADDING];
guint32 seqnum;
gpointer _gst_reserved;
} abidata;
}; };
struct _GstEventClass { struct _GstEventClass {
......
...@@ -332,6 +332,7 @@ struct _GstIndex { ...@@ -332,6 +332,7 @@ struct _GstIndex {
GstIndexResolverMethod method; GstIndexResolverMethod method;
GstIndexResolver resolver; GstIndexResolver resolver;
gpointer resolver_user_data; gpointer resolver_user_data;
GDestroyNotify resolver_user_data_destroy;
GstIndexFilter filter; GstIndexFilter filter;
gpointer filter_user_data; gpointer filter_user_data;
...@@ -340,11 +341,8 @@ struct _GstIndex { ...@@ -340,11 +341,8 @@ struct _GstIndex {
GHashTable *writers; GHashTable *writers;
gint last_id; gint last_id;
/* ABI added since 0.10.18 */
GDestroyNotify resolver_user_data_destroy;
/*< private >*/ /*< private >*/
gpointer _gst_reserved[GST_PADDING - 1]; gpointer _gst_reserved[GST_PADDING];
}; };
struct _GstIndexClass { struct _GstIndexClass {
......
...@@ -60,8 +60,6 @@ ...@@ -60,8 +60,6 @@
#include "gstquark.h" #include "gstquark.h"
#define GST_MESSAGE_SEQNUM(e) ((GstMessage*)e)->abidata.ABI.seqnum
static void gst_message_finalize (GstMessage * message); static void gst_message_finalize (GstMessage * message);
static GstMessage *_gst_message_copy (GstMessage * message); static GstMessage *_gst_message_copy (GstMessage * message);
......
...@@ -190,6 +190,15 @@ typedef enum ...@@ -190,6 +190,15 @@ typedef enum
* Get the object that posted @message. * Get the object that posted @message.
*/ */
#define GST_MESSAGE_SRC(message) (GST_MESSAGE_CAST(message)->src) #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: * GST_MESSAGE_SRC_NAME:
* @message: a #GstMessage * @message: a #GstMessage
...@@ -286,17 +295,12 @@ struct _GstMessage ...@@ -286,17 +295,12 @@ struct _GstMessage
GstMessageType type; GstMessageType type;
guint64 timestamp; guint64 timestamp;
GstObject *src; GstObject *src;
guint32 seqnum;
GstStructure *structure; GstStructure *structure;
/*< private >*/ /*< private >*/
union { gpointer _gst_reserved[GST_PADDING];
struct {
guint32 seqnum;
} ABI;
/* + 0 to mark ABI change for future greppage */
gpointer _gst_reserved[GST_PADDING + 0];
} abidata;
}; };
struct _GstMessageClass { struct _GstMessageClass {
......
...@@ -175,7 +175,7 @@ struct _GstPluginDesc { ...@@ -175,7 +175,7 @@ struct _GstPluginDesc {
const gchar *origin; const gchar *origin;
const gchar *release_datetime; const gchar *release_datetime;
/*< private >*/ /*< private >*/
gpointer _gst_reserved[GST_PADDING - 1]; gpointer _gst_reserved[GST_PADDING];
}; };
...@@ -213,7 +213,7 @@ struct _GstPlugin { ...@@ -213,7 +213,7 @@ struct _GstPlugin {
* that matches the plugin's basename */ * that matches the plugin's basename */
GstPluginPrivate *priv; GstPluginPrivate *priv;
gpointer _gst_reserved[GST_PADDING - 1]; gpointer _gst_reserved[GST_PADDING];
}; };
struct _GstPluginClass { struct _GstPluginClass {
......
...@@ -66,7 +66,7 @@ struct _GstRegistry { ...@@ -66,7 +66,7 @@ struct _GstRegistry {
GstRegistryPrivate *priv; GstRegistryPrivate *priv;
/*< private >*/ /*< private >*/
gpointer _gst_reserved[GST_PADDING-3]; gpointer _gst_reserved[GST_PADDING];
}; };
struct _GstRegistryClass { struct _GstRegistryClass {
......
...@@ -53,6 +53,7 @@ struct _GstSegment { ...@@ -53,6 +53,7 @@ struct _GstSegment {
/*< public >*/ /*< public >*/
gdouble rate; gdouble rate;
gdouble abs_rate; gdouble abs_rate;
gdouble applied_rate;
GstFormat format; GstFormat format;
GstSeekFlags flags; GstSeekFlags flags;
gint64 start; gint64 start;
...@@ -63,12 +64,8 @@ struct _GstSegment { ...@@ -63,12 +64,8 @@ struct _GstSegment {
gint64 last_stop; gint64 last_stop;
gint64 duration; gint64 duration;
/* API added 0.10.6 */
gdouble applied_rate;
/*< private >*/ /*< private >*/
/*gpointer _gst_reserved[GST_PADDING-2];*/ gpointer _gst_reserved[GST_PADDING];
guint8 _gst_reserved[(sizeof (gpointer) * GST_PADDING) - sizeof (gdouble)];
}; };
GType gst_segment_get_type (void); GType gst_segment_get_type (void);
......
...@@ -152,7 +152,7 @@ gst_system_clock_class_init (GstSystemClockClass * klass) ...@@ -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_internal_time = gst_system_clock_get_internal_time;
gstclock_class->get_resolution = gst_system_clock_get_resolution; 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->wait_async = gst_system_clock_id_wait_async;
gstclock_class->unschedule = gst_system_clock_id_unschedule; gstclock_class->unschedule = gst_system_clock_id_unschedule;
} }
......
...@@ -71,7 +71,7 @@ struct _GstSystemClock { ...@@ -71,7 +71,7 @@ struct _GstSystemClock {
/* ABI added */ /* ABI added */
GstSystemClockPrivate *priv; GstSystemClockPrivate *priv;
gpointer _gst_reserved[GST_PADDING - 1]; gpointer _gst_reserved[GST_PADDING];
}; };
struct _GstSystemClockClass { struct _GstSystemClockClass {
......
...@@ -185,7 +185,7 @@ gst_task_init (GstTask * task) ...@@ -185,7 +185,7 @@ gst_task_init (GstTask * task)
task->priv = GST_TASK_GET_PRIVATE (task); task->priv = GST_TASK_GET_PRIVATE (task);
task->running = FALSE; task->running = FALSE;
task->abidata.ABI.thread = NULL; task->thread = NULL;
task->lock = NULL; task->lock = NULL;
task->cond = g_cond_new (); task->cond = g_cond_new ();
SET_TASK_STATE (task, GST_TASK_STOPPED); SET_TASK_STATE (task, GST_TASK_STOPPED);
...@@ -274,7 +274,7 @@ gst_task_func (GstTask * task) ...@@ -274,7 +274,7 @@ gst_task_func (GstTask * task)
lock = GST_TASK_GET_LOCK (task); lock = GST_TASK_GET_LOCK (task);
if (G_UNLIKELY (lock == NULL)) if (G_UNLIKELY (lock == NULL))
goto no_lock; goto no_lock;
task->abidata.ABI.thread = tself; task->thread = tself;
/* only update the priority when it was changed */ /* only update the priority when it was changed */
if (priv->prio_set) if (priv->prio_set)
g_thread_set_priority (tself, priv->priority); g_thread_set_priority (tself, priv->priority);
...@@ -321,7 +321,7 @@ done: ...@@ -321,7 +321,7 @@ done:
g_static_rec_mutex_unlock (lock); g_static_rec_mutex_unlock (lock);
GST_OBJECT_LOCK (task); GST_OBJECT_LOCK (task);
task->abidata.ABI.thread = NULL; task->thread = NULL;
exit: exit:
if (priv->thr_callbacks.leave_thread) { if (priv->thr_callbacks.leave_thread) {
...@@ -471,7 +471,7 @@ gst_task_set_priority (GstTask * task, GThreadPriority priority) ...@@ -471,7 +471,7 @@ gst_task_set_priority (GstTask * task, GThreadPriority priority)
GST_OBJECT_LOCK (task); GST_OBJECT_LOCK (task);
priv->prio_set = TRUE; priv->prio_set = TRUE;
priv->priority = priority; priv->priority = priority;
thread = task->abidata.ABI.thread; thread = task->thread;
if (thread != NULL) { if (thread != NULL) {
/* if this task already has a thread, we can configure the priority right /* 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. */ * away, else we do that when we assign a thread to the task. */
...@@ -812,7 +812,7 @@ gst_task_join (GstTask * task) ...@@ -812,7 +812,7 @@ gst_task_join (GstTask * task)
/* we don't use a real thread join here because we are using /* we don't use a real thread join here because we are using
* thread pools */ * thread pools */
GST_OBJECT_LOCK (task); GST_OBJECT_LOCK (task);
if (G_UNLIKELY (tself == task->abidata.ABI.thread)) if (G_UNLIKELY (tself == task->thread))
goto joining_self; goto joining_self;
SET_TASK_STATE (task, GST_TASK_STOPPED); SET_TASK_STATE (task, GST_TASK_STOPPED);
/* signal the state change for when it was blocked in PAUSED. */ /* signal the state change for when it was blocked in PAUSED. */
...@@ -823,7 +823,7 @@ gst_task_join (GstTask * task) ...@@ -823,7 +823,7 @@ gst_task_join (GstTask * task)
while (G_LIKELY (task->running)) while (G_LIKELY (task->running))
GST_TASK_WAIT (task); GST_TASK_WAIT (task);
/* clean the thread */ /* clean the thread */
task->abidata.ABI.thread = NULL; task->thread = NULL;
/* get the id and pool to join */ /* get the id and pool to join */
pool = priv->pool_id; pool = priv->pool_id;
id = priv->id; id = priv->id;
......
...@@ -154,15 +154,11 @@ struct _GstTask { ...@@ -154,15 +154,11 @@ struct _GstTask {
gboolean running; gboolean running;
/*< private >*/ /*< private >*/
union { GThread *thread;
struct {
/* thread this task is currently running in */ GstTaskPrivate *priv;
GThread *thread;
} ABI; gpointer _gst_reserved[GST_PADDING];
gpointer _gst_reserved[GST_PADDING - 1];
} abidata;
GstTaskPrivate *priv;
}; };
struct _GstTaskClass { 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