self->input->clock_last_time = result;
}
+ result += self->input->clock_epoch;
g_mutex_unlock (&self->input->lock);
} else if (self->output != NULL) {
g_mutex_lock (&self->output->lock);
self->output->clock_last_time = result;
}
+ result += self->output->clock_epoch;
g_mutex_unlock (&self->output->lock);
} else {
g_assert_not_reached ();
IDeckLink *device;
IDeckLinkOutput *output;
GstClock *clock;
- GstClockTime clock_start_time, clock_last_time;
+ GstClockTime clock_start_time, clock_last_time, clock_epoch;
GstClockTimeDiff clock_offset;
gboolean started, clock_restart;
IDeckLinkConfiguration *config;
IDeckLinkAttributes *attributes;
GstClock *clock;
- GstClockTime clock_start_time, clock_offset, clock_last_time;
+ GstClockTime clock_start_time, clock_offset, clock_last_time, clock_epoch;
gboolean started, clock_restart;
/* Everything below protected by mutex */
self->output->start_scheduled_playback =
gst_decklink_video_sink_start_scheduled_playback;
self->output->clock_start_time = GST_CLOCK_TIME_NONE;
+ self->output->clock_epoch += self->output->clock_last_time;
self->output->clock_last_time = 0;
self->output->clock_offset = 0;
g_mutex_unlock (&self->output->lock);
case GST_STATE_CHANGE_READY_TO_PAUSED:
g_mutex_lock (&self->output->lock);
self->output->clock_start_time = GST_CLOCK_TIME_NONE;
+ self->output->clock_epoch += self->output->clock_last_time;
self->output->clock_last_time = 0;
self->output->clock_offset = 0;
g_mutex_unlock (&self->output->lock);
gst_clock_set_calibration (self->output->clock, 0, 0, 1, 1);
g_mutex_lock (&self->output->lock);
self->output->clock_start_time = GST_CLOCK_TIME_NONE;
+ self->output->clock_epoch += self->output->clock_last_time;
self->output->clock_last_time = 0;
self->output->clock_offset = 0;
g_mutex_unlock (&self->output->lock);
self->input->got_video_frame = gst_decklink_video_src_got_frame;
self->input->start_streams = gst_decklink_video_src_start_streams;
self->input->clock_start_time = GST_CLOCK_TIME_NONE;
+ self->input->clock_epoch += self->input->clock_last_time;
self->input->clock_last_time = 0;
self->input->clock_offset = 0;
g_mutex_unlock (&self->input->lock);
case GST_STATE_CHANGE_READY_TO_PAUSED:
g_mutex_lock (&self->input->lock);
self->input->clock_start_time = GST_CLOCK_TIME_NONE;
+ self->input->clock_epoch += self->input->clock_last_time;
self->input->clock_last_time = 0;
self->input->clock_offset = 0;
g_mutex_unlock (&self->input->lock);
gst_clock_set_calibration (self->input->clock, 0, 0, 1, 1);
g_mutex_lock (&self->input->lock);
self->input->clock_start_time = GST_CLOCK_TIME_NONE;
+ self->input->clock_epoch += self->input->clock_last_time;
self->input->clock_last_time = 0;
self->input->clock_offset = 0;
g_mutex_unlock (&self->input->lock);