libcamera: buffer: Rename buffer.h to framebuffer.h
libcamera names header files based on the classes they define. The buffer.h file is an exception. Rename it to framebuffer.h. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
da9b6bb196
commit
6a31a8d8e2
44 changed files with 62 additions and 62 deletions
74
include/libcamera/framebuffer.h
Normal file
74
include/libcamera/framebuffer.h
Normal file
|
@ -0,0 +1,74 @@
|
|||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
/*
|
||||
* Copyright (C) 2019, Google Inc.
|
||||
*
|
||||
* framebuffer.h - Frame buffer handling
|
||||
*/
|
||||
#ifndef __LIBCAMERA_FRAMEBUFFER_H__
|
||||
#define __LIBCAMERA_FRAMEBUFFER_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include <vector>
|
||||
|
||||
#include <libcamera/base/class.h>
|
||||
|
||||
#include <libcamera/file_descriptor.h>
|
||||
|
||||
namespace libcamera {
|
||||
|
||||
class Request;
|
||||
|
||||
struct FrameMetadata {
|
||||
enum Status {
|
||||
FrameSuccess,
|
||||
FrameError,
|
||||
FrameCancelled,
|
||||
};
|
||||
|
||||
struct Plane {
|
||||
unsigned int bytesused;
|
||||
};
|
||||
|
||||
Status status;
|
||||
unsigned int sequence;
|
||||
uint64_t timestamp;
|
||||
std::vector<Plane> planes;
|
||||
};
|
||||
|
||||
class FrameBuffer final
|
||||
{
|
||||
public:
|
||||
struct Plane {
|
||||
FileDescriptor fd;
|
||||
unsigned int length;
|
||||
};
|
||||
|
||||
FrameBuffer(const std::vector<Plane> &planes, unsigned int cookie = 0);
|
||||
|
||||
const std::vector<Plane> &planes() const { return planes_; }
|
||||
|
||||
Request *request() const { return request_; }
|
||||
void setRequest(Request *request) { request_ = request; }
|
||||
const FrameMetadata &metadata() const { return metadata_; }
|
||||
|
||||
unsigned int cookie() const { return cookie_; }
|
||||
void setCookie(unsigned int cookie) { cookie_ = cookie; }
|
||||
|
||||
void cancel() { metadata_.status = FrameMetadata::FrameCancelled; }
|
||||
|
||||
private:
|
||||
LIBCAMERA_DISABLE_COPY_AND_MOVE(FrameBuffer)
|
||||
|
||||
friend class V4L2VideoDevice; /* Needed to update metadata_. */
|
||||
|
||||
std::vector<Plane> planes_;
|
||||
|
||||
Request *request_;
|
||||
FrameMetadata metadata_;
|
||||
|
||||
unsigned int cookie_;
|
||||
};
|
||||
|
||||
} /* namespace libcamera */
|
||||
|
||||
#endif /* __LIBCAMERA_FRAMEBUFFER_H__ */
|
Loading…
Add table
Add a link
Reference in a new issue