fix video display 1-1 call

This commit is contained in:
gaelle 2025-04-15 10:46:45 +02:00
parent 9f4af14662
commit 53dd2c415e
2 changed files with 5 additions and 4 deletions

View file

@ -130,7 +130,7 @@ void CallModel::activateLocalVideo(std::shared_ptr<linphone::CallParams> &params
lInfo() << sLog() lInfo() << sLog()
.arg("Updating call with video enabled and media direction set to %1") .arg("Updating call with video enabled and media direction set to %1")
.arg((int)params->getVideoDirection()); .arg((int)params->getVideoDirection());
params->enableVideo(SettingsModel::getInstance()->getVideoEnabled() && enable); if (enable) params->enableVideo(SettingsModel::getInstance()->getVideoEnabled());
auto videoDirection = enable ? linphone::MediaDirection::SendRecv : linphone::MediaDirection::RecvOnly; auto videoDirection = enable ? linphone::MediaDirection::SendRecv : linphone::MediaDirection::RecvOnly;
params->setVideoDirection(videoDirection); params->setVideoDirection(videoDirection);
} }
@ -410,7 +410,7 @@ void CallModel::onStateChanged(const std::shared_ptr<linphone::Call> &call,
auto remoteVideoDirection = call->getRemoteParams()->getVideoDirection(); auto remoteVideoDirection = call->getRemoteParams()->getVideoDirection();
emit localVideoEnabledChanged(videoDirection == linphone::MediaDirection::SendOnly || emit localVideoEnabledChanged(videoDirection == linphone::MediaDirection::SendOnly ||
videoDirection == linphone::MediaDirection::SendRecv); videoDirection == linphone::MediaDirection::SendRecv);
emit remoteVideoEnabledChanged(remoteVideoDirection == linphone::MediaDirection::RecvOnly || emit remoteVideoEnabledChanged(remoteVideoDirection == linphone::MediaDirection::SendOnly ||
remoteVideoDirection == linphone::MediaDirection::SendRecv); remoteVideoDirection == linphone::MediaDirection::SendRecv);
updateConferenceVideoLayout(); updateConferenceVideoLayout();
} else if (state == linphone::Call::State::End || state == linphone::Call::State::Error) { } else if (state == linphone::Call::State::End || state == linphone::Call::State::Error) {

View file

@ -54,8 +54,9 @@ Item {
: "" : ""
property var identityAddress: account ? UtilsCpp.getDisplayName(account.core.identityAddress) : null property var identityAddress: account ? UtilsCpp.getDisplayName(account.core.identityAddress) : null
property bool videoEnabled: (previewEnabled && call && call.core.localVideoEnabled) property bool videoEnabled: (previewEnabled && call && call.core.localVideoEnabled)
|| (participantDevice && participantDevice.core.videoEnabled) || (!previewEnabled && call && call.core.remoteVideoEnabled)
|| (participantDevice && participantDevice.core.videoEnabled)
property string qmlName property string qmlName
property bool displayAll : !!mainItem.call property bool displayAll : !!mainItem.call
property bool mutedStatus: participantDevice property bool mutedStatus: participantDevice