[libcamera-devel,v3,2/5] android: camera_stream: Create allocator unconditionally
diff mbox series

Message ID 20220604093025.77737-3-jacopo@jmondi.org
State Accepted
Headers show
Series
  • Plumb the YUV processor in
Related show

Commit Message

Jacopo Mondi June 4, 2022, 9:30 a.m. UTC
Originally buffer allocation was only required for Internal streams
which are not backed by a frame buffer provided by the Android
framework.

Now that mapped streams can be generated without the corresponding
source stream being part of the Android's provided stream list, also
buffers of type Mapped can be required to allocate buffers on demand.

Create CameraStream::allocator_ and the associated mutex unconditionally
for all types of stream.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/android/camera_stream.cpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Patch
diff mbox series

diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp
index 154e088e1b86..045e60061a20 100644
--- a/src/android/camera_stream.cpp
+++ b/src/android/camera_stream.cpp
@@ -128,10 +128,8 @@  int CameraStream::configure()
 		worker_->start();
 	}
 
-	if (type_ == Type::Internal) {
-		allocator_ = std::make_unique<PlatformFrameBufferAllocator>(cameraDevice_);
-		mutex_ = std::make_unique<Mutex>();
-	}
+	allocator_ = std::make_unique<PlatformFrameBufferAllocator>(cameraDevice_);
+	mutex_ = std::make_unique<Mutex>();
 
 	camera3Stream_->max_buffers = configuration().bufferCount;