summaryrefslogtreecommitdiff
path: root/src/android
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2021-02-26 09:09:51 +0100
committerJacopo Mondi <jacopo@jmondi.org>2021-03-03 09:50:13 +0100
commit99edf1ef421626a67ff5c3d5df2880d3cd6cfa9d (patch)
treeb1be8c692f66c13be66a046fabcfcfa68f76cbdf /src/android
parent64c17f73a08fd121c233e655d6ded9790c03dda5 (diff)
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>
Diffstat (limited to 'src/android')
-rw-r--r--src/android/camera_buffer.h2
-rw-r--r--src/android/mm/generic_camera_buffer.cpp12
2 files changed, 7 insertions, 7 deletions
diff --git a/src/android/camera_buffer.h b/src/android/camera_buffer.h
index 00b06150..0590cd84 100644
--- a/src/android/camera_buffer.h
+++ b/src/android/camera_buffer.h
@@ -14,7 +14,7 @@
class CameraBuffer : public libcamera::MappedBuffer
{
public:
- CameraBuffer(const buffer_handle_t camera3buffer, int flags);
+ CameraBuffer(buffer_handle_t camera3Buffer, int flags);
~CameraBuffer();
};
diff --git a/src/android/mm/generic_camera_buffer.cpp b/src/android/mm/generic_camera_buffer.cpp
index bd9152cf..d1407f9c 100644
--- a/src/android/mm/generic_camera_buffer.cpp
+++ b/src/android/mm/generic_camera_buffer.cpp
@@ -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";