diff options
author | Zhijun He <zhijunhe@google.com> | 2014-08-12 17:37:53 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-08-12 16:55:45 +0000 |
commit | ca05eb4b0194bb9b37a5261fa91f89add7a6df53 (patch) | |
tree | e3402bfc87a5256390a303c4efdef716fd315017 /services/camera | |
parent | d018b8ffd84452a7a4b992b5325713b3256e48ff (diff) | |
parent | c572362427cdfda53142ad0b44818c269c1d9db1 (diff) | |
download | frameworks_av-ca05eb4b0194bb9b37a5261fa91f89add7a6df53.zip frameworks_av-ca05eb4b0194bb9b37a5261fa91f89add7a6df53.tar.gz frameworks_av-ca05eb4b0194bb9b37a5261fa91f89add7a6df53.tar.bz2 |
Merge "Camera API1: Ignore the video size change during recording" into lmp-dev
Diffstat (limited to 'services/camera')
-rw-r--r-- | services/camera/libcameraservice/api1/client2/Parameters.cpp | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/services/camera/libcameraservice/api1/client2/Parameters.cpp b/services/camera/libcameraservice/api1/client2/Parameters.cpp index 6459300..30a6c7b 100644 --- a/services/camera/libcameraservice/api1/client2/Parameters.cpp +++ b/services/camera/libcameraservice/api1/client2/Parameters.cpp @@ -1672,21 +1672,26 @@ status_t Parameters::set(const String8& paramString) { if (validatedParams.videoWidth != videoWidth || validatedParams.videoHeight != videoHeight) { if (state == RECORD) { - ALOGE("%s: Video size cannot be updated when recording is active!", - __FUNCTION__); - return BAD_VALUE; - } - for (i = 0; i < availableVideoSizes.size(); i++) { - if ((availableVideoSizes[i].width == - validatedParams.videoWidth) && - (availableVideoSizes[i].height == - validatedParams.videoHeight)) break; - } - if (i == availableVideoSizes.size()) { - ALOGE("%s: Requested video size %d x %d is not supported", - __FUNCTION__, validatedParams.videoWidth, + ALOGW("%s: Video size cannot be updated (from %d x %d to %d x %d)" + " when recording is active! Ignore the size update!", + __FUNCTION__, videoWidth, videoHeight, validatedParams.videoWidth, validatedParams.videoHeight); - return BAD_VALUE; + validatedParams.videoWidth = videoWidth; + validatedParams.videoHeight = videoHeight; + newParams.setVideoSize(videoWidth, videoHeight); + } else { + for (i = 0; i < availableVideoSizes.size(); i++) { + if ((availableVideoSizes[i].width == + validatedParams.videoWidth) && + (availableVideoSizes[i].height == + validatedParams.videoHeight)) break; + } + if (i == availableVideoSizes.size()) { + ALOGE("%s: Requested video size %d x %d is not supported", + __FUNCTION__, validatedParams.videoWidth, + validatedParams.videoHeight); + return BAD_VALUE; + } } } |