diff options
author | Yin-Chia Yeh <yinchiayeh@google.com> | 2014-09-15 22:11:20 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-09-15 22:11:21 +0000 |
commit | 47e89d7dcb4406b197c13764897fb28ac1e0b09b (patch) | |
tree | 17af21d9ae6083b9f919df47762d06882c9f3532 /services | |
parent | cf7863ea8d9137aadf6bfd9756eb07ebd1c81b5c (diff) | |
parent | d3c5b081863ad5930971d90aee2f3a61f8424d88 (diff) | |
download | frameworks_av-47e89d7dcb4406b197c13764897fb28ac1e0b09b.zip frameworks_av-47e89d7dcb4406b197c13764897fb28ac1e0b09b.tar.gz frameworks_av-47e89d7dcb4406b197c13764897fb28ac1e0b09b.tar.bz2 |
Merge "Camera2: handle one more videosnapshot failure" into lmp-dev
Diffstat (limited to 'services')
-rw-r--r-- | services/camera/libcameraservice/api1/Camera2Client.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/services/camera/libcameraservice/api1/Camera2Client.cpp b/services/camera/libcameraservice/api1/Camera2Client.cpp index 10038c5..fe2f299 100644 --- a/services/camera/libcameraservice/api1/Camera2Client.cpp +++ b/services/camera/libcameraservice/api1/Camera2Client.cpp @@ -1091,7 +1091,7 @@ status_t Camera2Client::startRecordingL(Parameters ¶ms, bool restart) { } if (recordingStreamNeedsUpdate) { - // Need to stop stream here in case updateRecordingStream fails + // Need to stop stream here so updateProcessorStream won't trigger configureStream // Right now camera device cannot handle configureStream failure gracefully // when device is streaming res = mStreamingProcessor->stopStream(); @@ -1110,18 +1110,6 @@ status_t Camera2Client::startRecordingL(Parameters ¶ms, bool restart) { &StreamingProcessor::updateRecordingStream>(mStreamingProcessor, params); - // updateRecordingStream might trigger a configureStream call and device might fail - // configureStream due to jpeg size > video size. Try again with jpeg size overridden - // to video size. - // TODO: This may not be needed after we add stop streaming above. Remove that if - // it's the case. - if (res == BAD_VALUE) { - overrideVideoSnapshotSize(params); - res = updateProcessorStream< - StreamingProcessor, - &StreamingProcessor::updateRecordingStream>(mStreamingProcessor, - params); - } if (res != OK) { ALOGE("%s: Camera %d: Unable to update recording stream: %s (%d)", __FUNCTION__, mCameraId, strerror(-res), res); @@ -1380,6 +1368,12 @@ status_t Camera2Client::takePicture(int msgType) { int lastJpegStreamId = mJpegProcessor->getStreamId(); res = updateProcessorStream(mJpegProcessor, l.mParameters); + // If video snapshot fail to configureStream, try override video snapshot size to + // video size + if (res == BAD_VALUE && l.mParameters.state == Parameters::VIDEO_SNAPSHOT) { + overrideVideoSnapshotSize(l.mParameters); + res = updateProcessorStream(mJpegProcessor, l.mParameters); + } if (res != OK) { ALOGE("%s: Camera %d: Can't set up still image stream: %s (%d)", __FUNCTION__, mCameraId, strerror(-res), res); |