From 1d2eefe72932c91448b685904e9870e1bda19b12 Mon Sep 17 00:00:00 2001 From: gaelle Date: Mon, 16 Feb 2026 17:27:44 +0100 Subject: [PATCH] disable camera when accepting audio call #LINQT-2422 force automatically_accept_direction to ReceiveOnly on migration fix enableVideo value --- Linphone/model/call/CallModel.cpp | 15 +++++++++++++-- Linphone/model/core/CoreModel.cpp | 4 ++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Linphone/model/call/CallModel.cpp b/Linphone/model/call/CallModel.cpp index db951ff13..3880fdb43 100644 --- a/Linphone/model/call/CallModel.cpp +++ b/Linphone/model/call/CallModel.cpp @@ -67,6 +67,11 @@ void CallModel::accept(bool withVideo) { } } activateLocalVideo(params, withVideo); + params->enableCamera(withVideo); + lInfo() << log() + .arg("Accept call with params : enableVideo = %1 | enableCamera = %2") + .arg(params->videoEnabled()) + .arg(params->cameraEnabled()); mMonitor->acceptWithParams(params); emit localVideoEnabledChanged(withVideo); emit cameraEnabledChanged(withVideo && params->cameraEnabled()); @@ -144,12 +149,17 @@ bool CallModel::videoEnabled() const { void CallModel::activateLocalVideo(std::shared_ptr ¶ms, bool enable) { lInfo() << sLog() - .arg("Updating call with video enabled and media direction set to %1") + .arg("Updating call with video enabled = %1 and media direction set to %2") + .arg(params->videoEnabled()) .arg((int)params->getVideoDirection()); params->enableVideo(SettingsModel::getInstance()->getVideoEnabled()); auto videoDirection = params->getVideoDirection(); params->setVideoDirection(enable || params->screenSharingEnabled() ? linphone::MediaDirection::SendRecv : linphone::MediaDirection::RecvOnly); + lInfo() << sLog() + .arg("Call updated with video enabled = %1 media direction set to %2") + .arg(params->videoEnabled()) + .arg((int)params->getVideoDirection()); } void CallModel::setLocalVideoEnabled(bool enabled) { @@ -459,7 +469,8 @@ void CallModel::onStateChanged(const std::shared_ptr &call, auto params = call->getParams(); auto videoDirection = params->getVideoDirection(); auto remoteVideoDirection = call->getRemoteParams()->getVideoDirection(); - lInfo() << log().arg("Camera enabled changed") << params->cameraEnabled(); + lInfo() << log().arg("State changed, camera enabled =") << params->cameraEnabled() + << "| video direction =" << (int)videoDirection; emit localVideoEnabledChanged(videoDirection == linphone::MediaDirection::SendOnly || videoDirection == linphone::MediaDirection::SendRecv); emit cameraEnabledChanged((videoDirection == linphone::MediaDirection::SendOnly || diff --git a/Linphone/model/core/CoreModel.cpp b/Linphone/model/core/CoreModel.cpp index 32cb83da7..54dd1b039 100644 --- a/Linphone/model/core/CoreModel.cpp +++ b/Linphone/model/core/CoreModel.cpp @@ -356,8 +356,8 @@ void CoreModel::migrate() { // these when core is ready. if (!config->hasEntry("video", "automatically_accept")) config->setInt("video", "automatically_accept", 1); if (!config->hasEntry("video", "automatically_initiate")) config->setInt("video", "automatically_initiate", 0); - if (!config->hasEntry("video", "automatically_accept_direction")) - config->setInt("video", "automatically_accept_direction", 2); + // Force automatically accept direction to receive only for 6.x version for asymetrical video + config->setInt("video", "automatically_accept_direction", 2); lInfo() << log().arg("Migrating) Video Policy for version 7."); }