[libcamera-devel,v4,07/11] libcamera: v4l2_videodevice: Downgrade 4CC conversion errors to warnings

Message ID 20200404004438.17992-8-laurent.pinchart@ideasonboard.com
State Superseded
Headers show
Series
  • Simple pipeline handler
Related show

Commit Message

Laurent Pinchart April 4, 2020, 12:44 a.m. UTC
Failing to convert between V4L2 and DRM 4CCs indicates something is
likely wrong, but doesn't necessarily prevent the camera from being
usable. It may for instance only limit the number of supported formats.
Downgrade the related log messages from LogError to LogWarning.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/libcamera/v4l2_videodevice.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Niklas Söderlund April 7, 2020, 11:39 p.m. UTC | #1
Hi Laurent,

Thanks for your patch.

On 2020-04-04 03:44:34 +0300, Laurent Pinchart wrote:
> Failing to convert between V4L2 and DRM 4CCs indicates something is
> likely wrong, but doesn't necessarily prevent the camera from being
> usable. It may for instance only limit the number of supported formats.
> Downgrade the related log messages from LogError to LogWarning.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

> ---
>  src/libcamera/v4l2_videodevice.cpp | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
> index 42b6c1ed1ef8..5208e5a47148 100644
> --- a/src/libcamera/v4l2_videodevice.cpp
> +++ b/src/libcamera/v4l2_videodevice.cpp
> @@ -1711,7 +1711,7 @@ PixelFormat V4L2VideoDevice::toPixelFormat(V4L2PixelFormat v4l2Fourcc)
>  		 * class. Until we fix the logger, work around it.
>  		 */
>  		libcamera::_log(__FILE__, __LINE__, _LOG_CATEGORY(V4L2)(),
> -				LogError).stream()
> +				LogWarning).stream()
>  			<< "Unsupported V4L2 pixel format "
>  			<< v4l2Fourcc.toString();
>  		return PixelFormat();
> @@ -1799,7 +1799,8 @@ V4L2PixelFormat V4L2VideoDevice::toV4L2PixelFormat(const PixelFormat &pixelForma
>  	 * \todo We can't use LOG() in a static method of a Loggable
>  	 * class. Until we fix the logger, work around it.
>  	 */
> -	libcamera::_log(__FILE__, __LINE__, _LOG_CATEGORY(V4L2)(), LogError).stream()
> +	libcamera::_log(__FILE__, __LINE__, _LOG_CATEGORY(V4L2)(),
> +			LogWarning).stream()
>  		<< "Unsupported V4L2 pixel format " << pixelFormat.toString();
>  	return {};
>  }
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

Patch

diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
index 42b6c1ed1ef8..5208e5a47148 100644
--- a/src/libcamera/v4l2_videodevice.cpp
+++ b/src/libcamera/v4l2_videodevice.cpp
@@ -1711,7 +1711,7 @@  PixelFormat V4L2VideoDevice::toPixelFormat(V4L2PixelFormat v4l2Fourcc)
 		 * class. Until we fix the logger, work around it.
 		 */
 		libcamera::_log(__FILE__, __LINE__, _LOG_CATEGORY(V4L2)(),
-				LogError).stream()
+				LogWarning).stream()
 			<< "Unsupported V4L2 pixel format "
 			<< v4l2Fourcc.toString();
 		return PixelFormat();
@@ -1799,7 +1799,8 @@  V4L2PixelFormat V4L2VideoDevice::toV4L2PixelFormat(const PixelFormat &pixelForma
 	 * \todo We can't use LOG() in a static method of a Loggable
 	 * class. Until we fix the logger, work around it.
 	 */
-	libcamera::_log(__FILE__, __LINE__, _LOG_CATEGORY(V4L2)(), LogError).stream()
+	libcamera::_log(__FILE__, __LINE__, _LOG_CATEGORY(V4L2)(),
+			LogWarning).stream()
 		<< "Unsupported V4L2 pixel format " << pixelFormat.toString();
 	return {};
 }