kayasrc: for Unix time metadata, sync against system clock every frame due to drift

Otherwise, over time, the framegrabber clock drifts from the system clock.
This commit is contained in:
Joshua M. Doe 2021-08-02 10:54:15 -04:00
parent 7f3c5814b0
commit 63295f7290

View File

@ -799,11 +799,11 @@ gst_kayasrc_stream_buffer_callback (STREAM_BUFFER_HANDLE buffer_handle,
GST_BUFFER_OFFSET (buf) = src->frame_count;
src->frame_count++;
if (src->kaya_base == GST_CLOCK_TIME_NONE) {
/* assume delay between these two calls is negligible */
src->kaya_base = KYFG_GetGrabberValueInt (src->cam_handle, "Timestamp");
src->unix_base = g_get_real_time () * 1000;
}
//if (src->kaya_base == GST_CLOCK_TIME_NONE) {
// assume delay between these two calls is negligible
src->kaya_base = KYFG_GetGrabberValueInt (src->cam_handle, "Timestamp");
src->unix_base = g_get_real_time () * 1000;
//}
#if GST_CHECK_VERSION(1,14,0)
{
GstClockTime unix_ts = src->unix_base + (timestamp - src->kaya_base);