android: camera_device: Query plane length
Use lseek to query the length of planes where possible rather than leaving the plane.length as zero, which prevents mapping buffers for software processing. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
f4c65be7b3
commit
6bc652ee1c
1 changed files with 7 additions and 6 deletions
|
@ -1132,12 +1132,13 @@ FrameBuffer *CameraDevice::createFrameBuffer(const buffer_handle_t camera3buffer
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
/*
|
||||
* Setting length to zero here is OK as the length is only used
|
||||
* to map the memory of the plane. Libcamera do not need to poke
|
||||
* at the memory content queued by the HAL.
|
||||
*/
|
||||
plane.length = 0;
|
||||
off_t length = lseek(plane.fd.fd(), 0, SEEK_END);
|
||||
if (length == -1) {
|
||||
LOG(HAL, Error) << "Failed to query plane length";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
plane.length = length;
|
||||
planes.push_back(std::move(plane));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue