summaryrefslogtreecommitdiff
path: root/camera
diff options
context:
space:
mode:
authorShuzhen Wang <shuzhenwang@google.com>2017-09-27 12:22:46 -0700
committerShuzhen Wang <shuzhenwang@google.com>2017-09-28 11:16:21 -0700
commit29d643327b94a5f6884b312246927f7afe835724 (patch)
treeb92ab0f2aa87af146c7c3bfd5c64fd436111f6ad /camera
parent7fcf43ec1ab5189d4dc271154eae8eadcbd9668c (diff)
QCamera2: HAL3: Link EIS module if video stabilization tag is set
Extend current EIS logic such that even if there is no video stream configured, link EIS module if the VIDEO_STABILIZATION control is on. This fixes the API1 shim video recording issue where there is a sudden FOV change at the start of recording when video stream is created. Test: Use TestingCamera Bug: 67001070 Change-Id: If0348569866729310f2d01665d8892bfb32ebfd3
Diffstat (limited to 'camera')
-rw-r--r--camera/QCamera2/HAL3/QCamera3HWI.cpp38
1 files changed, 20 insertions, 18 deletions
diff --git a/camera/QCamera2/HAL3/QCamera3HWI.cpp b/camera/QCamera2/HAL3/QCamera3HWI.cpp
index 39283a66..e276cbe4 100644
--- a/camera/QCamera2/HAL3/QCamera3HWI.cpp
+++ b/camera/QCamera2/HAL3/QCamera3HWI.cpp
@@ -1528,7 +1528,7 @@ int QCamera3HardwareInterface::configureStreamsPerfLocked(
/* Check whether we have video stream */
m_bIs4KVideo = false;
m_bIsVideo = false;
- m_bEisSupportedSize = false;
+ m_bEisSupportedSize = true;
m_bTnrEnabled = false;
bool isZsl = false;
bool isPreview = false;
@@ -1598,7 +1598,8 @@ int QCamera3HardwareInterface::configureStreamsPerfLocked(
eis_prop_set = (uint8_t)atoi(eis_prop);
m_bEisEnable = eis_prop_set && (!oisSupported && eisSupported) &&
- (mOpMode != CAMERA3_STREAM_CONFIGURATION_CONSTRAINED_HIGH_SPEED_MODE);
+ (mOpMode != CAMERA3_STREAM_CONFIGURATION_CONSTRAINED_HIGH_SPEED_MODE) &&
+ (gCamCapability[mCameraId]->position != CAM_POSITION_FRONT);
/* stream configurations */
for (size_t i = 0; i < streamList->num_streams; i++) {
@@ -1631,17 +1632,18 @@ int QCamera3HardwareInterface::configureStreamsPerfLocked(
}
if ((HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED == newStream->format) &&
- (newStream->usage & private_handle_t::PRIV_FLAGS_VIDEO_ENCODER)) {
- m_bIsVideo = true;
- videoWidth = newStream->width;
- videoHeight = newStream->height;
- if ((VIDEO_4K_WIDTH <= newStream->width) &&
- (VIDEO_4K_HEIGHT <= newStream->height)) {
- m_bIs4KVideo = true;
- }
- m_bEisSupportedSize = (newStream->width <= maxEisWidth) &&
+ (IS_USAGE_PREVIEW(newStream->usage) || IS_USAGE_VIDEO(newStream->usage))) {
+ if (IS_USAGE_VIDEO(newStream->usage)) {
+ videoWidth = newStream->width;
+ videoHeight = newStream->height;
+ m_bIsVideo = true;
+ if ((VIDEO_4K_WIDTH <= newStream->width) &&
+ (VIDEO_4K_HEIGHT <= newStream->height)) {
+ m_bIs4KVideo = true;
+ }
+ }
+ m_bEisSupportedSize &= (newStream->width <= maxEisWidth) &&
(newStream->height <= maxEisHeight);
-
}
if (newStream->stream_type == CAMERA3_STREAM_BIDIRECTIONAL ||
newStream->stream_type == CAMERA3_STREAM_OUTPUT) {
@@ -1711,11 +1713,6 @@ int QCamera3HardwareInterface::configureStreamsPerfLocked(
}
}
- if (gCamCapability[mCameraId]->position == CAM_POSITION_FRONT ||
- !m_bIsVideo) {
- m_bEisEnable = false;
- }
-
if (validateUsageFlagsForEis(streamList) != NO_ERROR) {
pthread_mutex_unlock(&mMutex);
return -EINVAL;
@@ -3716,8 +3713,13 @@ int QCamera3HardwareInterface::processCaptureRequest(
ADD_SET_PARAM_ENTRY_TO_BATCH(mParameters, CAM_INTF_META_CAPTURE_INTENT, captureIntent);
}
+ uint8_t fwkVideoStabMode=0;
+ if (meta.exists(ANDROID_CONTROL_VIDEO_STABILIZATION_MODE)) {
+ fwkVideoStabMode = meta.find(ANDROID_CONTROL_VIDEO_STABILIZATION_MODE).data.u8[0];
+ }
//If EIS is enabled, turn it on for video
- bool setEis = m_bEisEnable && m_bEisSupportedSize && !meta.exists(QCAMERA3_USE_AV_TIMER);
+ bool setEis = m_bEisEnable && (m_bIsVideo || fwkVideoStabMode) && m_bEisSupportedSize &&
+ !meta.exists(QCAMERA3_USE_AV_TIMER);
int32_t vsMode;
vsMode = (setEis)? DIS_ENABLE: DIS_DISABLE;
if (ADD_SET_PARAM_ENTRY_TO_BATCH(mParameters, CAM_INTF_PARM_DIS_ENABLE, vsMode)) {