From 689e8916caf11942286a1f1264e55dcb709d3939 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 12 Jul 2019 22:32:01 +0300 Subject: libcamera: buffer: Add an accessor to the BufferMemory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Buffer instances reference memory, which is modelled internally by a BufferMemory instance. Store a pointer to the BufferMemory in the Buffer class, and populate it when the buffer is queued to the camera through a request. This is useful for applications to access the buffer memory in the buffer or request completion handler. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/cam/capture.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/cam/capture.cpp') diff --git a/src/cam/capture.cpp b/src/cam/capture.cpp index 5ffa4ae2..df9602de 100644 --- a/src/cam/capture.cpp +++ b/src/cam/capture.cpp @@ -154,7 +154,6 @@ void Capture::requestComplete(Request *request, const std::mapfirst; Buffer *buffer = it->second; - BufferMemory *mem = &stream->buffers()[buffer->index()]; const std::string &name = streamName_[stream]; info << " " << name @@ -163,7 +162,7 @@ void Capture::requestComplete(Request *request, const std::mapbytesused(); if (writer_) - writer_->write(buffer, mem, name); + writer_->write(buffer, name); } std::cout << info.str() << std::endl; -- cgit v1.2.1