[libcamera-devel,v2,2/8] test: v4l2_device: capture_async: End test at 30 frames

Message ID 20190213151027.6376-3-kieran.bingham@ideasonboard.com
State Accepted
Headers show
Series
  • libcamera: v4l2_device buffer sharing
Related show

Commit Message

Kieran Bingham Feb. 13, 2019, 3:10 p.m. UTC
The capture_async test was written to run for a fixed 5 second duration.
Modify the test such that it runs until it has captured 30 frames, or a 10
second time out occurs.

Running the capture_async test on an ARM64 platform using VIVID captures 30
frames in 6.15 seconds.

There may be scope to optimise this speed by changing the format on the capture
device.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 test/v4l2_device/capture_async.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Laurent Pinchart Feb. 13, 2019, 3:40 p.m. UTC | #1
Hi Kieran,

Thank you for the patch.

On Wed, Feb 13, 2019 at 03:10:21PM +0000, Kieran Bingham wrote:
> The capture_async test was written to run for a fixed 5 second duration.
> Modify the test such that it runs until it has captured 30 frames, or a 10
> second time out occurs.
> 
> Running the capture_async test on an ARM64 platform using VIVID captures 30
> frames in 6.15 seconds.
> 
> There may be scope to optimise this speed by changing the format on the capture
> device.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

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

> ---
>  test/v4l2_device/capture_async.cpp | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/test/v4l2_device/capture_async.cpp b/test/v4l2_device/capture_async.cpp
> index 7a0735f65535..ba37c9731831 100644
> --- a/test/v4l2_device/capture_async.cpp
> +++ b/test/v4l2_device/capture_async.cpp
> @@ -56,9 +56,12 @@ protected:
>  		if (ret)
>  			return TestFail;
>  
> -		timeout.start(5000);
> -		while (timeout.isRunning())
> +		timeout.start(10000);
> +		while (timeout.isRunning()) {
>  			dispatcher->processEvents();
> +			if (frames > 30)
> +				break;
> +		}
>  
>  		if (frames < 1) {
>  			std::cout << "Failed to capture any frames within timeout." << std::endl;

Patch

diff --git a/test/v4l2_device/capture_async.cpp b/test/v4l2_device/capture_async.cpp
index 7a0735f65535..ba37c9731831 100644
--- a/test/v4l2_device/capture_async.cpp
+++ b/test/v4l2_device/capture_async.cpp
@@ -56,9 +56,12 @@  protected:
 		if (ret)
 			return TestFail;
 
-		timeout.start(5000);
-		while (timeout.isRunning())
+		timeout.start(10000);
+		while (timeout.isRunning()) {
 			dispatcher->processEvents();
+			if (frames > 30)
+				break;
+		}
 
 		if (frames < 1) {
 			std::cout << "Failed to capture any frames within timeout." << std::endl;