libcamera  v0.2.0+150-2031e2f2
Supporting cameras in Linux since 2019
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 <utility>
12 
13 #include <libcamera/base/class.h>
14 
15 #include <libcamera/fence.h>
16 #include <libcamera/framebuffer.h>
17 
18 namespace libcamera {
19 
21 {
23 
24 public:
25  Private(const std::vector<Plane> &planes, uint64_t cookie = 0);
26  virtual ~Private();
27 
28  void setRequest(Request *request) { request_ = request; }
29  bool isContiguous() const { return isContiguous_; }
30 
31  Fence *fence() const { return fence_.get(); }
32  void setFence(std::unique_ptr<Fence> fence) { fence_ = std::move(fence); }
33 
35 
36  FrameMetadata &metadata() { return metadata_; }
37 
38 private:
39  std::vector<Plane> planes_;
40  FrameMetadata metadata_;
41  uint64_t cookie_;
42 
43  std::unique_ptr<Fence> fence_;
44  Request *request_;
45  bool isContiguous_;
46 };
47 
48 } /* namespace libcamera */
Frame buffer handling.
Base class for private data managed through a d-pointer.
Definition: class.h:64
Utilities to help constructing class interfaces.
Synchronization primitive to manage resources.
Definition: fence.h:15
Status status
Status of the frame.
Definition: framebuffer.h:36
FrameMetadata & metadata()
Retrieve the dynamic metadata.
Definition: framebuffer.h:36
void cancel()
Marks the buffer as cancelled.
Definition: framebuffer.h:34
Top-level libcamera namespace.
Definition: backtrace.h:17
Frame buffer data and its associated dynamic metadata.
Definition: framebuffer.h:49
#define LIBCAMERA_DECLARE_PUBLIC(klass)
Declare public data for a private class.
Metadata related to a captured frame.
Definition: framebuffer.h:25
Private()
Construct an instance of an Extensible class private data.
Definition: class.cpp:194
A frame capture request.
Definition: request.h:30
Base class for FrameBuffer private data.
Definition: framebuffer.h:20
Fence * fence() const
Retrieve a const pointer to the Fence.
Definition: framebuffer.h:31
Request * request() const
Retrieve the request this buffer belongs to.
Definition: framebuffer.cpp:374
const std::vector< Plane > & planes() const
Retrieve the static plane descriptors.
Definition: framebuffer.cpp:356
Definition: framebuffer.h:29
virtual ~Private()
FrameBuffer::Private destructor.
Definition: framebuffer.cpp:132
bool isContiguous() const
Check if the frame buffer stores planes contiguously in memory.
Definition: framebuffer.h:29
Definition of the Fence class.
void setFence(std::unique_ptr< Fence > fence)
Move a fence in this buffer.
Definition: framebuffer.h:32
uint64_t cookie() const
Retrieve the cookie.
Definition: framebuffer.cpp:398
void setRequest(Request *request)
Set the request this buffer belongs to.
Definition: framebuffer.h:28