Files
external_libcamera/src/cam/buffer_writer.h
Niklas Söderlund 47a9f357fe cam: Extend BufferWriter to include a stream name in file path
To be able to write multiple buffers captured in the same request (and
hence having the same sequence number) the buffer writer needs to name
each file uniquely. Add a stream name to the writer function which the
buffer writer can add to the part of the pattern it already expands to
the sequence number. As cam only supports one stream, hard code the name
to stream0.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-04-09 16:59:19 +02:00

26 lines
494 B
C++

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2019, Google Inc.
*
* buffer_writer.h - Buffer writer
*/
#ifndef __LIBCAMERA_BUFFER_WRITER_H__
#define __LIBCAMERA_BUFFER_WRITER_H__
#include <string>
#include <libcamera/buffer.h>
class BufferWriter
{
public:
BufferWriter(const std::string &pattern = "frame-#.bin");
int write(libcamera::Buffer *buffer, const std::string &streamName);
private:
std::string pattern_;
};
#endif /* __LIBCAMERA_BUFFER_WRITER_H__ */