diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-03-23 01:25:20 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-03-24 10:34:02 +0200 |
commit | 275fd5bd33107a10b1e47a0d36d834b390831af0 (patch) | |
tree | 3fff6cc018c1cdc2068f6465cb422b755e2b0a60 /src/qcam/viewfinder.cpp | |
parent | 494da4467ddf091d457863cd363067979552d67e (diff) |
qcam: viewfinder: Add MappedBuffer to store memory mapping information
The new MappedBuffer structure replaces the std::pair<> used in the
mapped buffers map, and allows passing data to the ViewFinder::display()
function in a more structured way.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/qcam/viewfinder.cpp')
-rw-r--r-- | src/qcam/viewfinder.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qcam/viewfinder.cpp b/src/qcam/viewfinder.cpp index 066ac605..d00edc33 100644 --- a/src/qcam/viewfinder.cpp +++ b/src/qcam/viewfinder.cpp @@ -24,7 +24,8 @@ ViewFinder::~ViewFinder() delete image_; } -void ViewFinder::display(const unsigned char *raw, size_t size) +void ViewFinder::display(const libcamera::FrameBuffer *buffer, + MappedBuffer *map) { QMutexLocker locker(&mutex_); @@ -34,7 +35,8 @@ void ViewFinder::display(const unsigned char *raw, size_t size) * impacting performances. */ - converter_.convert(raw, size, image_); + converter_.convert(static_cast<unsigned char *>(map->memory), + buffer->metadata().planes[0].bytesused, image_); update(); } |