cam: Add BufferWriter helper

Add a simpler helper to allow the cam application to write raw captured
frames to disk.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Niklas Söderlund
2019-01-29 03:34:31 +01:00
committed by Laurent Pinchart
parent dbe7a28377
commit 46ca8eeca0
3 changed files with 89 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
/* 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);
private:
std::string pattern_;
};
#endif /* __LIBCAMERA_BUFFER_WRITER_H__ */