2c72ca70e2
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
888 B
C++
41 lines
888 B
C++
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* Copyright (C) 2019, Google Inc.
|
|
*
|
|
* file_sink.h - File Sink
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <map>
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
#include <libcamera/stream.h>
|
|
|
|
#include "frame_sink.h"
|
|
|
|
class Image;
|
|
|
|
class FileSink : public FrameSink
|
|
{
|
|
public:
|
|
FileSink(const std::map<const libcamera::Stream *, std::string> &streamNames,
|
|
const std::string &pattern = "");
|
|
~FileSink();
|
|
|
|
int configure(const libcamera::CameraConfiguration &config) override;
|
|
|
|
void mapBuffer(libcamera::FrameBuffer *buffer) override;
|
|
|
|
bool processRequest(libcamera::Request *request) override;
|
|
|
|
private:
|
|
void writeBuffer(const libcamera::Stream *stream,
|
|
libcamera::FrameBuffer *buffer);
|
|
|
|
std::map<const libcamera::Stream *, std::string> streamNames_;
|
|
std::string pattern_;
|
|
std::map<libcamera::FrameBuffer *, std::unique_ptr<Image>> mappedBuffers_;
|
|
};
|