diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-09-06 00:41:54 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-09-07 19:18:44 +0300 |
commit | f8f6bc657d37e67c9f90762c8862a11e498925cc (patch) | |
tree | a8d4c570ded9f52c26b656f8bce2640ac086a7e5 /src/cam/file_sink.h | |
parent | 8926fe6d74a272b4a3e83f12a2fb244a53305906 (diff) |
cam: file_sink: Use Image class to access pixel data
Replace the manual implementation of frame buffer mapping with the Image
class to improve code sharing.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/cam/file_sink.h')
-rw-r--r-- | src/cam/file_sink.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cam/file_sink.h b/src/cam/file_sink.h index c12325d9..335be93b 100644 --- a/src/cam/file_sink.h +++ b/src/cam/file_sink.h @@ -8,12 +8,15 @@ #define __CAM_FILE_SINK_H__ #include <map> +#include <memory> #include <string> #include <libcamera/stream.h> #include "frame_sink.h" +class Image; + class FileSink : public FrameSink { public: @@ -32,8 +35,7 @@ private: std::map<const libcamera::Stream *, std::string> streamNames_; std::string pattern_; - std::map<int, std::pair<void *, unsigned int>> mappedBuffers_; - std::map<const libcamera::FrameBuffer::Plane *, uint8_t *> planeData_; + std::map<libcamera::FrameBuffer *, std::unique_ptr<Image>> mappedBuffers_; }; #endif /* __CAM_FILE_SINK_H__ */ |