Merge "Camera: Add fall back properties for FMQ size override" into qt-dev

am: a07b613b59

Change-Id: I1865a18a7bf1078d38bdc01db5916da8a68024d0
This commit is contained in:
Emilian Peev 2019-05-16 14:48:42 -07:00 committed by android-build-merger
commit c22d6eed67

View file

@ -99,11 +99,20 @@ bool CameraDeviceSession::initialize() {
return true;
}
int32_t reqFMQSize = property_get_int32("ro.camera.req.fmq.size", /*default*/-1);
// "ro.camera" properties are no longer supported on vendor side.
// Support a fall back for the fmq size override that uses "ro.vendor.camera"
// properties.
int32_t reqFMQSize = property_get_int32("ro.vendor.camera.req.fmq.size", /*default*/-1);
if (reqFMQSize < 0) {
reqFMQSize = CAMERA_REQUEST_METADATA_QUEUE_SIZE;
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);
}
} else {
ALOGV("%s: request FMQ size overridden to %d", __FUNCTION__, reqFMQSize);
ALOGV("%s: request FMQ size overridden to %d via fallback property", __FUNCTION__,
reqFMQSize);
}
mRequestMetadataQueue = std::make_unique<RequestMetadataQueue>(
@ -114,12 +123,22 @@ bool CameraDeviceSession::initialize() {
return true;
}
int32_t resFMQSize = property_get_int32("ro.camera.res.fmq.size", /*default*/-1);
// "ro.camera" properties are no longer supported on vendor side.
// Support a fall back for the fmq size override that uses "ro.vendor.camera"
// properties.
int32_t resFMQSize = property_get_int32("ro.vendor.camera.res.fmq.size", /*default*/-1);
if (resFMQSize < 0) {
resFMQSize = CAMERA_RESULT_METADATA_QUEUE_SIZE;
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);
}
} else {
ALOGV("%s: result FMQ size overridden to %d", __FUNCTION__, resFMQSize);
ALOGV("%s: result FMQ size overridden to %d via fallback property", __FUNCTION__,
resFMQSize);
}
mResultMetadataQueue = std::make_shared<RequestMetadataQueue>(
static_cast<size_t>(resFMQSize),
false /* non blocking */);