[libcamera-devel] [PATCH 2/8] android: camera_device: Add frame allocator
Jacopo Mondi
jacopo at jmondi.org
Wed Sep 9 17:54:51 CEST 2020
Add to the CameraDevice class a FrameBufferAllocator class member.
Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
src/android/camera_device.cpp | 5 +++--
src/android/camera_device.h | 2 ++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 3c58523e528e..98cfa3d5aa59 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -14,6 +14,7 @@
#include <libcamera/controls.h>
#include <libcamera/formats.h>
+#include <libcamera/framebuffer_allocator.h>
#include <libcamera/property_ids.h>
#include "libcamera/internal/formats.h"
@@ -210,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 9dea7c42bdb5..0e912030d7f2 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