commit | 2c54504df6b633d9840da6b5f781e69c41890d54 | [log] [tgz] |
---|---|---|
author | Shuzhen Wang <shuzhenwang@google.com> | Thu Feb 07 10:27:35 2019 -0800 |
committer | Shuzhen Wang <shuzhenwang@google.com> | Fri Feb 08 17:13:58 2019 +0000 |
tree | babc5581801fbb8211c18783cf3a3efa564d7847 | |
parent | ffb2516cc730b5ac621ad8a92e827faf4e86b8ca [diff] |
Camera: Disconnect composite streams from output surface at shutdown When a composite stream is deleted, the previously connected output surface needs to be disconnected. Otherwise when the composite stream is re-created with the same output surface, connect() will fail. Test: TestingCamera2, and Camera CTS Bug: 79465976 Bug: 109735087 Bug: 124072769 Change-Id: I254238235d306f9be8152110b1c55a7ada46424a
diff --git a/services/camera/libcameraservice/api2/DepthCompositeStream.cpp b/services/camera/libcameraservice/api2/DepthCompositeStream.cpp index f627b25..2eec0f7 100644 --- a/services/camera/libcameraservice/api2/DepthCompositeStream.cpp +++ b/services/camera/libcameraservice/api2/DepthCompositeStream.cpp
@@ -634,6 +634,11 @@ mDepthStreamId = -1; } + if (mOutputSurface != nullptr) { + mOutputSurface->disconnect(NATIVE_WINDOW_API_CAMERA); + mOutputSurface.clear(); + } + return ret; }
diff --git a/services/camera/libcameraservice/api2/HeicCompositeStream.cpp b/services/camera/libcameraservice/api2/HeicCompositeStream.cpp index 3eba863..8e9c39e 100644 --- a/services/camera/libcameraservice/api2/HeicCompositeStream.cpp +++ b/services/camera/libcameraservice/api2/HeicCompositeStream.cpp
@@ -214,6 +214,10 @@ mAppSegmentStreamId = -1; } + if (mOutputSurface != nullptr) { + mOutputSurface->disconnect(NATIVE_WINDOW_API_CAMERA); + mOutputSurface.clear(); + } return res; }