diff options
author | Igor Murashkin <iam@google.com> | 2012-10-02 19:07:14 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-10-03 11:28:40 -0700 |
commit | 22d58d37db6b5f48a10b3a19f69ffda09943c125 (patch) | |
tree | a64c05cca9938cbc98b91789d8eda3ba30acdf12 | |
parent | 9f9d7de77beb65ab51e73e55eea6f0b3a4e75bd2 (diff) |
Camera2: Don't change state when reconnect is called
Bug: 7252802
Change-Id: Ibed4f59a96bef75bf84b1aaf1235fb87e94102ef
-rw-r--r-- | services/camera/libcameraservice/Camera2Client.cpp | 11 | ||||
-rw-r--r-- | services/camera/libcameraservice/camera2/StreamingProcessor.cpp | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/services/camera/libcameraservice/Camera2Client.cpp b/services/camera/libcameraservice/Camera2Client.cpp index ffb2c58c..59ec6b64 100644 --- a/services/camera/libcameraservice/Camera2Client.cpp +++ b/services/camera/libcameraservice/Camera2Client.cpp @@ -419,9 +419,6 @@ status_t Camera2Client::connect(const sp<ICameraClient>& client) { mCameraClient = client; mSharedCameraClient = client; - SharedParameters::Lock l(mParameters); - l.mParameters.state = Parameters::STOPPED; - return OK; } @@ -603,6 +600,9 @@ status_t Camera2Client::startPreview() { status_t Camera2Client::startPreviewL(Parameters ¶ms, bool restart) { ATRACE_CALL(); status_t res; + + ALOGV("%s: state == %d, restart = %d", __FUNCTION__, params.state, restart); + if (params.state == Parameters::PREVIEW && !restart) { // Succeed attempt to re-enter preview state ALOGI("%s: Not starting preview; already in preview state.", @@ -792,6 +792,9 @@ status_t Camera2Client::startRecording() { status_t Camera2Client::startRecordingL(Parameters ¶ms, bool restart) { status_t res; + + ALOGV("%s: state == %d, restart = %d", __FUNCTION__, params.state, restart); + switch (params.state) { case Parameters::STOPPED: res = startPreviewL(params, false); @@ -1430,6 +1433,8 @@ const int32_t Camera2Client::kFirstCaptureRequestId; status_t Camera2Client::updateRequests(Parameters ¶ms) { status_t res; + ALOGV("%s: Camera %d: state = %d", __FUNCTION__, getCameraId(), params.state); + res = mStreamingProcessor->updatePreviewRequest(params); if (res != OK) { ALOGE("%s: Camera %d: Unable to update preview request: %s (%d)", diff --git a/services/camera/libcameraservice/camera2/StreamingProcessor.cpp b/services/camera/libcameraservice/camera2/StreamingProcessor.cpp index 140138d6..feaeb6cd 100644 --- a/services/camera/libcameraservice/camera2/StreamingProcessor.cpp +++ b/services/camera/libcameraservice/camera2/StreamingProcessor.cpp @@ -351,6 +351,8 @@ status_t StreamingProcessor::startStream(StreamType type, sp<Camera2Client> client = mClient.promote(); if (client == 0) return INVALID_OPERATION; + ALOGV("%s: Camera %d: type = %d", __FUNCTION__, client->getCameraId(), type); + Mutex::Autolock m(mMutex); CameraMetadata &request = (type == PREVIEW) ? |