[libcamera-devel] libcamera: v4l2_device: Increase error level for unsupported devices

Message ID 20190503153707.8918-1-kieran.bingham@ideasonboard.com
State Accepted
Commit 05ff3d56e04a33756a679d24fe5542e9e50935b4
Headers show
Series
  • [libcamera-devel] libcamera: v4l2_device: Increase error level for unsupported devices
Related show

Commit Message

Kieran Bingham May 3, 2019, 3:37 p.m. UTC
If a component tries to open an unsupported device type, no error is presented
unless debug is enabled.

Report an error if an unsupported device type is opened to ease pipeline
development.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/libcamera/v4l2_device.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Laurent Pinchart May 3, 2019, 5:09 p.m. UTC | #1
Hi Kieran,

Thank you for the patch.

On Fri, May 03, 2019 at 04:37:07PM +0100, Kieran Bingham wrote:
> If a component tries to open an unsupported device type, no error is presented
> unless debug is enabled.
> 
> Report an error if an unsupported device type is opened to ease pipeline
> development.

I think there's little reason for a pipeline handler to try and open an
unsupported device type, so

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

But if anyone can think of a use case, please say so.

> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> ---
>  src/libcamera/v4l2_device.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp
> index e22323de19c3..8366ffc4db55 100644
> --- a/src/libcamera/v4l2_device.cpp
> +++ b/src/libcamera/v4l2_device.cpp
> @@ -349,7 +349,7 @@ int V4L2Device::open()
>  		fdEvent_ = new EventNotifier(fd_, EventNotifier::Read);
>  		bufferType_ = V4L2_BUF_TYPE_META_CAPTURE;
>  	} else {
> -		LOG(V4L2, Debug) << "Device is not a supported type";
> +		LOG(V4L2, Error) << "Device is not a supported type";
>  		return -EINVAL;
>  	}
>

Patch

diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp
index e22323de19c3..8366ffc4db55 100644
--- a/src/libcamera/v4l2_device.cpp
+++ b/src/libcamera/v4l2_device.cpp
@@ -349,7 +349,7 @@  int V4L2Device::open()
 		fdEvent_ = new EventNotifier(fd_, EventNotifier::Read);
 		bufferType_ = V4L2_BUF_TYPE_META_CAPTURE;
 	} else {
-		LOG(V4L2, Debug) << "Device is not a supported type";
+		LOG(V4L2, Error) << "Device is not a supported type";
 		return -EINVAL;
 	}