summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorYin-Chia Yeh <yinchiayeh@google.com>2014-09-15 14:50:06 -0700
committerYin-Chia Yeh <yinchiayeh@google.com>2014-09-15 14:50:06 -0700
commitd3c5b081863ad5930971d90aee2f3a61f8424d88 (patch)
tree54799a19b4bcbb4f9e3b7466c0122df7c2324d0b /services
parent83a23e1e1e45d9e2f5497e214796250f74aad1d4 (diff)
downloadframeworks_av-d3c5b081863ad5930971d90aee2f3a61f8424d88.zip
frameworks_av-d3c5b081863ad5930971d90aee2f3a61f8424d88.tar.gz
frameworks_av-d3c5b081863ad5930971d90aee2f3a61f8424d88.tar.bz2
Camera2: handle one more videosnapshot failure
Handle one more corner case. Also remove redundant re-try path. Bug: 17484683 Change-Id: I0b3e1223f4f28022e7ec6abe028ca3c2623829de
Diffstat (limited to 'services')
-rw-r--r--services/camera/libcameraservice/api1/Camera2Client.cpp20
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 &params, 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 &params, 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);