[libcamera-devel,v3,2/3] test: v4l2_device: release capture device resources

Message ID 20190213171453.13852-3-kieran.bingham@ideasonboard.com
State Accepted
Headers show
Series
  • libcamera: test: buffer_sharing
Related show

Commit Message

Kieran Bingham Feb. 13, 2019, 5:14 p.m. UTC
Ensure that the cleanup operation releases the device and resources.

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

Comments

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

Thank you for the patch.

On Wed, Feb 13, 2019 at 05:14:52PM +0000, Kieran Bingham wrote:
> Ensure that the cleanup operation releases the device and resources.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

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

> ---
>  test/v4l2_device/v4l2_device_test.cpp | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/test/v4l2_device/v4l2_device_test.cpp b/test/v4l2_device/v4l2_device_test.cpp
> index 2bdf8cfe983a..4225291bbb6e 100644
> --- a/test/v4l2_device/v4l2_device_test.cpp
> +++ b/test/v4l2_device/v4l2_device_test.cpp
> @@ -63,5 +63,9 @@ void V4L2DeviceTest::cleanup()
>  {
>  	media_->release();
>  
> +	capture_->streamOff();
> +	capture_->releaseBuffers();
> +	capture_->close();
> +
>  	delete capture_;
>  };

Patch

diff --git a/test/v4l2_device/v4l2_device_test.cpp b/test/v4l2_device/v4l2_device_test.cpp
index 2bdf8cfe983a..4225291bbb6e 100644
--- a/test/v4l2_device/v4l2_device_test.cpp
+++ b/test/v4l2_device/v4l2_device_test.cpp
@@ -63,5 +63,9 @@  void V4L2DeviceTest::cleanup()
 {
 	media_->release();
 
+	capture_->streamOff();
+	capture_->releaseBuffers();
+	capture_->close();
+
 	delete capture_;
 };