summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2022-05-27 18:34:37 +0900
committerJacopo Mondi <jacopo@jmondi.org>2022-06-10 11:48:09 +0200
commit1261ff9e935d543764db4eb620d7747caea81a87 (patch)
treef7e73e46564a4dbe0cadf16b414864089c54b004 /src
parentfec64fb75ac1e64e4bf6af7885170a51c637cd45 (diff)
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 <jacopo@jmondi.org> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/android/camera_stream.cpp6
1 files changed, 2 insertions, 4 deletions
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<PlatformFrameBufferAllocator>(cameraDevice_);
- mutex_ = std::make_unique<Mutex>();
- }
+ allocator_ = std::make_unique<PlatformFrameBufferAllocator>(cameraDevice_);
+ mutex_ = std::make_unique<Mutex>();
camera3Stream_->max_buffers = configuration().bufferCount;