fix set audio only if video disabled in params
This commit is contained in:
parent
ebdefe835f
commit
9011106cc3
1 changed files with 7 additions and 5 deletions
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#include "core/path/Paths.hpp"
|
#include "core/path/Paths.hpp"
|
||||||
#include "model/core/CoreModel.hpp"
|
#include "model/core/CoreModel.hpp"
|
||||||
|
#include "model/setting/SettingsModel.hpp"
|
||||||
#include "tool/Utils.hpp"
|
#include "tool/Utils.hpp"
|
||||||
|
|
||||||
DEFINE_ABSTRACT_OBJECT(CallModel)
|
DEFINE_ABSTRACT_OBJECT(CallModel)
|
||||||
|
|
@ -129,7 +130,7 @@ void CallModel::activateLocalVideo(std::shared_ptr<linphone::CallParams> ¶ms
|
||||||
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(true);
|
params->enableVideo(SettingsModel::getInstance()->getVideoEnabled() && enable);
|
||||||
auto videoDirection = enable ? linphone::MediaDirection::SendRecv : linphone::MediaDirection::RecvOnly;
|
auto videoDirection = enable ? linphone::MediaDirection::SendRecv : linphone::MediaDirection::RecvOnly;
|
||||||
params->setVideoDirection(videoDirection);
|
params->setVideoDirection(videoDirection);
|
||||||
}
|
}
|
||||||
|
|
@ -280,7 +281,7 @@ void CallModel::updateConferenceVideoLayout() {
|
||||||
auto callParams = mMonitor->getParams();
|
auto callParams = mMonitor->getParams();
|
||||||
// auto settings = CoreManager::getInstance()->getSettingsModel();
|
// auto settings = CoreManager::getInstance()->getSettingsModel();
|
||||||
auto newLayout = LinphoneEnums::fromLinphone(callParams->getConferenceVideoLayout());
|
auto newLayout = LinphoneEnums::fromLinphone(callParams->getConferenceVideoLayout());
|
||||||
if (!callParams->videoEnabled()) newLayout = LinphoneEnums::ConferenceLayout::AudioOnly;
|
if (!SettingsModel::getInstance()->getVideoEnabled()) newLayout = LinphoneEnums::ConferenceLayout::AudioOnly;
|
||||||
if (!mConference) newLayout = LinphoneEnums::ConferenceLayout::ActiveSpeaker;
|
if (!mConference) newLayout = LinphoneEnums::ConferenceLayout::ActiveSpeaker;
|
||||||
if (mConferenceVideoLayout != newLayout) { // && !getPausedByUser()) { // Only update if not in pause.
|
if (mConferenceVideoLayout != newLayout) { // && !getPausedByUser()) { // Only update if not in pause.
|
||||||
// if (mMonitor->getConference()) {
|
// if (mMonitor->getConference()) {
|
||||||
|
|
@ -389,11 +390,12 @@ void CallModel::onStateChanged(const std::shared_ptr<linphone::Call> &call,
|
||||||
setConference(call->getConference());
|
setConference(call->getConference());
|
||||||
mDurationTimer.start();
|
mDurationTimer.start();
|
||||||
// After UpdatedByRemote, video direction could be changed.
|
// After UpdatedByRemote, video direction could be changed.
|
||||||
auto videoDirection = call->getCurrentParams()->getVideoDirection();
|
auto videoDirection = call->getParams()->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(videoDirection == linphone::MediaDirection::RecvOnly ||
|
emit remoteVideoEnabledChanged(remoteVideoDirection == linphone::MediaDirection::RecvOnly ||
|
||||||
videoDirection == 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) {
|
||||||
mDurationTimer.stop();
|
mDurationTimer.stop();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue