{
GST_DEBUG_OBJECT (clock, "init");
clock->last_time = 0;
- clock->abidata.ABI.time_offset = 0;
+ clock->time_offset = 0;
GST_OBJECT_FLAG_SET (clock, GST_CLOCK_FLAG_CAN_SET_MASTER);
}
{
GstAudioClock *clock = GST_AUDIO_CLOCK (object);
- if (clock->abidata.ABI.destroy_notify && clock->user_data)
- clock->abidata.ABI.destroy_notify (clock->user_data);
- clock->abidata.ABI.destroy_notify = NULL;
+ if (clock->destroy_notify && clock->user_data)
+ clock->destroy_notify (clock->user_data);
+ clock->destroy_notify = NULL;
clock->user_data = NULL;
G_OBJECT_CLASS (parent_class)->dispose (object);
aclock->func = func;
aclock->user_data = user_data;
- aclock->abidata.ABI.destroy_notify = destroy_notify;
+ aclock->destroy_notify = destroy_notify;
return (GstClock *) aclock;
}
else
time_offset = -(time - clock->last_time);
- clock->abidata.ABI.time_offset = time_offset;
+ clock->time_offset = time_offset;
GST_DEBUG_OBJECT (clock,
"reset clock to %" GST_TIME_FORMAT ", last %" GST_TIME_FORMAT ", offset %"
if (result == GST_CLOCK_TIME_NONE) {
result = aclock->last_time;
} else {
- result += aclock->abidata.ABI.time_offset;
+ result += aclock->time_offset;
/* clock must be increasing */
if (aclock->last_time < result)
aclock->last_time = result;
result = aclock->func (clock, aclock->user_data);
if (result == GST_CLOCK_TIME_NONE) {
GST_DEBUG_OBJECT (clock, "no time, reuse last");
- result = aclock->last_time - aclock->abidata.ABI.time_offset;
+ result = aclock->last_time - aclock->time_offset;
}
GST_DEBUG_OBJECT (clock,
aclock = GST_AUDIO_CLOCK_CAST (clock);
- result = time + aclock->abidata.ABI.time_offset;
+ result = time + aclock->time_offset;
return result;
}
/*< protected >*/
GstAudioClockGetTimeFunc func;
- gpointer user_data;
-
- GstClockTime last_time;
+ gpointer user_data;
+ GDestroyNotify destroy_notify;
/*< private >*/
- union {
- struct {
- GstClockTimeDiff time_offset;
- GDestroyNotify destroy_notify;
- } ABI;
- /* adding + 0 to mark ABI change to be undone later */
- gpointer _gst_reserved[GST_PADDING + 0];
- } abidata;
+ GstClockTime last_time;
+ GstClockTimeDiff time_offset;
+
+ gpointer _gst_reserved[GST_PADDING];
};
struct _GstAudioClockClass {
/* if PLAYING is interrupted,
* arrange to have clock running when going to PLAYING again */
- g_atomic_int_set (&sink->abidata.ABI.eos_rendering, 1);
+ g_atomic_int_set (&sink->eos_rendering, 1);
/* need to start playback before we can drain, but only when
* we have successfully negotiated a format and thus acquired the
GST_DEBUG_OBJECT (sink, "drained audio");
}
- g_atomic_int_set (&sink->abidata.ABI.eos_rendering, 0);
+ g_atomic_int_set (&sink->eos_rendering, 0);
return TRUE;
}
GST_TIME_ARGS (render_start), GST_TIME_ARGS (render_stop));
/* bring to position in the ringbuffer */
- time_offset =
- GST_AUDIO_CLOCK_CAST (sink->provided_clock)->abidata.ABI.time_offset;
+ time_offset = GST_AUDIO_CLOCK_CAST (sink->provided_clock)->time_offset;
GST_DEBUG_OBJECT (sink,
"time offset %" GST_TIME_FORMAT, GST_TIME_ARGS (time_offset));
if (render_start > time_offset)
gst_ring_buffer_may_start (sink->ringbuffer, TRUE);
if (GST_BASE_SINK_CAST (sink)->pad_mode == GST_ACTIVATE_PULL ||
- g_atomic_int_get (&sink->abidata.ABI.eos_rendering) || eos) {
+ g_atomic_int_get (&sink->eos_rendering) || eos) {
/* we always start the ringbuffer in pull mode immediatly */
/* sync rendering on eos needs running clock,
* and others need running clock when finished rendering eos */
gboolean provide_clock;
GstClock *provided_clock;
+ /* with g_atomic_; currently rendering eos */
+ gboolean eos_rendering;
+
/*< private >*/
GstBaseAudioSinkPrivate *priv;
- union {
- struct {
- /*< protected >*/
- /* with g_atomic_; currently rendering eos */
- gboolean eos_rendering;
- } ABI;
- gpointer _gst_reserved[GST_PADDING - 1];
- } abidata;
+ gpointer _gst_reserved[GST_PADDING];
};
/**
/* subclass payloader */
GstBuffer* (*payload) (GstBaseAudioSink *sink,
GstBuffer *buffer);
-
/*< private >*/
- gpointer _gst_reserved[GST_PADDING - 1];
+ gpointer _gst_reserved[GST_PADDING];
};
GType gst_base_audio_sink_get_type(void);