diff options
author | Zhijun He <zhijunhe@google.com> | 2014-08-11 14:47:47 -0700 |
---|---|---|
committer | Zhijun He <zhijunhe@google.com> | 2014-08-11 14:47:47 -0700 |
commit | c572362427cdfda53142ad0b44818c269c1d9db1 (patch) | |
tree | 99fe6a2b42a484e8289bf3f03d42623714155a4e /services/camera | |
parent | 2dfe8ea7c131a045067c123efc934ef6ccdb8821 (diff) | |
download | frameworks_av-c572362427cdfda53142ad0b44818c269c1d9db1.zip frameworks_av-c572362427cdfda53142ad0b44818c269c1d9db1.tar.gz frameworks_av-c572362427cdfda53142ad0b44818c269c1d9db1.tar.bz2 |
Camera API1: Ignore the video size change during recording
Ignore the video size parameter change when recording is active.
Bug: 16524513
Change-Id: I55b7c961c06199764486f48bc2187838c2279606
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; + } } } |