[libcamera-devel] libcamera: v4l2_device: streamOff() when releaseing buffers

Message ID 20190213131130.27388-1-kieran.bingham@ideasonboard.com
State Superseded
Headers show
Series
  • [libcamera-devel] libcamera: v4l2_device: streamOff() when releaseing buffers
Related show

Commit Message

Kieran Bingham Feb. 13, 2019, 1:11 p.m. UTC
We must ensure that the stream is disabled before releasing buffers. It will
not hurt to call streamOff() even if it is already off before releasing any
buffers back to the device.

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

Comments

Kieran Bingham Feb. 13, 2019, 3:13 p.m. UTC | #1
The title spells releasing incorrectly.

A v2 is included in my buffer_sharing series just posted.
--
Kieran


On 13/02/2019 13:11, Kieran Bingham wrote:
> We must ensure that the stream is disabled before releasing buffers. It will
> not hurt to call streamOff() even if it is already off before releasing any
> buffers back to the device.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> ---
>  src/libcamera/v4l2_device.cpp | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp
> index afcdc1ea0161..5c5e95c9c9da 100644
> --- a/src/libcamera/v4l2_device.cpp
> +++ b/src/libcamera/v4l2_device.cpp
> @@ -673,6 +673,8 @@ int V4L2Device::releaseBuffers()
>  {
>  	LOG(V4L2, Debug) << "Releasing bufferPool";
>  
> +	streamOff();
> +
>  	requestBuffers(0);
>  	bufferPool_ = nullptr;
>  
>

Patch

diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp
index afcdc1ea0161..5c5e95c9c9da 100644
--- a/src/libcamera/v4l2_device.cpp
+++ b/src/libcamera/v4l2_device.cpp
@@ -673,6 +673,8 @@  int V4L2Device::releaseBuffers()
 {
 	LOG(V4L2, Debug) << "Releasing bufferPool";
 
+	streamOff();
+
 	requestBuffers(0);
 	bufferPool_ = nullptr;