sink->priv->custom_slaving_cb_notify (sink->priv->custom_slaving_cb_data);
if (sink->provided_clock) {
- gst_audio_clock_invalidate (sink->provided_clock);
+ gst_audio_clock_invalidate (GST_AUDIO_CLOCK (sink->provided_clock));
gst_object_unref (sink->provided_clock);
sink->provided_clock = NULL;
}
/* sample clocks and figure out clock skew */
etime = gst_clock_get_time (GST_ELEMENT_CLOCK (sink));
- itime = gst_audio_clock_get_time (sink->provided_clock);
- itime = gst_audio_clock_adjust (sink->provided_clock, itime);
+ itime = gst_audio_clock_get_time (GST_AUDIO_CLOCK (sink->provided_clock));
+ itime =
+ gst_audio_clock_adjust (GST_AUDIO_CLOCK (sink->provided_clock), itime);
GST_DEBUG_OBJECT (sink,
"internal %" GST_TIME_FORMAT " external %" GST_TIME_FORMAT
/* sample clocks and figure out clock skew */
etime = gst_clock_get_time (GST_ELEMENT_CLOCK (sink));
- itime = gst_audio_clock_get_time (sink->provided_clock);
- itime = gst_audio_clock_adjust (sink->provided_clock, itime);
+ itime = gst_audio_clock_get_time (GST_AUDIO_CLOCK (sink->provided_clock));
+ itime =
+ gst_audio_clock_adjust (GST_AUDIO_CLOCK (sink->provided_clock), itime);
GST_DEBUG_OBJECT (sink,
"internal %" GST_TIME_FORMAT " external %" GST_TIME_FORMAT
/* We might need to take the object lock within gst_audio_clock_get_time(),
* so call that before we take it again */
- itime = gst_audio_clock_get_time (sink->provided_clock);
- itime = gst_audio_clock_adjust (sink->provided_clock, itime);
+ itime = gst_audio_clock_get_time (GST_AUDIO_CLOCK (sink->provided_clock));
+ itime =
+ gst_audio_clock_adjust (GST_AUDIO_CLOCK (sink->provided_clock), itime);
GST_OBJECT_LOCK (sink);
GST_OBJECT_LOCK (src);
if (src->clock) {
- gst_audio_clock_invalidate (src->clock);
+ gst_audio_clock_invalidate (GST_AUDIO_CLOCK (src->clock));
gst_object_unref (src->clock);
src->clock = NULL;
}
} else {
/* to get the timestamp against the clock we also need to add our
* offset */
- timestamp = gst_audio_clock_adjust (clock, timestamp);
+ timestamp = gst_audio_clock_adjust (GST_AUDIO_CLOCK (clock), timestamp);
}
/* we are not slaved, subtract base_time */
* Returns: the time as reported by the time function of the audio clock
*/
GstClockTime
-gst_audio_clock_get_time (GstClock * clock)
+gst_audio_clock_get_time (GstAudioClock * clock)
{
- GstAudioClock *aclock;
GstClockTime result;
- aclock = GST_AUDIO_CLOCK_CAST (clock);
-
- result = aclock->func (clock, aclock->user_data);
+ result = clock->func (GST_CLOCK_CAST (clock), clock->user_data);
if (result == GST_CLOCK_TIME_NONE) {
GST_DEBUG_OBJECT (clock, "no time, reuse last");
- result = aclock->last_time - aclock->time_offset;
+ result = clock->last_time - clock->time_offset;
}
GST_DEBUG_OBJECT (clock,
"result %" GST_TIME_FORMAT ", last_time %" GST_TIME_FORMAT,
- GST_TIME_ARGS (result), GST_TIME_ARGS (aclock->last_time));
+ GST_TIME_ARGS (result), GST_TIME_ARGS (clock->last_time));
return result;
}
* Returns: @time adjusted with the internal offset.
*/
GstClockTime
-gst_audio_clock_adjust (GstClock * clock, GstClockTime time)
+gst_audio_clock_adjust (GstAudioClock * clock, GstClockTime time)
{
- GstAudioClock *aclock;
GstClockTime result;
- aclock = GST_AUDIO_CLOCK_CAST (clock);
-
- result = time + aclock->time_offset;
+ result = time + clock->time_offset;
return result;
}
* the rest of its lifetime.
*/
void
-gst_audio_clock_invalidate (GstClock * clock)
+gst_audio_clock_invalidate (GstAudioClock * clock)
{
- GstAudioClock *aclock;
-
- aclock = GST_AUDIO_CLOCK_CAST (clock);
-
- aclock->func = gst_audio_clock_func_invalid;
+ clock->func = gst_audio_clock_func_invalid;
}
gpointer user_data, GDestroyNotify destroy_notify);
void gst_audio_clock_reset (GstAudioClock *clock, GstClockTime time);
-GstClockTime gst_audio_clock_get_time (GstClock * clock);
-GstClockTime gst_audio_clock_adjust (GstClock * clock, GstClockTime time);
+GstClockTime gst_audio_clock_get_time (GstAudioClock * clock);
+GstClockTime gst_audio_clock_adjust (GstAudioClock * clock, GstClockTime time);
-void gst_audio_clock_invalidate (GstClock * clock);
+void gst_audio_clock_invalidate (GstAudioClock * clock);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstAudioClock, gst_object_unref)