Loading camera/device/1.0/default/CameraDevice.cpp +8 −4 Original line number Original line Diff line number Diff line Loading @@ -116,7 +116,7 @@ CameraDevice::~CameraDevice() { Mutex::Autolock _l(mLock); Mutex::Autolock _l(mLock); if (mDevice != nullptr) { if (mDevice != nullptr) { ALOGW("%s: camera %s is deleted while open", __FUNCTION__, mCameraId.c_str()); ALOGW("%s: camera %s is deleted while open", __FUNCTION__, mCameraId.c_str()); close(); closeLocked(); } } mHalPreviewWindow.cleanUpCirculatingBuffers(); mHalPreviewWindow.cleanUpCirculatingBuffers(); } } Loading @@ -130,7 +130,7 @@ void CameraDevice::setConnectionStatus(bool connected) { } } if (!connected) { if (!connected) { ALOGW("%s: camera %s is disconneted. Closing", __FUNCTION__, mCameraId.c_str()); ALOGW("%s: camera %s is disconneted. Closing", __FUNCTION__, mCameraId.c_str()); close(); closeLocked(); } } return; return; } } Loading Loading @@ -982,8 +982,13 @@ Return<Status> CameraDevice::sendCommand(CommandType cmd, int32_t arg1, int32_t } } Return<void> CameraDevice::close() { Return<void> CameraDevice::close() { ALOGI("Closing camera %s", mCameraId.c_str()); Mutex::Autolock _l(mLock); Mutex::Autolock _l(mLock); closeLocked(); return Void(); } void CameraDevice::closeLocked() { ALOGI("Closing camera %s", mCameraId.c_str()); if(mDevice) { if(mDevice) { int rc = mDevice->common.close(&mDevice->common); int rc = mDevice->common.close(&mDevice->common); if (rc != OK) { if (rc != OK) { Loading @@ -991,7 +996,6 @@ Return<void> CameraDevice::close() { } } mDevice = nullptr; mDevice = nullptr; } } return Void(); } } } // namespace implementation } // namespace implementation Loading camera/device/1.0/default/CameraDevice_1_0.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -222,6 +222,7 @@ private: static status_t getStatusT(const Status& s); static status_t getStatusT(const Status& s); Status initStatus() const; Status initStatus() const; void closeLocked(); }; }; } // namespace implementation } // namespace implementation Loading Loading
camera/device/1.0/default/CameraDevice.cpp +8 −4 Original line number Original line Diff line number Diff line Loading @@ -116,7 +116,7 @@ CameraDevice::~CameraDevice() { Mutex::Autolock _l(mLock); Mutex::Autolock _l(mLock); if (mDevice != nullptr) { if (mDevice != nullptr) { ALOGW("%s: camera %s is deleted while open", __FUNCTION__, mCameraId.c_str()); ALOGW("%s: camera %s is deleted while open", __FUNCTION__, mCameraId.c_str()); close(); closeLocked(); } } mHalPreviewWindow.cleanUpCirculatingBuffers(); mHalPreviewWindow.cleanUpCirculatingBuffers(); } } Loading @@ -130,7 +130,7 @@ void CameraDevice::setConnectionStatus(bool connected) { } } if (!connected) { if (!connected) { ALOGW("%s: camera %s is disconneted. Closing", __FUNCTION__, mCameraId.c_str()); ALOGW("%s: camera %s is disconneted. Closing", __FUNCTION__, mCameraId.c_str()); close(); closeLocked(); } } return; return; } } Loading Loading @@ -982,8 +982,13 @@ Return<Status> CameraDevice::sendCommand(CommandType cmd, int32_t arg1, int32_t } } Return<void> CameraDevice::close() { Return<void> CameraDevice::close() { ALOGI("Closing camera %s", mCameraId.c_str()); Mutex::Autolock _l(mLock); Mutex::Autolock _l(mLock); closeLocked(); return Void(); } void CameraDevice::closeLocked() { ALOGI("Closing camera %s", mCameraId.c_str()); if(mDevice) { if(mDevice) { int rc = mDevice->common.close(&mDevice->common); int rc = mDevice->common.close(&mDevice->common); if (rc != OK) { if (rc != OK) { Loading @@ -991,7 +996,6 @@ Return<void> CameraDevice::close() { } } mDevice = nullptr; mDevice = nullptr; } } return Void(); } } } // namespace implementation } // namespace implementation Loading
camera/device/1.0/default/CameraDevice_1_0.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -222,6 +222,7 @@ private: static status_t getStatusT(const Status& s); static status_t getStatusT(const Status& s); Status initStatus() const; Status initStatus() const; void closeLocked(); }; }; } // namespace implementation } // namespace implementation Loading