Loading services/camera/libcameraservice/api2/CameraOfflineSessionClient.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,10 @@ status_t CameraOfflineSessionClient::initialize(sp<CameraProviderManager>, const return res; } for (size_t i = 0; i < mCompositeStreamMap.size(); i++) { mCompositeStreamMap.valueAt(i)->switchToOffline(); } return OK; } Loading services/camera/libcameraservice/api2/CompositeStream.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -200,5 +200,10 @@ void CompositeStream::notifyError(int64_t frameNumber) { } } void CompositeStream::switchToOffline() { Mutex::Autolock l(mMutex); mDevice.clear(); } }; // namespace camera3 }; // namespace android services/camera/libcameraservice/api2/CompositeStream.h +3 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,9 @@ public: status_t deleteStream(); // Switch to offline mode and release any online resources. void switchToOffline(); // Create and register all internal camera streams. virtual status_t createInternalStreams(const std::vector<sp<Surface>>& consumers, bool hasDeferredConsumer, uint32_t width, uint32_t height, int format, Loading services/camera/libcameraservice/api2/DepthCompositeStream.cpp +8 −7 Original line number Diff line number Diff line Loading @@ -619,14 +619,15 @@ status_t DepthCompositeStream::deleteInternalStreams() { strerror(-ret), ret); } if (mDepthStreamId >= 0) { // Camera devices may not be valid after switching to offline mode. // In this case, all offline streams including internal composite streams // are managed and released by the offline session. sp<CameraDeviceBase> device = mDevice.promote(); if (!device.get()) { ALOGE("%s: Invalid camera device!", __FUNCTION__); return NO_INIT; if (device.get() != nullptr) { ret = device->deleteStream(mDepthStreamId); } if (mDepthStreamId >= 0) { ret = device->deleteStream(mDepthStreamId); mDepthStreamId = -1; } Loading services/camera/libcameraservice/api2/HeicCompositeStream.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -209,13 +209,14 @@ status_t HeicCompositeStream::deleteInternalStreams() { deinitCodec(); if (mAppSegmentStreamId >= 0) { // Camera devices may not be valid after switching to offline mode. // In this case, all offline streams including internal composite streams // are managed and released by the offline session. sp<CameraDeviceBase> device = mDevice.promote(); if (!device.get()) { ALOGE("%s: Invalid camera device!", __FUNCTION__); return NO_INIT; if (device.get() != nullptr) { res = device->deleteStream(mAppSegmentStreamId); } res = device->deleteStream(mAppSegmentStreamId); mAppSegmentStreamId = -1; } Loading Loading
services/camera/libcameraservice/api2/CameraOfflineSessionClient.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,10 @@ status_t CameraOfflineSessionClient::initialize(sp<CameraProviderManager>, const return res; } for (size_t i = 0; i < mCompositeStreamMap.size(); i++) { mCompositeStreamMap.valueAt(i)->switchToOffline(); } return OK; } Loading
services/camera/libcameraservice/api2/CompositeStream.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -200,5 +200,10 @@ void CompositeStream::notifyError(int64_t frameNumber) { } } void CompositeStream::switchToOffline() { Mutex::Autolock l(mMutex); mDevice.clear(); } }; // namespace camera3 }; // namespace android
services/camera/libcameraservice/api2/CompositeStream.h +3 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,9 @@ public: status_t deleteStream(); // Switch to offline mode and release any online resources. void switchToOffline(); // Create and register all internal camera streams. virtual status_t createInternalStreams(const std::vector<sp<Surface>>& consumers, bool hasDeferredConsumer, uint32_t width, uint32_t height, int format, Loading
services/camera/libcameraservice/api2/DepthCompositeStream.cpp +8 −7 Original line number Diff line number Diff line Loading @@ -619,14 +619,15 @@ status_t DepthCompositeStream::deleteInternalStreams() { strerror(-ret), ret); } if (mDepthStreamId >= 0) { // Camera devices may not be valid after switching to offline mode. // In this case, all offline streams including internal composite streams // are managed and released by the offline session. sp<CameraDeviceBase> device = mDevice.promote(); if (!device.get()) { ALOGE("%s: Invalid camera device!", __FUNCTION__); return NO_INIT; if (device.get() != nullptr) { ret = device->deleteStream(mDepthStreamId); } if (mDepthStreamId >= 0) { ret = device->deleteStream(mDepthStreamId); mDepthStreamId = -1; } Loading
services/camera/libcameraservice/api2/HeicCompositeStream.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -209,13 +209,14 @@ status_t HeicCompositeStream::deleteInternalStreams() { deinitCodec(); if (mAppSegmentStreamId >= 0) { // Camera devices may not be valid after switching to offline mode. // In this case, all offline streams including internal composite streams // are managed and released by the offline session. sp<CameraDeviceBase> device = mDevice.promote(); if (!device.get()) { ALOGE("%s: Invalid camera device!", __FUNCTION__); return NO_INIT; if (device.get() != nullptr) { res = device->deleteStream(mAppSegmentStreamId); } res = device->deleteStream(mAppSegmentStreamId); mAppSegmentStreamId = -1; } Loading