!124 【分布式相机】修复相机应用多机位模式更改设置后黑屏问题

Merge pull request !124 from zhuxu/master
This commit is contained in:
openharmony_ci
2022-06-14 08:54:57 +00:00
committed by Gitee
2 changed files with 7 additions and 7 deletions
@@ -336,16 +336,16 @@ void DCameraSinkController::OnSessionState(int32_t state)
DHLOGI("DCameraSinkController::OnSessionState %s new thread session state: %d",
GetAnonyString(dhId_).c_str(), sessionState_);
std::lock_guard<std::mutex> autoLock(autoLock_);
int32_t ret = StopCapture();
if (ret != DCAMERA_OK) {
DHLOGE("DCameraSinkController::OnSessionState session state: %d, %s stop capture failed, ret: %d",
sessionState_, GetAnonyString(dhId_).c_str(), ret);
}
ret = CloseChannel();
int32_t ret = CloseChannel();
if (ret != DCAMERA_OK) {
DHLOGE("DCameraSinkController::OnSessionState session state: %d, %s close channel failed, ret: %d",
sessionState_, GetAnonyString(dhId_).c_str(), ret);
}
ret = StopCapture();
if (ret != DCAMERA_OK) {
DHLOGE("DCameraSinkController::OnSessionState session state: %d, %s stop capture failed, ret: %d",
sessionState_, GetAnonyString(dhId_).c_str(), ret);
}
}).detach();
break;
}
@@ -101,7 +101,7 @@ int32_t DCameraChannelSinkImpl::ReleaseSession()
if (softbusSession_ == nullptr) {
return DCAMERA_OK;
}
DCameraSoftbusAdapter::GetInstance().sourceSessions_.erase(softbusSession_->GetMySessionName());
DCameraSoftbusAdapter::GetInstance().sinkSessions_.erase(softbusSession_->GetMySessionName());
int32_t ret = DCameraSoftbusAdapter::GetInstance().DestroySoftbusSessionServer(softbusSession_->GetMySessionName());
if (ret != DCAMERA_OK) {
DHLOGE("DCameraChannelSinkImpl ReleaseSession %s failed, ret: %d", mySessionName_.c_str(), ret);