mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 07:19:45 +03:00
Add a new status enum, FrameStartup, used to denote that even though the frame has been successfully captured, the IQ parameters set by the IPA will cause the frame to be unusable and applications are advised to not consume this frame. An example of this would be on a cold-start of the 3A algorithms, and there will be large oscillations to converge to a stable state quickly. Additional, update the definition of the FrameError state to cover the usage when the sensor is known to produce a number of invalid/error frames after stream-on. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
78 lines
1.4 KiB
C++
78 lines
1.4 KiB
C++
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
/*
|
|
* Copyright (C) 2019, Google Inc.
|
|
*
|
|
* Frame buffer handling
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <limits>
|
|
#include <memory>
|
|
#include <stdint.h>
|
|
#include <vector>
|
|
|
|
#include <libcamera/base/class.h>
|
|
#include <libcamera/base/shared_fd.h>
|
|
#include <libcamera/base/span.h>
|
|
|
|
namespace libcamera {
|
|
|
|
class Fence;
|
|
class Request;
|
|
|
|
struct FrameMetadata {
|
|
enum Status {
|
|
FrameSuccess,
|
|
FrameError,
|
|
FrameCancelled,
|
|
FrameStartup,
|
|
};
|
|
|
|
struct Plane {
|
|
unsigned int bytesused;
|
|
};
|
|
|
|
Status status;
|
|
unsigned int sequence;
|
|
uint64_t timestamp;
|
|
|
|
Span<Plane> planes() { return planes_; }
|
|
Span<const Plane> planes() const { return planes_; }
|
|
|
|
private:
|
|
friend class FrameBuffer;
|
|
|
|
std::vector<Plane> planes_;
|
|
};
|
|
|
|
class FrameBuffer : public Extensible
|
|
{
|
|
LIBCAMERA_DECLARE_PRIVATE()
|
|
|
|
public:
|
|
struct Plane {
|
|
static constexpr unsigned int kInvalidOffset = std::numeric_limits<unsigned int>::max();
|
|
SharedFD fd;
|
|
unsigned int offset = kInvalidOffset;
|
|
unsigned int length;
|
|
};
|
|
|
|
FrameBuffer(const std::vector<Plane> &planes, unsigned int cookie = 0);
|
|
FrameBuffer(std::unique_ptr<Private> d);
|
|
virtual ~FrameBuffer() {}
|
|
|
|
const std::vector<Plane> &planes() const;
|
|
Request *request() const;
|
|
const FrameMetadata &metadata() const;
|
|
|
|
uint64_t cookie() const;
|
|
void setCookie(uint64_t cookie);
|
|
|
|
std::unique_ptr<Fence> releaseFence();
|
|
|
|
private:
|
|
LIBCAMERA_DISABLE_COPY_AND_MOVE(FrameBuffer)
|
|
};
|
|
|
|
} /* namespace libcamera */
|