/* SPDX-License-Identifier: LGPL-2.1-or-later */ /* * Copyright (C) 2019, Google Inc. * * framebuffer.h - Frame buffer handling */ #pragma once #include #include #include #include #include #include #include #include namespace libcamera { class Fence; class Request; struct FrameMetadata { enum Status { FrameSuccess, FrameError, FrameCancelled, }; struct Plane { unsigned int bytesused; }; Status status; unsigned int sequence; uint64_t timestamp; Span planes() { return planes_; } Span planes() const { return planes_; } private: friend class FrameBuffer; std::vector planes_; }; class FrameBuffer : public Extensible { LIBCAMERA_DECLARE_PRIVATE() public: struct Plane { static constexpr unsigned int kInvalidOffset = std::numeric_limits::max(); SharedFD fd; unsigned int offset = kInvalidOffset; unsigned int length; }; FrameBuffer(const std::vector &planes, unsigned int cookie = 0); FrameBuffer(std::unique_ptr d); virtual ~FrameBuffer() {} const std::vector &planes() const; Request *request() const; const FrameMetadata &metadata() const; uint64_t cookie() const; void setCookie(uint64_t cookie); std::unique_ptr releaseFence(); private: LIBCAMERA_DISABLE_COPY_AND_MOVE(FrameBuffer) }; } /* namespace libcamera */