libcamera v0.5.1
Supporting cameras in Linux since 2019
Loading...
Searching...
No Matches
framebuffer.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/*
3 * Copyright (C) 2020, Google Inc.
4 *
5 * Internal frame buffer handling
6 */
7
8#pragma once
9
10#include <memory>
11#include <stdint.h>
12#include <utility>
13
15
16#include <libcamera/fence.h>
18
19namespace libcamera {
20
22{
24
25public:
26 Private(const std::vector<Plane> &planes, uint64_t cookie = 0);
27 virtual ~Private();
28
29 void setRequest(Request *request) { request_ = request; }
30 bool isContiguous() const { return isContiguous_; }
31
32 Fence *fence() const { return fence_.get(); }
33 void setFence(std::unique_ptr<Fence> fence) { fence_ = std::move(fence); }
34
35 void cancel() { metadata_.status = FrameMetadata::FrameCancelled; }
36
37 FrameMetadata &metadata() { return metadata_; }
38
39private:
40 std::vector<Plane> planes_;
41 FrameMetadata metadata_;
42 uint64_t cookie_;
43
44 std::unique_ptr<Fence> fence_;
45 Request *request_;
46 bool isContiguous_;
47};
48
49} /* namespace libcamera */
Utilities to help constructing class interfaces.
#define LIBCAMERA_DECLARE_PUBLIC(klass)
Declare public data for a private class.
Definition class.h:57
Base class for private data managed through a d-pointer.
Definition class.h:65
Private()
Construct an instance of an Extensible class private data.
Definition class.cpp:194
Synchronization primitive to manage resources.
Definition fence.h:16
Base class for FrameBuffer private data.
Definition framebuffer.h:22
virtual ~Private()
FrameBuffer::Private destructor.
Definition framebuffer.cpp:136
Fence * fence() const
Retrieve a const pointer to the Fence.
Definition framebuffer.h:32
void cancel()
Marks the buffer as cancelled.
Definition framebuffer.h:35
bool isContiguous() const
Check if the frame buffer stores planes contiguously in memory.
Definition framebuffer.h:30
void setFence(std::unique_ptr< Fence > fence)
Move a fence in this buffer.
Definition framebuffer.h:33
void setRequest(Request *request)
Set the request this buffer belongs to.
Definition framebuffer.h:29
FrameMetadata & metadata()
Retrieve the dynamic metadata.
Definition framebuffer.h:37
Request * request() const
Retrieve the request this buffer belongs to.
Definition framebuffer.cpp:379
FrameBuffer(const std::vector< Plane > &planes, unsigned int cookie=0)
Construct a FrameBuffer with an array of planes.
Definition framebuffer.cpp:311
const std::vector< Plane > & planes() const
Retrieve the static plane descriptors.
Definition framebuffer.cpp:361
uint64_t cookie() const
Retrieve the cookie.
Definition framebuffer.cpp:403
A frame capture request.
Definition request.h:30
Definition of the Fence class.
Frame buffer handling.
Top-level libcamera namespace.
Definition backtrace.h:17
Metadata related to a captured frame.
Definition framebuffer.h:24
@ FrameCancelled
Definition framebuffer.h:28