diff options
author | Yin-Chia Yeh <yinchiayeh@google.com> | 2018-05-25 10:39:29 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-05-25 10:39:29 -0700 |
commit | 7a83eaa56daa430d0af8aa3f4725219f7dff0a7a (patch) | |
tree | 5dcebc149b7f996eeee7eee22ab0a9694d73147c /camera | |
parent | c89f88217106e7b17eb18f6c93bc52b066a9693e (diff) | |
parent | de680c0d0ca84ce0e9b089f333414d36c958dade (diff) | |
download | platform_hardware_interfaces-7a83eaa56daa430d0af8aa3f4725219f7dff0a7a.tar.gz platform_hardware_interfaces-7a83eaa56daa430d0af8aa3f4725219f7dff0a7a.tar.bz2 platform_hardware_interfaces-7a83eaa56daa430d0af8aa3f4725219f7dff0a7a.zip |
Merge "Camera: add FMQ size override logic" into pi-dev
am: de680c0d0c
Change-Id: I84a2fdb5c00e976901a19c2089a944383d3d7536
Diffstat (limited to 'camera')
-rw-r--r-- | camera/device/3.2/default/CameraDeviceSession.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/camera/device/3.2/default/CameraDeviceSession.cpp b/camera/device/3.2/default/CameraDeviceSession.cpp index f33da1349f..8d002646c0 100644 --- a/camera/device/3.2/default/CameraDeviceSession.cpp +++ b/camera/device/3.2/default/CameraDeviceSession.cpp @@ -18,6 +18,7 @@ #include <android/log.h> #include <set> +#include <cutils/properties.h> #include <utils/Trace.h> #include <hardware/gralloc.h> #include <hardware/gralloc1.h> @@ -31,9 +32,9 @@ namespace V3_2 { namespace implementation { // Size of request metadata fast message queue. Change to 0 to always use hwbinder buffer. -static constexpr size_t CAMERA_REQUEST_METADATA_QUEUE_SIZE = 1 << 20 /* 1MB */; +static constexpr int32_t CAMERA_REQUEST_METADATA_QUEUE_SIZE = 1 << 20 /* 1MB */; // Size of result metadata fast message queue. Change to 0 to always use hwbinder buffer. -static constexpr size_t CAMERA_RESULT_METADATA_QUEUE_SIZE = 1 << 20 /* 1MB */; +static constexpr int32_t CAMERA_RESULT_METADATA_QUEUE_SIZE = 1 << 20 /* 1MB */; // Metadata sent by HAL will be replaced by a compact copy // if their (total size >= compact size + METADATA_SHRINK_ABS_THRESHOLD && @@ -95,14 +96,30 @@ bool CameraDeviceSession::initialize() { return true; } + int32_t reqFMQSize = property_get_int32("ro.camera.req.fmq.size", /*default*/-1); + if (reqFMQSize < 0) { + reqFMQSize = CAMERA_REQUEST_METADATA_QUEUE_SIZE; + } else { + ALOGV("%s: request FMQ size overridden to %d", __FUNCTION__, reqFMQSize); + } + mRequestMetadataQueue = std::make_unique<RequestMetadataQueue>( - CAMERA_REQUEST_METADATA_QUEUE_SIZE, false /* non blocking */); + static_cast<size_t>(reqFMQSize), + false /* non blocking */); if (!mRequestMetadataQueue->isValid()) { ALOGE("%s: invalid request fmq", __FUNCTION__); return true; } + + int32_t resFMQSize = property_get_int32("ro.camera.res.fmq.size", /*default*/-1); + if (resFMQSize < 0) { + resFMQSize = CAMERA_RESULT_METADATA_QUEUE_SIZE; + } else { + ALOGV("%s: result FMQ size overridden to %d", __FUNCTION__, resFMQSize); + } mResultMetadataQueue = std::make_shared<RequestMetadataQueue>( - CAMERA_RESULT_METADATA_QUEUE_SIZE, false /* non blocking */); + static_cast<size_t>(resFMQSize), + false /* non blocking */); if (!mResultMetadataQueue->isValid()) { ALOGE("%s: invalid result fmq", __FUNCTION__); return true; |