[libcamera-devel,1/2] test: v4l2_m2mdevice: Test control enumeration
diff mbox series

Message ID 20221003190706.19816-2-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • libcamera: v4l2_device: Fix control enumeration for M2M devices
Related show

Commit Message

Laurent Pinchart Oct. 3, 2022, 7:07 p.m. UTC
Verify that the V4L2M2MDevice correctly enumerates controls supported by
the device. The test currently fails, and will be fixed by a subsequent
patch.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 test/v4l2_videodevice/v4l2_m2mdevice.cpp | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Umang Jain Oct. 4, 2022, 6:53 a.m. UTC | #1
Hi Laurent,

Thank you for the patch

On 10/4/22 12:37 AM, Laurent Pinchart via libcamera-devel wrote:
> Verify that the V4L2M2MDevice correctly enumerates controls supported by
> the device. The test currently fails, and will be fixed by a subsequent
> patch.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
>   test/v4l2_videodevice/v4l2_m2mdevice.cpp | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/test/v4l2_videodevice/v4l2_m2mdevice.cpp b/test/v4l2_videodevice/v4l2_m2mdevice.cpp
> index 852b853fa81a..c45f581a8653 100644
> --- a/test/v4l2_videodevice/v4l2_m2mdevice.cpp
> +++ b/test/v4l2_videodevice/v4l2_m2mdevice.cpp
> @@ -95,6 +95,11 @@ protected:
>   		V4L2VideoDevice *capture = vim2m_->capture();
>   		V4L2VideoDevice *output = vim2m_->output();
>   
> +		if (capture->controls().empty() || output->controls().empty()) {
> +			cerr << "VIM2M device has no control" << endl;
> +			return TestFail;
> +		}
> +
>   		V4L2DeviceFormat format = {};
>   		if (capture->getFormat(&format)) {
>   			cerr << "Failed to get capture format" << endl;
Xavier Roumegue Oct. 4, 2022, 11:50 a.m. UTC | #2
Hi Laurent,

Thanks for testing this case.

On 10/3/22 21:07, Laurent Pinchart wrote:
> Verify that the V4L2M2MDevice correctly enumerates controls supported by
> the device. The test currently fails, and will be fixed by a subsequent
> patch.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>   test/v4l2_videodevice/v4l2_m2mdevice.cpp | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/test/v4l2_videodevice/v4l2_m2mdevice.cpp b/test/v4l2_videodevice/v4l2_m2mdevice.cpp
> index 852b853fa81a..c45f581a8653 100644
> --- a/test/v4l2_videodevice/v4l2_m2mdevice.cpp
> +++ b/test/v4l2_videodevice/v4l2_m2mdevice.cpp
> @@ -95,6 +95,11 @@ protected:
>   		V4L2VideoDevice *capture = vim2m_->capture();
>   		V4L2VideoDevice *output = vim2m_->output();
>   
> +		if (capture->controls().empty() || output->controls().empty()) {
> +			cerr << "VIM2M device has no control" << endl;
> +			return TestFail;
> +		}
> +
>   		V4L2DeviceFormat format = {};
>   		if (capture->getFormat(&format)) {
>   			cerr << "Failed to get capture format" << endl;

Reviewed-by: Xavier Roumegue <xavier.roumegue@oss.nxp.com>

Patch
diff mbox series

diff --git a/test/v4l2_videodevice/v4l2_m2mdevice.cpp b/test/v4l2_videodevice/v4l2_m2mdevice.cpp
index 852b853fa81a..c45f581a8653 100644
--- a/test/v4l2_videodevice/v4l2_m2mdevice.cpp
+++ b/test/v4l2_videodevice/v4l2_m2mdevice.cpp
@@ -95,6 +95,11 @@  protected:
 		V4L2VideoDevice *capture = vim2m_->capture();
 		V4L2VideoDevice *output = vim2m_->output();
 
+		if (capture->controls().empty() || output->controls().empty()) {
+			cerr << "VIM2M device has no control" << endl;
+			return TestFail;
+		}
+
 		V4L2DeviceFormat format = {};
 		if (capture->getFormat(&format)) {
 			cerr << "Failed to get capture format" << endl;