[libcamera-devel] [PATCH v4 2/9] android: camera_device: Add frame allocator
Jacopo Mondi
jacopo at jmondi.org
Wed Sep 30 15:27:00 CEST 2020
Add a FrameBufferAllocator to the CameraDevice class to handle any
allocations required to satisfy internal stream requirements.
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
Reviewed-by: Hirokazu Honda <hiroh at chromium.org>
Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
src/android/camera_device.cpp | 4 ++--
src/android/camera_device.h | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index e4ffbc02c2da..d8587647f831 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -211,8 +211,8 @@ CameraDevice::Camera3RequestDescriptor::~Camera3RequestDescriptor()
*/
CameraDevice::CameraDevice(unsigned int id, const std::shared_ptr<Camera> &camera)
- : id_(id), running_(false), camera_(camera), staticMetadata_(nullptr),
- facing_(CAMERA_FACING_FRONT), orientation_(0)
+ : id_(id), running_(false), camera_(camera), allocator_(camera),
+ staticMetadata_(nullptr), facing_(CAMERA_FACING_FRONT), orientation_(0)
{
camera_->requestCompleted.connect(this, &CameraDevice::requestComplete);
diff --git a/src/android/camera_device.h b/src/android/camera_device.h
index 17de963f5fc4..75e3305089d9 100644
--- a/src/android/camera_device.h
+++ b/src/android/camera_device.h
@@ -16,6 +16,7 @@
#include <libcamera/buffer.h>
#include <libcamera/camera.h>
+#include <libcamera/framebuffer_allocator.h>
#include <libcamera/geometry.h>
#include <libcamera/request.h>
#include <libcamera/stream.h>
@@ -206,6 +207,7 @@ private:
bool running_;
std::shared_ptr<libcamera::Camera> camera_;
std::unique_ptr<libcamera::CameraConfiguration> config_;
+ libcamera::FrameBufferAllocator allocator_;
CameraMetadata *staticMetadata_;
std::map<unsigned int, const CameraMetadata *> requestTemplates_;
--
2.28.0
More information about the libcamera-devel
mailing list