Loading services/camera/libcameraservice/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ LOCAL_SRC_FILES:= \ api1/client2/JpegProcessor.cpp \ api1/client2/CallbackProcessor.cpp \ api1/client2/ZslProcessor.cpp \ api1/client2/ZslProcessorInterface.cpp \ api1/client2/BurstCapture.cpp \ api1/client2/JpegCompressor.cpp \ api1/client2/CaptureSequencer.cpp \ Loading services/camera/libcameraservice/api1/Camera2Client.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -434,6 +434,9 @@ void Camera2Client::disconnect() { mCallbackProcessor->deleteStream(); mZslProcessor->deleteStream(); // Remove all ZSL stream state before disconnect; needed to work around b/15408128. mZslProcessor->disconnect(); ALOGV("Camera %d: Disconnecting device", mCameraId); mDevice->disconnect(); Loading services/camera/libcameraservice/api1/client2/ZslProcessor.cpp +13 −2 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ ZslProcessor::ZslProcessor( mDevice(client->getCameraDevice()), mSequencer(sequencer), mId(client->getCameraId()), mDeleted(false), mZslBufferAvailable(false), mZslStreamId(NO_STREAM), mZslReprocessStreamId(NO_STREAM), Loading @@ -62,7 +63,7 @@ ZslProcessor::ZslProcessor( ZslProcessor::~ZslProcessor() { ALOGV("%s: Exit", __FUNCTION__); deleteStream(); disconnect(); } void ZslProcessor::onFrameAvailable() { Loading Loading @@ -153,7 +154,7 @@ status_t ZslProcessor::updateStream(const Parameters ¶ms) { mId, strerror(-res), res); return res; } if (currentWidth != (uint32_t)params.fastInfo.arrayWidth || if (mDeleted || currentWidth != (uint32_t)params.fastInfo.arrayWidth || currentHeight != (uint32_t)params.fastInfo.arrayHeight) { res = device->deleteReprocessStream(mZslReprocessStreamId); if (res != OK) { Loading @@ -175,6 +176,8 @@ status_t ZslProcessor::updateStream(const Parameters ¶ms) { } } mDeleted = false; if (mZslStreamId == NO_STREAM) { // Create stream for HAL production // TODO: Sort out better way to select resolution for ZSL Loading Loading @@ -208,6 +211,14 @@ status_t ZslProcessor::updateStream(const Parameters ¶ms) { } status_t ZslProcessor::deleteStream() { ATRACE_CALL(); Mutex::Autolock l(mInputMutex); // WAR(b/15408128): do not delete stream unless client is being disconnected. mDeleted = true; return OK; } status_t ZslProcessor::disconnect() { ATRACE_CALL(); status_t res; Loading services/camera/libcameraservice/api1/client2/ZslProcessor.h +3 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,7 @@ class ZslProcessor: status_t updateStream(const Parameters ¶ms); status_t deleteStream(); status_t disconnect(); int getStreamId() const; status_t pushToReprocess(int32_t requestId); Loading @@ -86,6 +87,8 @@ class ZslProcessor: wp<CaptureSequencer> mSequencer; int mId; bool mDeleted; mutable Mutex mInputMutex; bool mZslBufferAvailable; Condition mZslBufferAvailableSignal; Loading services/camera/libcameraservice/api1/client2/ZslProcessorInterface.cpp 0 → 100644 +28 −0 Original line number Diff line number Diff line /* * Copyright (C) 2014 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "ZslProcessorInterface.h" namespace android { namespace camera2 { status_t ZslProcessorInterface::disconnect() { return OK; } }; //namespace camera2 }; //namespace android Loading
services/camera/libcameraservice/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ LOCAL_SRC_FILES:= \ api1/client2/JpegProcessor.cpp \ api1/client2/CallbackProcessor.cpp \ api1/client2/ZslProcessor.cpp \ api1/client2/ZslProcessorInterface.cpp \ api1/client2/BurstCapture.cpp \ api1/client2/JpegCompressor.cpp \ api1/client2/CaptureSequencer.cpp \ Loading
services/camera/libcameraservice/api1/Camera2Client.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -434,6 +434,9 @@ void Camera2Client::disconnect() { mCallbackProcessor->deleteStream(); mZslProcessor->deleteStream(); // Remove all ZSL stream state before disconnect; needed to work around b/15408128. mZslProcessor->disconnect(); ALOGV("Camera %d: Disconnecting device", mCameraId); mDevice->disconnect(); Loading
services/camera/libcameraservice/api1/client2/ZslProcessor.cpp +13 −2 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ ZslProcessor::ZslProcessor( mDevice(client->getCameraDevice()), mSequencer(sequencer), mId(client->getCameraId()), mDeleted(false), mZslBufferAvailable(false), mZslStreamId(NO_STREAM), mZslReprocessStreamId(NO_STREAM), Loading @@ -62,7 +63,7 @@ ZslProcessor::ZslProcessor( ZslProcessor::~ZslProcessor() { ALOGV("%s: Exit", __FUNCTION__); deleteStream(); disconnect(); } void ZslProcessor::onFrameAvailable() { Loading Loading @@ -153,7 +154,7 @@ status_t ZslProcessor::updateStream(const Parameters ¶ms) { mId, strerror(-res), res); return res; } if (currentWidth != (uint32_t)params.fastInfo.arrayWidth || if (mDeleted || currentWidth != (uint32_t)params.fastInfo.arrayWidth || currentHeight != (uint32_t)params.fastInfo.arrayHeight) { res = device->deleteReprocessStream(mZslReprocessStreamId); if (res != OK) { Loading @@ -175,6 +176,8 @@ status_t ZslProcessor::updateStream(const Parameters ¶ms) { } } mDeleted = false; if (mZslStreamId == NO_STREAM) { // Create stream for HAL production // TODO: Sort out better way to select resolution for ZSL Loading Loading @@ -208,6 +211,14 @@ status_t ZslProcessor::updateStream(const Parameters ¶ms) { } status_t ZslProcessor::deleteStream() { ATRACE_CALL(); Mutex::Autolock l(mInputMutex); // WAR(b/15408128): do not delete stream unless client is being disconnected. mDeleted = true; return OK; } status_t ZslProcessor::disconnect() { ATRACE_CALL(); status_t res; Loading
services/camera/libcameraservice/api1/client2/ZslProcessor.h +3 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,7 @@ class ZslProcessor: status_t updateStream(const Parameters ¶ms); status_t deleteStream(); status_t disconnect(); int getStreamId() const; status_t pushToReprocess(int32_t requestId); Loading @@ -86,6 +87,8 @@ class ZslProcessor: wp<CaptureSequencer> mSequencer; int mId; bool mDeleted; mutable Mutex mInputMutex; bool mZslBufferAvailable; Condition mZslBufferAvailableSignal; Loading
services/camera/libcameraservice/api1/client2/ZslProcessorInterface.cpp 0 → 100644 +28 −0 Original line number Diff line number Diff line /* * Copyright (C) 2014 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "ZslProcessorInterface.h" namespace android { namespace camera2 { status_t ZslProcessorInterface::disconnect() { return OK; } }; //namespace camera2 }; //namespace android