summaryrefslogtreecommitdiff
path: root/include/libcamera/camera.h
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2019-10-27 22:10:25 +0100
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-01-12 16:10:37 +0100
commiteb4030f6c07174a520be1ebd73628e9ae4789569 (patch)
tree2c919e7216c3649d5339b2953f62e98da9dee2f7 /include/libcamera/camera.h
parente9e6135d97d0afd3191e59578a71d51db14d6ad4 (diff)
libcamera: allocator: Add FrameBufferAllocator to help applications allocate buffers
The FrameBuffer interface is based on the idea that all buffers are allocated externally to libcamera and are only used by it. This is meant to create a simpler API centered around usage of buffers, regardless of where they come from. Linux however lacks a centralized allocator at the moment, and not all users of libcamera are expected to use another device that could provide suitable buffers for the camera. This patch thus adds a helper class to allocate buffers internally in libcamera, in a way that matches the needs of the FrameBuffer-based API. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'include/libcamera/camera.h')
-rw-r--r--include/libcamera/camera.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h
index ef6a37bb..2fd5870b 100644
--- a/include/libcamera/camera.h
+++ b/include/libcamera/camera.h
@@ -20,6 +20,7 @@
namespace libcamera {
class Buffer;
+class FrameBufferAllocator;
class PipelineHandler;
class Request;
@@ -126,6 +127,10 @@ private:
bool disconnected_;
State state_;
+
+ /* Needed to update allocator_ and to read state_ and activeStreams_. */
+ friend class FrameBufferAllocator;
+ FrameBufferAllocator *allocator_;
};
} /* namespace libcamera */