summaryrefslogtreecommitdiff
path: root/src/cam/buffer_writer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cam/buffer_writer.h')
-rw-r--r--src/cam/buffer_writer.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/cam/buffer_writer.h b/src/cam/buffer_writer.h
index 7626de42..32bb6ed5 100644
--- a/src/cam/buffer_writer.h
+++ b/src/cam/buffer_writer.h
@@ -10,20 +10,27 @@
#include <map>
#include <string>
-#include <libcamera/framebuffer.h>
+#include <libcamera/stream.h>
-class BufferWriter
+#include "frame_sink.h"
+
+class BufferWriter : public FrameSink
{
public:
BufferWriter(const std::string &pattern = "");
~BufferWriter();
- void mapBuffer(libcamera::FrameBuffer *buffer);
+ int configure(const libcamera::CameraConfiguration &config) override;
+
+ void mapBuffer(libcamera::FrameBuffer *buffer) override;
- int write(libcamera::FrameBuffer *buffer,
- const std::string &streamName);
+ 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<int, std::pair<void *, unsigned int>> mappedBuffers_;
};