diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2019-03-29 10:35:18 +0100 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2019-03-29 16:04:50 +0100 |
commit | 21e24eeeb835341e7d4f5a65cad03d7b3be45ec6 (patch) | |
tree | 30c9173fe41247a693d039195e53b185c72d4d3a | |
parent | f8a3b5ce290144e93289cb56279f80ee2f9d5c03 (diff) |
cv4l-helpers.h: add g_timestamp_ns()
Add helper to return a v4l2_buffer timestamp as nanoseconds.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r-- | utils/common/cv4l-helpers.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/utils/common/cv4l-helpers.h b/utils/common/cv4l-helpers.h index 1cd2b6b2..8d1416d9 100644 --- a/utils/common/cv4l-helpers.h +++ b/utils/common/cv4l-helpers.h @@ -882,6 +882,7 @@ public: void s_timestamp_src(__u32 src) { v4l_buffer_s_timestamp_src(this, src); } bool ts_is_copy() const { return v4l_buffer_is_copy(this); } const timeval &g_timestamp() const { return *v4l_buffer_g_timestamp(this); } + __u64 g_timestamp_ns() const { return v4l2_timeval_to_ns(v4l_buffer_g_timestamp(this)); } void s_timestamp(const timeval &tv) { v4l_buffer_s_timestamp(this, &tv); } void s_timestamp_ts(const timespec &ts) { v4l_buffer_s_timestamp_ts(this, &ts); } void s_timestamp_clock() { v4l_buffer_s_timestamp_clock(this); } |