android: camera_buffer: Drop 'const' from buffer_handle_t

The buffer_handle_t type is defined as 'const native_handle_t*'.
Drop the 'const' specifier from the parameter of the CameraBuffer
class constructor and in the Android generic memory backend.

Also rename 'camera3buffer' in 'camera3Buffer' to comply with the
coding style guidelines.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Jacopo Mondi 2021-02-26 09:09:51 +01:00
parent 64c17f73a0
commit 99edf1ef42
2 changed files with 7 additions and 7 deletions

View file

@ -13,16 +13,16 @@ using namespace libcamera;
LOG_DECLARE_CATEGORY(HAL)
CameraBuffer::CameraBuffer(const buffer_handle_t camera3buffer, int flags)
CameraBuffer::CameraBuffer(buffer_handle_t camera3Buffer, int flags)
{
maps_.reserve(camera3buffer->numFds);
maps_.reserve(camera3Buffer->numFds);
error_ = 0;
for (int i = 0; i < camera3buffer->numFds; i++) {
if (camera3buffer->data[i] == -1)
for (int i = 0; i < camera3Buffer->numFds; i++) {
if (camera3Buffer->data[i] == -1)
continue;
off_t length = lseek(camera3buffer->data[i], 0, SEEK_END);
off_t length = lseek(camera3Buffer->data[i], 0, SEEK_END);
if (length < 0) {
error_ = -errno;
LOG(HAL, Error) << "Failed to query plane length";
@ -30,7 +30,7 @@ CameraBuffer::CameraBuffer(const buffer_handle_t camera3buffer, int flags)
}
void *address = mmap(nullptr, length, flags, MAP_SHARED,
camera3buffer->data[i], 0);
camera3Buffer->data[i], 0);
if (address == MAP_FAILED) {
error_ = -errno;
LOG(HAL, Error) << "Failed to mmap plane";