Camera: Release all composite streams during "detachDevice"

"CameraDeviceClient" which keeps all references to active
composite streams may not get immediately destroyed after
client disconnect. This means that all registered output
surfaces in composite streams will continue to have
an active connection. In such scenario camera clients will
not be able to re-use the same surface as long as the older
instances are still alive.
 Avoid this behavior by explicitly releasing all remaining
composite streams during "detachDevice". The method must
be called as part of the client disconnect and will
ensure that all surface connections are removed.

Bug: 143212133
Test: Camera CTS
Change-Id: I08710645539b687f046116a88576f05bbcbdbaff
gugelfrei
Emilian Peev 5 years ago
parent ca7582109d
commit 5e4c732e86

@ -2004,6 +2004,15 @@ void CameraDeviceClient::detachDevice() {
}
}
for (size_t i = 0; i < mCompositeStreamMap.size(); i++) {
auto ret = mCompositeStreamMap.valueAt(i)->deleteInternalStreams();
if (ret != OK) {
ALOGE("%s: Failed removing composite stream %s (%d)", __FUNCTION__,
strerror(-ret), ret);
}
}
mCompositeStreamMap.clear();
Camera2ClientBase::detachDevice();
}

Loading…
Cancel
Save