Loading...
Searching...
No Matches
framebuffer.h
Go to the documentation of this file.
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2020, Google Inc.
*
* Internal frame buffer handling
*/
#pragma once
#include <memory>
#include <stdint.h>
#include <utility>
#include <libcamera/base/class.h>
#include <libcamera/base/span.h>
#include <libcamera/fence.h>
#include <libcamera/framebuffer.h>
namespace libcamera {
class FrameBuffer::Private : public Extensible::Private
{
LIBCAMERA_DECLARE_PUBLIC(FrameBuffer)
public:
Private(Span<const Plane> planes, uint64_t cookie = 0);
virtual ~Private();
void setRequest(Request *request) { request_ = request; }
bool isContiguous() const { return isContiguous_; }
Fence *fence() const { return fence_.get(); }
void setFence(std::unique_ptr<Fence> fence) { fence_ = std::move(fence); }
void cancel() { metadata_.status = FrameMetadata::FrameCancelled; }
FrameMetadata &metadata() { return metadata_; }
private:
std::vector<Plane> planes_;
FrameMetadata metadata_;
uint64_t cookie_;
std::unique_ptr<Fence> fence_;
Request *request_;
bool isContiguous_;
};
} /* namespace libcamera */
class.h
Utilities to help constructing class interfaces.
LIBCAMERA_DECLARE_PUBLIC
#define LIBCAMERA_DECLARE_PUBLIC(klass)
Declare public data for a private class.
Definition class.h:57
libcamera::Extensible::Private
Base class for private data managed through a d-pointer.
Definition class.h:65
libcamera::Extensible::Private::Private
Private()
Construct an instance of an Extensible class private data.
Definition class.cpp:194
libcamera::Fence
Synchronization primitive to manage resources.
Definition fence.h:16
libcamera::FrameBuffer::Private
Base class for FrameBuffer private data.
Definition framebuffer.h:23
libcamera::FrameBuffer::Private::~Private
virtual ~Private()
FrameBuffer::Private destructor.
Definition framebuffer.cpp:143
libcamera::FrameBuffer::Private::fence
Fence * fence() const
Retrieve a const pointer to the Fence.
Definition framebuffer.h:33
libcamera::FrameBuffer::Private::cancel
void cancel()
Marks the buffer as cancelled.
Definition framebuffer.h:36
libcamera::FrameBuffer::Private::isContiguous
bool isContiguous() const
Check if the frame buffer stores planes contiguously in memory.
Definition framebuffer.h:31
libcamera::FrameBuffer::Private::setFence
void setFence(std::unique_ptr< Fence > fence)
Move a fence in this buffer.
Definition framebuffer.h:34
libcamera::FrameBuffer::Private::setRequest
void setRequest(Request *request)
Set the request this buffer belongs to.
Definition framebuffer.h:30
libcamera::FrameBuffer::Private::metadata
FrameMetadata & metadata()
Retrieve the dynamic metadata.
Definition framebuffer.h:38
libcamera::FrameBuffer::request
Request * request() const
Retrieve the request this buffer belongs to.
Definition framebuffer.cpp:386
libcamera::FrameBuffer::planes
Span< const Plane > planes() const
Retrieve the static plane descriptors.
Definition framebuffer.cpp:368
libcamera::FrameBuffer::FrameBuffer
FrameBuffer(Span< const Plane > planes, unsigned int cookie=0)
Construct a FrameBuffer with an array of planes.
Definition framebuffer.cpp:318
libcamera::FrameBuffer::cookie
uint64_t cookie() const
Retrieve the cookie.
Definition framebuffer.cpp:410
libcamera::Request
A frame capture request.
Definition request.h:30
fence.h
Definition of the Fence class.
framebuffer.h
Frame buffer handling.
libcamera
Top-level libcamera namespace.
Definition backtrace.h:17
libcamera::FrameMetadata
Metadata related to a captured frame.
Definition framebuffer.h:24
libcamera::FrameMetadata::FrameCancelled
@ FrameCancelled
Definition framebuffer.h:28