mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 07:19:45 +03:00
Remove the verbose #ifndef/#define/#endif pattern for maintaining header idempotency, and replace it with a simple #pragma once. This simplifies the headers, and prevents redundant changes when header files get moved. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
41 lines
827 B
C++
41 lines
827 B
C++
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
/*
|
|
* Copyright (C) 2019, Google Inc.
|
|
*
|
|
* framebuffer_allocator.h - FrameBuffer allocator
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <map>
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
#include <libcamera/base/class.h>
|
|
|
|
namespace libcamera {
|
|
|
|
class Camera;
|
|
class FrameBuffer;
|
|
class Stream;
|
|
|
|
class FrameBufferAllocator
|
|
{
|
|
public:
|
|
FrameBufferAllocator(std::shared_ptr<Camera> camera);
|
|
~FrameBufferAllocator();
|
|
|
|
int allocate(Stream *stream);
|
|
int free(Stream *stream);
|
|
|
|
bool allocated() const { return !buffers_.empty(); }
|
|
const std::vector<std::unique_ptr<FrameBuffer>> &buffers(Stream *stream) const;
|
|
|
|
private:
|
|
LIBCAMERA_DISABLE_COPY(FrameBufferAllocator)
|
|
|
|
std::shared_ptr<Camera> camera_;
|
|
std::map<Stream *, std::vector<std::unique_ptr<FrameBuffer>>> buffers_;
|
|
};
|
|
|
|
} /* namespace libcamera */
|