Simplify enabling video and fix not receiving video.
Update SDK for speedup startup.
This commit is contained in:
parent
5fc1296aa5
commit
a90a31955f
4 changed files with 10 additions and 51 deletions
|
|
@ -70,7 +70,7 @@ void CallModel::accept(bool withVideo) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
activateLocalVideo(params, mMonitor->getCurrentParams(), withVideo);
|
||||
activateLocalVideo(params, withVideo);
|
||||
mMonitor->acceptWithParams(params);
|
||||
emit localVideoEnabledChanged(withVideo);
|
||||
}
|
||||
|
|
@ -130,57 +130,19 @@ void CallModel::setSpeakerMuted(bool isMuted) {
|
|||
emit speakerMutedChanged(isMuted);
|
||||
}
|
||||
|
||||
void CallModel::activateLocalVideo(std::shared_ptr<linphone::CallParams> ¶ms,
|
||||
const std::shared_ptr<const linphone::CallParams> ¤tParams,
|
||||
bool enable) {
|
||||
void CallModel::activateLocalVideo(std::shared_ptr<linphone::CallParams> ¶ms, bool enable) {
|
||||
lInfo() << sLog()
|
||||
.arg("Updating call with video enabled and media direction set to %1")
|
||||
.arg((int)params->getVideoDirection());
|
||||
params->enableVideo(true);
|
||||
auto direction = currentParams ? currentParams->getVideoDirection() : params->getVideoDirection();
|
||||
auto videoDirection = linphone::MediaDirection::RecvOnly;
|
||||
if (enable) { // +Send
|
||||
switch (direction) {
|
||||
case linphone::MediaDirection::RecvOnly:
|
||||
videoDirection = linphone::MediaDirection::SendRecv;
|
||||
break;
|
||||
case linphone::MediaDirection::SendOnly:
|
||||
videoDirection = linphone::MediaDirection::SendOnly;
|
||||
break;
|
||||
case linphone::MediaDirection::SendRecv:
|
||||
videoDirection = linphone::MediaDirection::SendRecv;
|
||||
break;
|
||||
default:
|
||||
videoDirection = linphone::MediaDirection::SendOnly;
|
||||
}
|
||||
} else { // -Send
|
||||
switch (direction) {
|
||||
case linphone::MediaDirection::RecvOnly:
|
||||
videoDirection = linphone::MediaDirection::RecvOnly;
|
||||
break;
|
||||
case linphone::MediaDirection::SendOnly:
|
||||
videoDirection = linphone::MediaDirection::Inactive;
|
||||
break;
|
||||
case linphone::MediaDirection::SendRecv:
|
||||
videoDirection = linphone::MediaDirection::RecvOnly;
|
||||
break;
|
||||
default:
|
||||
videoDirection = linphone::MediaDirection::Inactive;
|
||||
}
|
||||
}
|
||||
/*
|
||||
auto videoDirection =
|
||||
!enabled ? linphone::MediaDirection::RecvOnly
|
||||
: direction == linphone::MediaDirection::RecvOnly //
|
||||
? linphone::MediaDirection::SendRecv
|
||||
: direction == linphone::MediaDirection::SendRecv || direction == linphone::MediaDirection::SendOnly
|
||||
? linphone::MediaDirection::RecvOnly
|
||||
: linphone::MediaDirection::SendOnly;
|
||||
*/
|
||||
auto videoDirection = enable ? linphone::MediaDirection::SendRecv : linphone::MediaDirection::RecvOnly;
|
||||
params->setVideoDirection(videoDirection);
|
||||
}
|
||||
|
||||
void CallModel::setLocalVideoEnabled(bool enabled) {
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
auto params = CoreModel::getInstance()->getCore()->createCallParams(mMonitor);
|
||||
activateLocalVideo(params, mMonitor->getCurrentParams(), enabled);
|
||||
activateLocalVideo(params, enabled);
|
||||
mMonitor->update(params);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -85,9 +85,7 @@ public:
|
|||
int getScreenSharingIndex() const;
|
||||
void setVideoSourceDescriptorModel(std::shared_ptr<VideoSourceDescriptorModel> model = nullptr);
|
||||
|
||||
static void activateLocalVideo(std::shared_ptr<linphone::CallParams> ¶ms,
|
||||
const std::shared_ptr<const linphone::CallParams> ¤tParams,
|
||||
bool enable);
|
||||
static void activateLocalVideo(std::shared_ptr<linphone::CallParams> ¶ms, bool enable);
|
||||
|
||||
void sendDtmf(const QString &dtmf);
|
||||
|
||||
|
|
|
|||
|
|
@ -167,11 +167,10 @@ bool ToolModel::createCall(const QString &sipAddress,
|
|||
SettingsModel::enableTones(core->getConfig(), true);
|
||||
}
|
||||
std::shared_ptr<linphone::CallParams> params = core->createCallParams(nullptr);
|
||||
CallModel::activateLocalVideo(params, nullptr, localVideoEnabled);
|
||||
CallModel::activateLocalVideo(params, localVideoEnabled);
|
||||
|
||||
bool micEnabled = options.contains("microEnabled") ? options["microEnabled"].toBool() : true;
|
||||
params->enableMic(micEnabled);
|
||||
params->enableVideo(localVideoEnabled);
|
||||
params->setMediaEncryption(mediaEncryption);
|
||||
if (Utils::coreStringToAppString(params->getRecordFile()).isEmpty()) {
|
||||
|
||||
|
|
|
|||
2
external/linphone-sdk
vendored
2
external/linphone-sdk
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit 8115b7aa8af46a67f2d9618bc651930c10b9fe20
|
||||
Subproject commit c8d895cb162e0d6782d339e2ea3950ba2b8ca3da
|
||||
Loading…
Reference in a new issue