libcamera: buffer: Add an accessor to the BufferMemory
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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
+1
-2
@@ -154,7 +154,6 @@ void Capture::requestComplete(Request *request, const std::map<Stream *, Buffer
|
||||
for (auto it = buffers.begin(); it != buffers.end(); ++it) {
|
||||
Stream *stream = it->first;
|
||||
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::map<Stream *, Buffer
|
||||
<< " bytesused: " << buffer->bytesused();
|
||||
|
||||
if (writer_)
|
||||
writer_->write(buffer, mem, name);
|
||||
writer_->write(buffer, name);
|
||||
}
|
||||
|
||||
std::cout << info.str() << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user