Files
external_libcamera/include/libcamera/internal/framebuffer.h
Jacopo Mondi 7a34707bfd libcamera: framebuffer: Add Fence to FrameBuffer
Add to the FrameBuffer::Private class a unique pointer to a
Fence.

The Fence will be used to signal the availability of the Framebuffer for
incoming data transfer.

The Fence will be associated to a FrameBuffer at Request::addBuffer()
time, and if correctly signalled, reset by the core at Request queue
time.

If a FrameBuffer completes with errors, due to a Fence wait failure, the
Fence will still be owned by the FrameBuffer and it is application
responsibility to correctly reset it before reusing the buffer.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-12-11 17:53:40 +01:00

41 lines
811 B
C++

/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2020, Google Inc.
*
* framebuffer.h - Internal frame buffer handling
*/
#pragma once
#include <memory>
#include <utility>
#include <libcamera/base/class.h>
#include <libcamera/fence.h>
#include <libcamera/framebuffer.h>
namespace libcamera {
class FrameBuffer::Private : public Extensible::Private
{
LIBCAMERA_DECLARE_PUBLIC(FrameBuffer)
public:
Private();
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); }
private:
std::unique_ptr<Fence> fence_;
Request *request_;
bool isContiguous_;
};
} /* namespace libcamera */