Files
external_libcamera/src/cam/buffer_writer.h
T
Laurent Pinchart 5082fe7b5b cam: Allow specifying directories in the --file option
The value of the --file option is the full name of the file to which
captured frames are written. To write files to a specific directory with
the default naming scheme, the "frame-#.bin" name has to appear at the
end of the file name. Simplify usage of the option by allowing --file to
specify a directory only. If the file name ends with a '/', the default
"frame-#.bin" file name is automatically appended.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:57 +03:00

32 lines
626 B
C++

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2019, Google Inc.
*
* buffer_writer.h - Buffer writer
*/
#ifndef __CAM_BUFFER_WRITER_H__
#define __CAM_BUFFER_WRITER_H__
#include <map>
#include <string>
#include <libcamera/framebuffer.h>
class BufferWriter
{
public:
BufferWriter(const std::string &pattern = "");
~BufferWriter();
void mapBuffer(libcamera::FrameBuffer *buffer);
int write(libcamera::FrameBuffer *buffer,
const std::string &streamName);
private:
std::string pattern_;
std::map<int, std::pair<void *, unsigned int>> mappedBuffers_;
};
#endif /* __CAM_BUFFER_WRITER_H__ */