From c572362427cdfda53142ad0b44818c269c1d9db1 Mon Sep 17 00:00:00 2001 From: Zhijun He Date: Mon, 11 Aug 2014 14:47:47 -0700 Subject: Camera API1: Ignore the video size change during recording Ignore the video size parameter change when recording is active. Bug: 16524513 Change-Id: I55b7c961c06199764486f48bc2187838c2279606 --- .../libcameraservice/api1/client2/Parameters.cpp | 33 +++++++++++++--------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'services/camera') 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; + } } } -- cgit v1.1