[libcamera-devel,v3,2/2] libcamera: ipu3: cio2: Use Size::isNull()

Message ID 20200628190920.3206340-3-niklas.soderlund@ragnatech.se
State Accepted
Commit 6bc4af7d0b6b203cc98ad617bf0a39e11eec8a2b
Headers show
Series
  • libcamera: geometry: Add isNull() function to Size class
Related show

Commit Message

Niklas Söderlund June 28, 2020, 7:09 p.m. UTC
Use the Size::isNull() helper instead of using local code.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
---
 src/libcamera/pipeline/ipu3/cio2.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Laurent Pinchart June 28, 2020, 7:11 p.m. UTC | #1
Hi Niklas,

Thank you for the patch.

On Sun, Jun 28, 2020 at 09:09:20PM +0200, Niklas Söderlund wrote:
> Use the Size::isNull() helper instead of using local code.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

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

> ---
>  src/libcamera/pipeline/ipu3/cio2.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp
> index 885e2ca0d9677364..aa1459fb3599283b 100644
> --- a/src/libcamera/pipeline/ipu3/cio2.cpp
> +++ b/src/libcamera/pipeline/ipu3/cio2.cpp
> @@ -185,7 +185,7 @@ CIO2Device::generateConfiguration(Size size) const
>  	StreamConfiguration cfg;
>  
>  	/* If no desired size use the sensor resolution. */
> -	if (!size.width && !size.height)
> +	if (size.isNull())
>  		size = sensor_->resolution();
>  
>  	/* Query the sensor static information for closest match. */
Jacopo Mondi June 29, 2020, 7:34 a.m. UTC | #2
Hi Niklas,

On Sun, Jun 28, 2020 at 09:09:20PM +0200, Niklas Söderlund wrote:
> Use the Size::isNull() helper instead of using local code.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>

Thanks
  j
> ---
>  src/libcamera/pipeline/ipu3/cio2.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp
> index 885e2ca0d9677364..aa1459fb3599283b 100644
> --- a/src/libcamera/pipeline/ipu3/cio2.cpp
> +++ b/src/libcamera/pipeline/ipu3/cio2.cpp
> @@ -185,7 +185,7 @@ CIO2Device::generateConfiguration(Size size) const
>  	StreamConfiguration cfg;
>
>  	/* If no desired size use the sensor resolution. */
> -	if (!size.width && !size.height)
> +	if (size.isNull())
>  		size = sensor_->resolution();
>
>  	/* Query the sensor static information for closest match. */
> --
> 2.27.0
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

Patch

diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp
index 885e2ca0d9677364..aa1459fb3599283b 100644
--- a/src/libcamera/pipeline/ipu3/cio2.cpp
+++ b/src/libcamera/pipeline/ipu3/cio2.cpp
@@ -185,7 +185,7 @@  CIO2Device::generateConfiguration(Size size) const
 	StreamConfiguration cfg;
 
 	/* If no desired size use the sensor resolution. */
-	if (!size.width && !size.height)
+	if (size.isNull())
 		size = sensor_->resolution();
 
 	/* Query the sensor static information for closest match. */