fix #LINQT-1836 microphone muted in conference

This commit is contained in:
Gaelle Braud 2025-07-28 17:18:08 +02:00
parent 2e0d963bd2
commit aae8e7b63e
2 changed files with 30 additions and 27 deletions

View file

@ -107,8 +107,6 @@ CallCore::CallCore(const std::shared_ptr<linphone::Call> &call) : QObject(nullpt
mCallModel->setSelf(mCallModel); mCallModel->setSelf(mCallModel);
mDuration = call->getDuration(); mDuration = call->getDuration();
mIsStarted = mDuration > 0; mIsStarted = mDuration > 0;
mMicrophoneMuted = call->getMicrophoneMuted();
mSpeakerMuted = call->getSpeakerMuted();
auto videoDirection = call->getParams()->getVideoDirection(); auto videoDirection = call->getParams()->getVideoDirection();
mLocalVideoEnabled = mLocalVideoEnabled =
videoDirection == linphone::MediaDirection::SendOnly || videoDirection == linphone::MediaDirection::SendRecv; videoDirection == linphone::MediaDirection::SendOnly || videoDirection == linphone::MediaDirection::SendRecv;
@ -158,6 +156,8 @@ CallCore::CallCore(const std::shared_ptr<linphone::Call> &call) : QObject(nullpt
if (mIsConference) { if (mIsConference) {
mConference = ConferenceCore::create(conference); mConference = ConferenceCore::create(conference);
} }
mMicrophoneMuted = conference ? conference->getMicrophoneMuted() : call->getMicrophoneMuted();
mSpeakerMuted = call->getSpeakerMuted();
mPaused = mState == LinphoneEnums::CallState::Pausing || mState == LinphoneEnums::CallState::Paused || mPaused = mState == LinphoneEnums::CallState::Pausing || mState == LinphoneEnums::CallState::Paused ||
mState == LinphoneEnums::CallState::PausedByRemote; mState == LinphoneEnums::CallState::PausedByRemote;
@ -208,10 +208,11 @@ void CallCore::setSelf(QSharedPointer<CallCore> me) {
mCallModelConnection->invokeToCore([this, recording]() { mCallModelConnection->invokeToCore([this, recording]() {
setRecording(recording); setRecording(recording);
if (recording == false) { if (recording == false) {
//: "Enregistrement terminé" //: "Enregistrement terminé"
Utils::showInformationPopup(tr("call_record_end_message"), Utils::showInformationPopup(tr("call_record_end_message"),
//: "L'appel a été enregistré dans le fichier : %1" //: "L'appel a été enregistré dans le fichier : %1"
tr("call_record_saved_in_file_message").arg(QString::fromStdString(mCallModel->getRecordFile())), tr("call_record_saved_in_file_message")
.arg(QString::fromStdString(mCallModel->getRecordFile())),
true, App::getInstance()->getCallsWindow()); true, App::getInstance()->getCallsWindow());
} }
}); });
@ -308,8 +309,8 @@ void CallCore::setSelf(QSharedPointer<CallCore> me) {
[this, call, encryption, tokenVerified, localToken, remoteTokens, isCaseMismatch]() { [this, call, encryption, tokenVerified, localToken, remoteTokens, isCaseMismatch]() {
setLocalToken(localToken); setLocalToken(localToken);
setRemoteTokens(remoteTokens); setRemoteTokens(remoteTokens);
setIsMismatch(isCaseMismatch); setIsMismatch(isCaseMismatch);
setTokenVerified(tokenVerified); setTokenVerified(tokenVerified);
setEncryption(encryption); setEncryption(encryption);
}); });
auto mediaEncryption = call->getParams()->getMediaEncryption(); auto mediaEncryption = call->getParams()->getMediaEncryption();
@ -321,7 +322,7 @@ void CallCore::setSelf(QSharedPointer<CallCore> me) {
zrtpStats.mHashAlgorithm = Utils::coreStringToAppString(stats->getZrtpHashAlgo()); zrtpStats.mHashAlgorithm = Utils::coreStringToAppString(stats->getZrtpHashAlgo());
zrtpStats.mAuthenticationAlgorithm = Utils::coreStringToAppString(stats->getZrtpAuthTagAlgo()); zrtpStats.mAuthenticationAlgorithm = Utils::coreStringToAppString(stats->getZrtpAuthTagAlgo());
zrtpStats.mSasAlgorithm = Utils::coreStringToAppString(stats->getZrtpSasAlgo()); zrtpStats.mSasAlgorithm = Utils::coreStringToAppString(stats->getZrtpSasAlgo());
zrtpStats.mIsPostQuantum = stats->isZrtpKeyAgreementAlgoPostQuantum(); zrtpStats.mIsPostQuantum = stats->isZrtpKeyAgreementAlgoPostQuantum();
mCallModelConnection->invokeToCore([this, zrtpStats]() { setZrtpStats(zrtpStats); }); mCallModelConnection->invokeToCore([this, zrtpStats]() { setZrtpStats(zrtpStats); });
} }
}); });
@ -388,23 +389,23 @@ void CallCore::setSelf(QSharedPointer<CallCore> me) {
auto codecType = playloadType ? playloadType->getMimeType() : ""; auto codecType = playloadType ? playloadType->getMimeType() : "";
auto codecRate = playloadType ? playloadType->getClockRate() / 1000 : 0; auto codecRate = playloadType ? playloadType->getClockRate() / 1000 : 0;
audioStats.mCodec = audioStats.mCodec =
//: "Codec: %1 / %2 kHz" //: "Codec: %1 / %2 kHz"
tr("call_stats_codec_label").arg(Utils::coreStringToAppString(codecType)).arg(codecRate); tr("call_stats_codec_label").arg(Utils::coreStringToAppString(codecType)).arg(codecRate);
auto linAudioStats = call->getAudioStats(); auto linAudioStats = call->getAudioStats();
if (linAudioStats) { if (linAudioStats) {
//: "Bande passante : %1 %2 kbits/s %3 %4 kbits/s" //: "Bande passante : %1 %2 kbits/s %3 %4 kbits/s"
audioStats.mBandwidth = tr("call_stats_bandwidth_label") audioStats.mBandwidth = tr("call_stats_bandwidth_label")
.arg("") .arg("")
.arg(round(linAudioStats->getUploadBandwidth())) .arg(round(linAudioStats->getUploadBandwidth()))
.arg("") .arg("")
.arg(round(linAudioStats->getDownloadBandwidth())); .arg(round(linAudioStats->getDownloadBandwidth()));
//: "Taux de perte: %1% %2%" //: "Taux de perte: %1% %2%"
audioStats.mLossRate = tr("call_stats_loss_rate_label") audioStats.mLossRate = tr("call_stats_loss_rate_label")
.arg(linAudioStats->getSenderLossRate()) .arg(linAudioStats->getSenderLossRate())
.arg(linAudioStats->getReceiverLossRate()); .arg(linAudioStats->getReceiverLossRate());
//: "Tampon de gigue: %1 ms" //: "Tampon de gigue: %1 ms"
audioStats.mJitterBufferSize = audioStats.mJitterBufferSize =
tr("call_stats_jitter_buffer_label").arg(linAudioStats->getJitterBufferSizeMs()); tr("call_stats_jitter_buffer_label").arg(linAudioStats->getJitterBufferSizeMs());
} }
setAudioStats(audioStats); setAudioStats(audioStats);
} else if (stats->getType() == linphone::StreamType::Video) { } else if (stats->getType() == linphone::StreamType::Video) {
@ -414,15 +415,15 @@ void CallCore::setSelf(QSharedPointer<CallCore> me) {
auto codecType = playloadType ? playloadType->getMimeType() : ""; auto codecType = playloadType ? playloadType->getMimeType() : "";
auto codecRate = playloadType ? playloadType->getClockRate() / 1000 : 0; auto codecRate = playloadType ? playloadType->getClockRate() / 1000 : 0;
videoStats.mCodec = videoStats.mCodec =
tr("call_stats_codec_label").arg(Utils::coreStringToAppString(codecType)).arg(codecRate); tr("call_stats_codec_label").arg(Utils::coreStringToAppString(codecType)).arg(codecRate);
auto linVideoStats = call->getVideoStats(); auto linVideoStats = call->getVideoStats();
if (stats) { if (stats) {
videoStats.mBandwidth = tr("call_stats_bandwidth_label") videoStats.mBandwidth = tr("call_stats_bandwidth_label")
.arg("") .arg("")
.arg(round(linVideoStats->getUploadBandwidth())) .arg(round(linVideoStats->getUploadBandwidth()))
.arg("") .arg("")
.arg(round(linVideoStats->getDownloadBandwidth())); .arg(round(linVideoStats->getDownloadBandwidth()));
videoStats.mLossRate = tr("call_stats_loss_rate_label") videoStats.mLossRate = tr("call_stats_loss_rate_label")
.arg(linVideoStats->getSenderLossRate()) .arg(linVideoStats->getSenderLossRate())
.arg(linVideoStats->getReceiverLossRate()); .arg(linVideoStats->getReceiverLossRate());
} }
@ -430,14 +431,14 @@ void CallCore::setSelf(QSharedPointer<CallCore> me) {
params->getSentVideoDefinition() ? params->getSentVideoDefinition()->getName() : ""; params->getSentVideoDefinition() ? params->getSentVideoDefinition()->getName() : "";
auto receivedResolution = auto receivedResolution =
params->getReceivedVideoDefinition() ? params->getReceivedVideoDefinition()->getName() : ""; params->getReceivedVideoDefinition() ? params->getReceivedVideoDefinition()->getName() : "";
//: "Définition vidéo : %1 %2 %3 %4" //: "Définition vidéo : %1 %2 %3 %4"
videoStats.mResolution = tr("call_stats_resolution_label") videoStats.mResolution = tr("call_stats_resolution_label")
.arg("", Utils::coreStringToAppString(sentResolution), "", .arg("", Utils::coreStringToAppString(sentResolution), "",
Utils::coreStringToAppString(receivedResolution)); Utils::coreStringToAppString(receivedResolution));
auto sentFps = params->getSentFramerate(); auto sentFps = params->getSentFramerate();
auto receivedFps = params->getReceivedFramerate(); auto receivedFps = params->getReceivedFramerate();
//: "FPS : %1 %2 %3 %4" //: "FPS : %1 %2 %3 %4"
videoStats.mFps = tr("call_stats_fps_label").arg("").arg(sentFps).arg("").arg(receivedFps); videoStats.mFps = tr("call_stats_fps_label").arg("").arg(sentFps).arg("").arg(receivedFps);
setVideoStats(videoStats); setVideoStats(videoStats);
} }
}); });

View file

@ -116,8 +116,10 @@ void CallModel::terminateAllCalls() {
void CallModel::setMicrophoneMuted(bool isMuted) { void CallModel::setMicrophoneMuted(bool isMuted) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO)); mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mMonitor->setMicrophoneMuted(isMuted); if (mMonitor->getConference()) mMonitor->getConference()->setMicrophoneMuted(isMuted);
emit microphoneMutedChanged(isMuted); else mMonitor->setMicrophoneMuted(isMuted);
emit microphoneMutedChanged(mMonitor->getConference() ? mMonitor->getConference()->getMicrophoneMuted()
: mMonitor->getMicrophoneMuted());
} }
void CallModel::setSpeakerMuted(bool isMuted) { void CallModel::setSpeakerMuted(bool isMuted) {