mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-07 14:44:01 +00:00
fix(src/components/call/CallModel): avoid video actions if the app was built without video support
This commit is contained in:
parent
667aa7e1c4
commit
80f964b2d5
2 changed files with 13 additions and 3 deletions
|
|
@ -435,6 +435,12 @@ bool CallModel::getVideoEnabled () const {
|
|||
}
|
||||
|
||||
void CallModel::setVideoEnabled (bool status) {
|
||||
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
|
||||
if (!core->videoSupported()) {
|
||||
qWarning() << QStringLiteral("Unable to update video call property. (Video not supported.)");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (mCall->getState()) {
|
||||
case linphone::CallStateConnected:
|
||||
case linphone::CallStateStreamsRunning:
|
||||
|
|
@ -445,7 +451,6 @@ void CallModel::setVideoEnabled (bool status) {
|
|||
if (status == getVideoEnabled())
|
||||
return;
|
||||
|
||||
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
|
||||
shared_ptr<linphone::CallParams> params = core->createCallParams(mCall);
|
||||
params->enableVideo(status);
|
||||
|
||||
|
|
|
|||
|
|
@ -93,8 +93,8 @@ void CallsListModel::askForTransfer (CallModel *callModel) {
|
|||
|
||||
void CallsListModel::launchAudioCall (const QString &sipUri) const {
|
||||
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
|
||||
shared_ptr<linphone::Address> address = core->interpretUrl(::Utils::appStringToCoreString(sipUri));
|
||||
|
||||
shared_ptr<linphone::Address> address = core->interpretUrl(::Utils::appStringToCoreString(sipUri));
|
||||
if (!address)
|
||||
return;
|
||||
|
||||
|
|
@ -107,8 +107,13 @@ void CallsListModel::launchAudioCall (const QString &sipUri) const {
|
|||
|
||||
void CallsListModel::launchVideoCall (const QString &sipUri) const {
|
||||
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
|
||||
shared_ptr<linphone::Address> address = core->interpretUrl(::Utils::appStringToCoreString(sipUri));
|
||||
if (!core->videoSupported()) {
|
||||
qWarning() << QStringLiteral("Unable to launch video call. (Video not supported.) Launching audio call...");
|
||||
launchAudioCall(sipUri);
|
||||
return;
|
||||
}
|
||||
|
||||
shared_ptr<linphone::Address> address = core->interpretUrl(::Utils::appStringToCoreString(sipUri));
|
||||
if (!address)
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue