[libcamera-devel,v3,06/22] v4l2: v4l2_camera_proxy: Set timestamp monotonic buffer flag on reqbufs

Message ID 20200623190836.53446-7-paul.elder@ideasonboard.com
State Superseded
Headers show
Series
  • Support v4l2-compliance
Related show

Commit Message

Paul Elder June 23, 2020, 7:08 p.m. UTC
Set buffer flag V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC at VIDIOC_REQBUFS
after the buffers have been allocated.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com.

---
New in v3
- split from a conglomerate of v4l2-compliance fixes patch
---
 src/v4l2/v4l2_camera_proxy.cpp | 1 +
 1 file changed, 1 insertion(+)

Comments

Laurent Pinchart June 23, 2020, 10:28 p.m. UTC | #1
Hi Paul,

Thank you for the patch.

On Wed, Jun 24, 2020 at 04:08:20AM +0900, Paul Elder wrote:
> Set buffer flag V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC at VIDIOC_REQBUFS
> after the buffers have been allocated.
> 
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com.

We don't know what time stamp source the camera uses, but for now I
think this is fine.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> New in v3
> - split from a conglomerate of v4l2-compliance fixes patch
> ---
>  src/v4l2/v4l2_camera_proxy.cpp | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp
> index 5acb036..7d750c0 100644
> --- a/src/v4l2/v4l2_camera_proxy.cpp
> +++ b/src/v4l2/v4l2_camera_proxy.cpp
> @@ -412,6 +412,7 @@ int V4L2CameraProxy::vidioc_reqbufs(V4L2CameraFile *file, struct v4l2_requestbuf
>  		buf.memory = V4L2_MEMORY_MMAP;
>  		buf.m.offset = i * curV4L2Format_.fmt.pix.sizeimage;
>  		buf.index = i;
> +		buf.flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
>  
>  		buffers_[i] = buf;
>  	}

Patch

diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp
index 5acb036..7d750c0 100644
--- a/src/v4l2/v4l2_camera_proxy.cpp
+++ b/src/v4l2/v4l2_camera_proxy.cpp
@@ -412,6 +412,7 @@  int V4L2CameraProxy::vidioc_reqbufs(V4L2CameraFile *file, struct v4l2_requestbuf
 		buf.memory = V4L2_MEMORY_MMAP;
 		buf.m.offset = i * curV4L2Format_.fmt.pix.sizeimage;
 		buf.index = i;
+		buf.flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
 
 		buffers_[i] = buf;
 	}