From c2279ef39dd7a2cda88ec6949b24ff0f71c19983 Mon Sep 17 00:00:00 2001 From: George Hotz <72895+geohot@users.noreply.github.com> Date: Wed, 18 May 2022 12:58:52 -0700 Subject: [PATCH] add unixTimestampNanos to encoderd (#24583) Co-authored-by: Comma Device --- selfdrive/loggerd/encoder/encoder.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/selfdrive/loggerd/encoder/encoder.cc b/selfdrive/loggerd/encoder/encoder.cc index 86fd441979..943f37803d 100644 --- a/selfdrive/loggerd/encoder/encoder.cc +++ b/selfdrive/loggerd/encoder/encoder.cc @@ -20,6 +20,9 @@ void VideoEncoder::publisher_publish(VideoEncoder *e, int segment_num, uint32_t ((e->type == WideRoadCam) ? event.initWideRoadEncodeData() : (e->in_width == e->out_width ? event.initRoadEncodeData() : event.initQRoadEncodeData())); auto edata = edat.initIdx(); + struct timespec ts; + timespec_get(&ts, TIME_UTC); + edat.setUnixTimestampNanos((uint64_t)ts.tv_sec*1000000000 + ts.tv_nsec); edata.setFrameId(extra.frame_id); edata.setTimestampSof(extra.timestamp_sof); edata.setTimestampEof(extra.timestamp_eof);