fix(src/components/call/CallModel): avoid video actions if the app was built without video support

This commit is contained in:
Ronan Abhamon 2017-06-12 15:31:55 +02:00
parent 667aa7e1c4
commit 80f964b2d5
2 changed files with 13 additions and 3 deletions

View file

@ -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);

View file

@ -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;