mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
audio: clean up headers
This commit is contained in:
parent
2e837743c3
commit
a58805216a
4 changed files with 24 additions and 35 deletions
|
@ -102,7 +102,7 @@ gst_audio_clock_init (GstAudioClock * clock)
|
|||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -111,9 +111,9 @@ gst_audio_clock_dispose (GObject * object)
|
|||
{
|
||||
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);
|
||||
|
@ -168,7 +168,7 @@ gst_audio_clock_new_full (const gchar * name, GstAudioClockGetTimeFunc func,
|
|||
|
||||
aclock->func = func;
|
||||
aclock->user_data = user_data;
|
||||
aclock->abidata.ABI.destroy_notify = destroy_notify;
|
||||
aclock->destroy_notify = destroy_notify;
|
||||
|
||||
return (GstClock *) aclock;
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ gst_audio_clock_reset (GstAudioClock * clock, GstClockTime time)
|
|||
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 %"
|
||||
|
@ -219,7 +219,7 @@ gst_audio_clock_get_internal_time (GstClock * clock)
|
|||
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;
|
||||
|
@ -256,7 +256,7 @@ gst_audio_clock_get_time (GstClock * clock)
|
|||
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,
|
||||
|
@ -285,7 +285,7 @@ gst_audio_clock_adjust (GstClock * clock, GstClockTime time)
|
|||
|
||||
aclock = GST_AUDIO_CLOCK_CAST (clock);
|
||||
|
||||
result = time + aclock->abidata.ABI.time_offset;
|
||||
result = time + aclock->time_offset;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -69,18 +69,13 @@ struct _GstAudioClock {
|
|||
/*< protected >*/
|
||||
GstAudioClockGetTimeFunc func;
|
||||
gpointer user_data;
|
||||
|
||||
GstClockTime last_time;
|
||||
GDestroyNotify destroy_notify;
|
||||
|
||||
/*< private >*/
|
||||
union {
|
||||
struct {
|
||||
GstClockTime last_time;
|
||||
GstClockTimeDiff time_offset;
|
||||
GDestroyNotify destroy_notify;
|
||||
} ABI;
|
||||
/* adding + 0 to mark ABI change to be undone later */
|
||||
gpointer _gst_reserved[GST_PADDING + 0];
|
||||
} abidata;
|
||||
|
||||
gpointer _gst_reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
struct _GstAudioClockClass {
|
||||
|
|
|
@ -826,7 +826,7 @@ gst_base_audio_sink_drain (GstBaseAudioSink * sink)
|
|||
|
||||
/* 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
|
||||
|
@ -845,7 +845,7 @@ gst_base_audio_sink_drain (GstBaseAudioSink * sink)
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -1570,8 +1570,7 @@ gst_base_audio_sink_render (GstBaseSink * bsink, GstBuffer * buf)
|
|||
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)
|
||||
|
@ -1953,7 +1952,7 @@ gst_base_audio_sink_change_state (GstElement * element,
|
|||
|
||||
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 */
|
||||
|
|
|
@ -124,17 +124,13 @@ struct _GstBaseAudioSink {
|
|||
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];
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -158,9 +154,8 @@ struct _GstBaseAudioSinkClass {
|
|||
/* 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);
|
||||
|
|
Loading…
Reference in a new issue