From 0ccf340499b31e9dc5c5ebaa56b1a45a64e98144 Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Thu, 3 Oct 2024 11:52:48 +0200 Subject: [PATCH] fix #LINQT-1308 video stats visibility --- Linphone/model/call/CallModel.cpp | 8 +++----- Linphone/view/Page/Window/Call/CallsWindow.qml | 9 +++++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Linphone/model/call/CallModel.cpp b/Linphone/model/call/CallModel.cpp index 086ebd347..ca5fb056a 100644 --- a/Linphone/model/call/CallModel.cpp +++ b/Linphone/model/call/CallModel.cpp @@ -424,13 +424,11 @@ void CallModel::onStateChanged(const std::shared_ptr &call, if (state == linphone::Call::State::StreamsRunning) { mDurationTimer.start(); // After UpdatedByRemote, video direction could be changed. - auto params = call->getRemoteParams(); - auto videoDirection = params ? params->getVideoDirection() : linphone::MediaDirection::Inactive; - emit remoteVideoEnabledChanged(videoDirection == linphone::MediaDirection::SendOnly || - videoDirection == linphone::MediaDirection::SendRecv); - videoDirection = call->getCurrentParams()->getVideoDirection(); + auto videoDirection = call->getCurrentParams()->getVideoDirection(); emit localVideoEnabledChanged(videoDirection == linphone::MediaDirection::SendOnly || videoDirection == linphone::MediaDirection::SendRecv); + emit remoteVideoEnabledChanged(videoDirection == linphone::MediaDirection::RecvOnly || + videoDirection == linphone::MediaDirection::SendRecv); setConference(call->getConference()); updateConferenceVideoLayout(); } else if (state == linphone::Call::State::End) { diff --git a/Linphone/view/Page/Window/Call/CallsWindow.qml b/Linphone/view/Page/Window/Call/CallsWindow.qml index f67e7c404..2f9e4e7f2 100644 --- a/Linphone/view/Page/Window/Call/CallsWindow.qml +++ b/Linphone/view/Page/Window/Call/CallsWindow.qml @@ -19,6 +19,8 @@ AbstractWindow { property ConferenceGui conference: call && call.core.conference || null property int conferenceLayout: call && call.core.conferenceVideoLayout || 0 + property bool localVideoEnabled: call && call.core.localVideoEnabled + property bool remoteVideoEnabled: call && call.core.remoteVideoEnabled property bool callTerminatedByUser: false property var callState: call ? call.core.state : LinphoneEnums.CallState.Idle @@ -116,7 +118,6 @@ AbstractWindow { Connections { enabled: !!call target: call && call.core - function onRemoteVideoEnabledChanged() { console.log("remote video enabled", call.core.remoteVideoEnabled)} function onSecurityUpdated() { if (call.core.encryption === LinphoneEnums.MediaEncryption.Zrtp) { if (call.core.tokenVerified) { @@ -1211,8 +1212,8 @@ AbstractWindow { Layout.leftMargin: 16 * DefaultStyle.dp Layout.rightMargin: 16 * DefaultStyle.dp - visible: mainWindow.call && (mainWindow.call.core.localVideoEnabled || mainWindow.call.core.remoteVideoEnabled) - + visible: mainWindow.localVideoEnabled || mainWindow.remoteVideoEnabled + contentItem: ColumnLayout { spacing: 12 * DefaultStyle.dp Layout.alignment: Qt.AlignHCenter @@ -1464,7 +1465,7 @@ AbstractWindow { enabled: mainWindow.conferenceInfo || (mainWindow.callState === LinphoneEnums.CallState.Connected || mainWindow.callState === LinphoneEnums.CallState.StreamsRunning) iconUrl: AppIcons.videoCamera checkedIconUrl: AppIcons.videoCameraSlash - checked: mainWindow.call && !mainWindow.call.core.localVideoEnabled + checked: !mainWindow.localVideoEnabled Layout.preferredWidth: 55 * DefaultStyle.dp Layout.preferredHeight: 55 * DefaultStyle.dp icon.width: 32 * DefaultStyle.dp