diff --git a/CHANGELOG.md b/CHANGELOG.md index 607186ef1..2a860ed05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Avoid mosaic layout when screensharing is enabled. +- Video conference stabilization. + ### Changed - Update SDK to 5.4.50 diff --git a/linphone-app/src/components/conference/ConferenceModel.cpp b/linphone-app/src/components/conference/ConferenceModel.cpp index 4264db69e..d9d2db36b 100644 --- a/linphone-app/src/components/conference/ConferenceModel.cpp +++ b/linphone-app/src/components/conference/ConferenceModel.cpp @@ -114,6 +114,11 @@ void ConferenceModel::toggleScreenSharing() { if(enable) { params->setConferenceVideoLayout(linphone::Conference::Layout::ActiveSpeaker); params->enableVideo(true); + auto localParams = mConference->getCall()->getParams(); + if(localParams->getVideoDirection() == linphone::MediaDirection::SendRecv) + params->setVideoDirection(linphone::MediaDirection::SendRecv); + else + params->setVideoDirection(linphone::MediaDirection::SendOnly); } if(params->isValid()) mConference->getCall()->update(params); diff --git a/linphone-app/src/components/participant/ParticipantDeviceListModel.cpp b/linphone-app/src/components/participant/ParticipantDeviceListModel.cpp index 71796239f..4d4ba3a39 100644 --- a/linphone-app/src/components/participant/ParticipantDeviceListModel.cpp +++ b/linphone-app/src/components/participant/ParticipantDeviceListModel.cpp @@ -71,11 +71,10 @@ void ParticipantDeviceListModel::initConferenceModel(){ connect(conferenceModel.get(), &ConferenceModel::participantDeviceMediaAvailabilityChanged, this, &ParticipantDeviceListModel::onParticipantDeviceMediaAvailabilityChanged); connect(conferenceModel.get(), &ConferenceModel::participantDeviceIsSpeakingChanged, this, &ParticipantDeviceListModel::onParticipantDeviceIsSpeakingChanged); connect(conferenceModel.get(), &ConferenceModel::participantDeviceScreenSharingChanged, this, &ParticipantDeviceListModel::onParticipantDeviceScreenSharingChanged); - - // TODO activeSpeaker - //auto activeSpeaker = conferenceModel->getConference()->getScreenSharingParticipantDevice(); - //if(!activeSpeaker) - auto activeSpeaker = conferenceModel->getConference()->getActiveSpeakerParticipantDevice(); + + auto activeSpeaker = conferenceModel->getConference()->getScreenSharingParticipantDevice(); + if(!activeSpeaker) + activeSpeaker = conferenceModel->getConference()->getActiveSpeakerParticipantDevice(); mActiveSpeaker = get(activeSpeaker); mInitialized = true; } @@ -149,13 +148,14 @@ bool ParticipantDeviceListModel::add(std::shared_ptrscreenSharingEnabled()) - // mActiveSpeaker = deviceModel; - //else - mActiveSpeaker = get(mCallModel->getConferenceSharedModel()->getConference()->getActiveSpeakerParticipantDevice()); - if(!mActiveSpeaker && (mList.size() == 1 || (mList.size() == 2 && isMe(mList.front().objectCast()->getDevice())))) - mActiveSpeaker = mList.back().objectCast(); + + auto activeSpeaker = mCallModel->getConferenceSharedModel()->getConference()->getScreenSharingParticipantDevice(); + if(!activeSpeaker) + activeSpeaker = mCallModel->getConferenceSharedModel()->getConference()->getActiveSpeakerParticipantDevice(); + if(activeSpeaker) + mActiveSpeaker = get(activeSpeaker); + else if(!mActiveSpeaker && (mList.size() == 1 || (mList.size() == 2 && isMe(mList.front().objectCast()->getDevice())))) + mActiveSpeaker = mList.back().objectCast(); emit activeSpeakerChanged(); } return true; @@ -331,10 +331,11 @@ void ParticipantDeviceListModel::onParticipantDeviceIsSpeakingChanged(const std: emit participantSpeaking(device.get()); } void ParticipantDeviceListModel::onParticipantDeviceScreenSharingChanged(const std::shared_ptr & participantDevice){ -// TODO activeSpeaker - //auto activeSpeaker = mCallModel->getConferenceSharedModel()->getConference()->getScreenSharingParticipantDevice(); - //if(!activeSpeaker) - auto activeSpeaker = mCallModel->getConferenceSharedModel()->getConference()->getActiveSpeakerParticipantDevice(); + // getActiveSpeakerParticipantDevice is not synchronized with screen sharing. + // => if screen sharing is activated, use the argument as the active speaker. + auto activeSpeaker = participantDevice; + if(!activeSpeaker) + activeSpeaker = mCallModel->getConferenceSharedModel()->getConference()->getActiveSpeakerParticipantDevice(); qDebug() << "onParticipantDeviceScreenSharingChanged " << participantDevice.get() << " == " << get(participantDevice) << " ; " << activeSpeaker.get() << " == " << get(activeSpeaker) << " : " << (activeSpeaker ? activeSpeaker->getAddress()->asStringUriOnly().c_str() : "") << ", ScreenShared:" << participantDevice->screenSharingEnabled(); diff --git a/linphone-app/src/components/participant/ParticipantDeviceProxyModel.cpp b/linphone-app/src/components/participant/ParticipantDeviceProxyModel.cpp index c074fb48b..3f3968815 100644 --- a/linphone-app/src/components/participant/ParticipantDeviceProxyModel.cpp +++ b/linphone-app/src/components/participant/ParticipantDeviceProxyModel.cpp @@ -51,7 +51,7 @@ bool ParticipantDeviceProxyModel::lessThan (const QModelIndex &left, const QMode const ParticipantDeviceModel *deviceA = sourceModel()->data(left).value(); const ParticipantDeviceModel *deviceB = sourceModel()->data(right).value(); // 'me' at end (for grid). - return deviceB->isLocal() || !deviceA->isLocal() && deviceB->isMe() || left.row() < right.row(); + return deviceB->isLocal() || !deviceA->isLocal() && deviceB->isMe() || !deviceA->isLocal() && !deviceB->isMe() && left.row() < right.row(); } //---------------------------------------------------------------------------------