[libcamera-devel] [PATCH v2 08/17] v4l2: v4l2_camera: Add isRunning()

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sat Jun 20 03:46:42 CEST 2020


Hi Paul,

Thank you for the patch.

On Fri, Jun 19, 2020 at 02:41:14PM +0900, Paul Elder wrote:
> Add a method isRunning() to V4L2Camera so that V4L2CameraProxy can use
> it for checks.
> 
> Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
> 
> ---
> Changes in v2:
> - replace V4L2CameraProxy::streaming_ with
>   V4L2CameraProxy::isRunning()
> - moved the checks to different patches
> ---
>  src/v4l2/v4l2_camera.cpp | 5 +++++
>  src/v4l2/v4l2_camera.h   | 2 ++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/src/v4l2/v4l2_camera.cpp b/src/v4l2/v4l2_camera.cpp
> index 2557320..177b1ea 100644
> --- a/src/v4l2/v4l2_camera.cpp
> +++ b/src/v4l2/v4l2_camera.cpp
> @@ -227,3 +227,8 @@ int V4L2Camera::qbuf(unsigned int index)
>  
>  	return 0;
>  }
> +
> +bool V4L2Camera::isRunning()
> +{
> +	return isRunning_;
> +}
> diff --git a/src/v4l2/v4l2_camera.h b/src/v4l2/v4l2_camera.h
> index 30114ed..c157a80 100644
> --- a/src/v4l2/v4l2_camera.h
> +++ b/src/v4l2/v4l2_camera.h
> @@ -59,6 +59,8 @@ public:
>  
>  	Semaphore bufferSema_;
>  
> +	bool isRunning();
> +

We tend to put member functions before member objects.

>  private:
>  	void requestComplete(Request *request);
>  

I'd squash this with 09/17, but if you want to keep it separate,

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

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list