[libcamera-devel] [PATCH v2 1/8] test: v4l2_device: Use VIVID capture stream

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed Feb 13 16:39:34 CET 2019


Hi Kieran,

Thank you for the patch.

On Wed, Feb 13, 2019 at 03:10:20PM +0000, Kieran Bingham wrote:
> Utilise the VIVID capture device for testing the V4L2Device objects.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

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

> ---
>  test/v4l2_device/v4l2_device_test.cpp | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/test/v4l2_device/v4l2_device_test.cpp b/test/v4l2_device/v4l2_device_test.cpp
> index 18d014caf4c8..a2a7ba82612d 100644
> --- a/test/v4l2_device/v4l2_device_test.cpp
> +++ b/test/v4l2_device/v4l2_device_test.cpp
> @@ -39,22 +39,22 @@ int V4L2DeviceTest::init()
>  		return TestFail;
>  	}
>  
> -	DeviceMatch dm("uvcvideo");
> -	media_ = std::move(enumerator_->search(dm));
> +	DeviceMatch dm("vivid");
> +	dm.add("vivid-000-vid-cap");
> +
> +	media_ = enumerator_->search(dm);
>  	if (!media_)
>  		return TestSkip;
>  
>  	media_->acquire();
>  
> -	for (MediaEntity *entity : media_->entities()) {
> -		if (entity->flags() & MEDIA_ENT_FL_DEFAULT) {
> -			dev_ = new V4L2Device(entity);
> -			break;
> -		}
> -	}
> +	MediaEntity *entity = media_->getEntityByName("vivid-000-vid-cap");
> +	if (!entity)
> +		return TestSkip;
>  
> +	dev_ = new V4L2Device(entity);
>  	if (!dev_)
> -		return TestSkip;
> +		return TestFail;
>  
>  	return dev_->open();
>  }

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list