summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorZhijun He <zhijunhe@google.com>2014-10-13 22:20:37 -0700
committerZhijun He <zhijunhe@google.com>2014-10-14 11:29:50 -0700
commit96ff5c48a81f3f45c384113480bf5e28620a72ae (patch)
tree08f238c63539621dfcb5da6b19ce13ccb6a387b5 /services
parent801a3ff80c36aa9b55dc9b360d0e59f863011a39 (diff)
downloadframeworks_av-96ff5c48a81f3f45c384113480bf5e28620a72ae.zip
frameworks_av-96ff5c48a81f3f45c384113480bf5e28620a72ae.tar.gz
frameworks_av-96ff5c48a81f3f45c384113480bf5e28620a72ae.tar.bz2
Camera2Client: avoid two consecutive sets of configure_streams calls
When mediaRecorder starts without an active preview stream, Camera2Client starts preview then immediately start recording, which could cause the second configure_streams to call into HAL before any preview request is sent. This could cause HAL to run into bad state. This change work around this issue by making sure the first preview request is submitted to the HAL before start recording. Bug: 17915062 Change-Id: I94ae64ee76487603695a469240da601ddcb29a66
Diffstat (limited to 'services')
-rw-r--r--services/camera/libcameraservice/api1/Camera2Client.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/api1/Camera2Client.cpp b/services/camera/libcameraservice/api1/Camera2Client.cpp
index 3610362..2a6aa7b 100644
--- a/services/camera/libcameraservice/api1/Camera2Client.cpp
+++ b/services/camera/libcameraservice/api1/Camera2Client.cpp
@@ -995,6 +995,10 @@ status_t Camera2Client::startRecordingL(Parameters &params, bool restart) {
case Parameters::STOPPED:
res = startPreviewL(params, false);
if (res != OK) return res;
+ // Make sure first preview request is submitted to the HAL device to avoid
+ // two consecutive set of configure_streams being called into the HAL.
+ // TODO: Refactor this to avoid initial preview configuration.
+ syncWithDevice();
break;
case Parameters::PREVIEW:
// Ready to go