fix #LINQT-1308 video stats visibility

This commit is contained in:
Gaelle Braud 2024-10-03 11:52:48 +02:00
parent b8aa7d7ebc
commit 0ccf340499
2 changed files with 8 additions and 9 deletions

View file

@ -424,13 +424,11 @@ void CallModel::onStateChanged(const std::shared_ptr<linphone::Call> &call,
if (state == linphone::Call::State::StreamsRunning) { if (state == linphone::Call::State::StreamsRunning) {
mDurationTimer.start(); mDurationTimer.start();
// After UpdatedByRemote, video direction could be changed. // After UpdatedByRemote, video direction could be changed.
auto params = call->getRemoteParams(); auto videoDirection = call->getCurrentParams()->getVideoDirection();
auto videoDirection = params ? params->getVideoDirection() : linphone::MediaDirection::Inactive;
emit remoteVideoEnabledChanged(videoDirection == linphone::MediaDirection::SendOnly ||
videoDirection == linphone::MediaDirection::SendRecv);
videoDirection = call->getCurrentParams()->getVideoDirection();
emit localVideoEnabledChanged(videoDirection == linphone::MediaDirection::SendOnly || emit localVideoEnabledChanged(videoDirection == linphone::MediaDirection::SendOnly ||
videoDirection == linphone::MediaDirection::SendRecv); videoDirection == linphone::MediaDirection::SendRecv);
emit remoteVideoEnabledChanged(videoDirection == linphone::MediaDirection::RecvOnly ||
videoDirection == linphone::MediaDirection::SendRecv);
setConference(call->getConference()); setConference(call->getConference());
updateConferenceVideoLayout(); updateConferenceVideoLayout();
} else if (state == linphone::Call::State::End) { } else if (state == linphone::Call::State::End) {

View file

@ -19,6 +19,8 @@ AbstractWindow {
property ConferenceGui conference: call && call.core.conference || null property ConferenceGui conference: call && call.core.conference || null
property int conferenceLayout: call && call.core.conferenceVideoLayout || 0 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 bool callTerminatedByUser: false
property var callState: call ? call.core.state : LinphoneEnums.CallState.Idle property var callState: call ? call.core.state : LinphoneEnums.CallState.Idle
@ -116,7 +118,6 @@ AbstractWindow {
Connections { Connections {
enabled: !!call enabled: !!call
target: call && call.core target: call && call.core
function onRemoteVideoEnabledChanged() { console.log("remote video enabled", call.core.remoteVideoEnabled)}
function onSecurityUpdated() { function onSecurityUpdated() {
if (call.core.encryption === LinphoneEnums.MediaEncryption.Zrtp) { if (call.core.encryption === LinphoneEnums.MediaEncryption.Zrtp) {
if (call.core.tokenVerified) { if (call.core.tokenVerified) {
@ -1211,7 +1212,7 @@ AbstractWindow {
Layout.leftMargin: 16 * DefaultStyle.dp Layout.leftMargin: 16 * DefaultStyle.dp
Layout.rightMargin: 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 { contentItem: ColumnLayout {
spacing: 12 * DefaultStyle.dp spacing: 12 * DefaultStyle.dp
@ -1464,7 +1465,7 @@ AbstractWindow {
enabled: mainWindow.conferenceInfo || (mainWindow.callState === LinphoneEnums.CallState.Connected || mainWindow.callState === LinphoneEnums.CallState.StreamsRunning) enabled: mainWindow.conferenceInfo || (mainWindow.callState === LinphoneEnums.CallState.Connected || mainWindow.callState === LinphoneEnums.CallState.StreamsRunning)
iconUrl: AppIcons.videoCamera iconUrl: AppIcons.videoCamera
checkedIconUrl: AppIcons.videoCameraSlash checkedIconUrl: AppIcons.videoCameraSlash
checked: mainWindow.call && !mainWindow.call.core.localVideoEnabled checked: !mainWindow.localVideoEnabled
Layout.preferredWidth: 55 * DefaultStyle.dp Layout.preferredWidth: 55 * DefaultStyle.dp
Layout.preferredHeight: 55 * DefaultStyle.dp Layout.preferredHeight: 55 * DefaultStyle.dp
icon.width: 32 * DefaultStyle.dp icon.width: 32 * DefaultStyle.dp