Re: [RFCv3 API PATCH 15/31] v4l2-core: Add new V4L2_CAP_MONOTONIC_TS capability.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Hans,

Thanks for the patch.

Hans Verkuil wrote:
...
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -290,6 +290,7 @@ struct v4l2_capability {
  #define V4L2_CAP_ASYNCIO                0x02000000  /* async I/O */
  #define V4L2_CAP_STREAMING              0x04000000  /* streaming I/O ioctls */

+#define V4L2_CAP_MONOTONIC_TS           0x40000000  /* uses monotonic timestamps */
  #define V4L2_CAP_DEVICE_CAPS            0x80000000  /* sets device capabilities field */

I have to say I'm still not a big fan of this new capability flag.

I had a quick discussion with Laurent, and what he suggested was to use the kernel version to figure out the type of the timestamp. The drivers that use the monotonic time right now wouldn't be affected by the new flag on older kernels. If we've decided we're going to switch to monotonic time anyway, why not just change all the drivers now and forget the capability flag.

Instead of a capability flag, the applications would know the type of the timestamp based on the kernel version. In the end we wouldn't be left with a useless flag that every single driver would have to set.

It's true that there are some 70 such drivers that need to be converted but it's still a trivial, mechanical task. It would be even easier to implement a helper function called e.g. v4l2_buffer_timestamp() so that every user wouldn't have to convert timespec to timeval.

As a result we'd also have a very short transition period to the timestamps we prefer.

Kind regards,

--
Sakari Ailus
sakari.ailus@xxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux