From 1261ff9e935d543764db4eb620d7747caea81a87 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Fri, 27 May 2022 18:34:37 +0900 Subject: android: camera_stream: Create allocator unconditionally 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 Reviewed-by: Umang Jain Reviewed-by: Laurent Pinchart --- src/android/camera_stream.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp index 154e088e..045e6006 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(cameraDevice_); - mutex_ = std::make_unique(); - } + allocator_ = std::make_unique(cameraDevice_); + mutex_ = std::make_unique(); camera3Stream_->max_buffers = configuration().bufferCount; -- cgit v1.2.1