diff --git a/linphone-app/src/components/call/CallModel.cpp b/linphone-app/src/components/call/CallModel.cpp index e26fc6106..a76121298 100644 --- a/linphone-app/src/components/call/CallModel.cpp +++ b/linphone-app/src/components/call/CallModel.cpp @@ -625,6 +625,10 @@ void CallModel::setPausedByUser (bool status) { } // ----------------------------------------------------------------------------- +bool CallModel::getRemoteVideoEnabled () const { + shared_ptr params = mCall->getRemoteParams(); + return params && params->videoEnabled(); +} bool CallModel::getVideoEnabled () const { shared_ptr params = mCall->getCurrentParams(); diff --git a/linphone-app/src/components/call/CallModel.hpp b/linphone-app/src/components/call/CallModel.hpp index 7ee9de087..ad14da3be 100644 --- a/linphone-app/src/components/call/CallModel.hpp +++ b/linphone-app/src/components/call/CallModel.hpp @@ -132,6 +132,7 @@ public: Q_INVOKABLE bool transferTo (const QString &sipAddress); Q_INVOKABLE bool transferToAnother (const QString &peerAddress); + Q_INVOKABLE bool getRemoteVideoEnabled () const; Q_INVOKABLE void acceptVideoRequest (); Q_INVOKABLE void rejectVideoRequest (); diff --git a/linphone-app/src/components/participant/ParticipantModel.hpp b/linphone-app/src/components/participant/ParticipantModel.hpp index 9d1e08b5c..73a99c46b 100644 --- a/linphone-app/src/components/participant/ParticipantModel.hpp +++ b/linphone-app/src/components/participant/ParticipantModel.hpp @@ -39,8 +39,8 @@ public: ParticipantModel (std::shared_ptr linphoneParticipant, QObject *parent = nullptr); Q_PROPERTY(ContactModel *contactModel READ getContactModel CONSTANT) - Q_PROPERTY(QString sipAddress MEMBER mSipAddress READ getSipAddress WRITE setSipAddress NOTIFY sipAddressChanged) - Q_PROPERTY(bool adminStatus MEMBER mAdminStatus READ getAdminStatus WRITE setAdminStatus NOTIFY adminStatusChanged) + Q_PROPERTY(QString sipAddress READ getSipAddress WRITE setSipAddress NOTIFY sipAddressChanged) + Q_PROPERTY(bool adminStatus READ getAdminStatus WRITE setAdminStatus NOTIFY adminStatusChanged) Q_PROPERTY(QDateTime creationTime READ getCreationTime CONSTANT) Q_PROPERTY(bool focus READ isFocus CONSTANT) Q_PROPERTY(int securityLevel READ getSecurityLevel NOTIFY securityLevelChanged) diff --git a/linphone-app/src/components/settings/SettingsModel.cpp b/linphone-app/src/components/settings/SettingsModel.cpp index 857cba0ab..82d8c463d 100644 --- a/linphone-app/src/components/settings/SettingsModel.cpp +++ b/linphone-app/src/components/settings/SettingsModel.cpp @@ -350,9 +350,7 @@ void SettingsModel::setCaptureDevice (const QString &device) { CoreManager::getInstance()->getCore()->setCaptureDevice(devId); CoreManager::getInstance()->getCore()->setInputAudioDevice(*audioDevice); emit captureDeviceChanged(device); - if (mSimpleCaptureGraph && mSimpleCaptureGraph->isRunning()) { - createCaptureGraph(); - } + createCaptureGraph(); }else qWarning() << "Cannot set Capture device. The ID cannot be matched with an existant device : " << device; } @@ -376,9 +374,7 @@ void SettingsModel::setPlaybackDevice (const QString &device) { CoreManager::getInstance()->getCore()->setPlaybackDevice(devId); CoreManager::getInstance()->getCore()->setOutputAudioDevice(*audioDevice); emit playbackDeviceChanged(device); - if (mSimpleCaptureGraph && mSimpleCaptureGraph->isRunning()) { - createCaptureGraph(); - } + createCaptureGraph(); }else qWarning() << "Cannot set Playback device. The ID cannot be matched with an existant device : " << device; } @@ -1533,4 +1529,4 @@ bool SettingsModel::isReadOnly(const std::string& section, const std::string& na std::string SettingsModel::getEntryFullName(const std::string& section, const std::string& name) const { return isReadOnly(section, name)?name+"/readonly" : name; -} \ No newline at end of file +} diff --git a/linphone-app/src/components/sound-player/SoundPlayer.cpp b/linphone-app/src/components/sound-player/SoundPlayer.cpp index fae3b9806..eb8002dbe 100644 --- a/linphone-app/src/components/sound-player/SoundPlayer.cpp +++ b/linphone-app/src/components/sound-player/SoundPlayer.cpp @@ -138,7 +138,7 @@ void SoundPlayer::buildInternalPlayer () { SettingsModel *settingsModel = coreManager->getSettingsModel(); mInternalPlayer = coreManager->getCore()->createLocalPlayer( - Utils::appStringToCoreString(settingsModel->getPlaybackDevice()), "", nullptr + Utils::appStringToCoreString(mIsRinger ? settingsModel->getRingerDevice() : settingsModel->getPlaybackDevice()), "", nullptr ); if(mInternalPlayer) mInternalPlayer->addListener(mHandlers); diff --git a/linphone-app/src/components/sound-player/SoundPlayer.hpp b/linphone-app/src/components/sound-player/SoundPlayer.hpp index 7276deb55..c0293abb3 100644 --- a/linphone-app/src/components/sound-player/SoundPlayer.hpp +++ b/linphone-app/src/components/sound-player/SoundPlayer.hpp @@ -42,6 +42,7 @@ class SoundPlayer : public QObject { Q_PROPERTY(QString source READ getSource WRITE setSource NOTIFY sourceChanged) Q_PROPERTY(PlaybackState playbackState READ getPlaybackState WRITE setPlaybackState NOTIFY playbackStateChanged) Q_PROPERTY(int duration READ getDuration NOTIFY sourceChanged) + Q_PROPERTY(bool isRinger MEMBER mIsRinger) public: enum PlaybackState { @@ -92,6 +93,7 @@ private: QString mSource; PlaybackState mPlaybackState = StoppedState; + bool mIsRinger = false; bool mForceClose = false; QMutex mForceCloseMutex; diff --git a/linphone-app/src/utils/MediastreamerUtils.cpp b/linphone-app/src/utils/MediastreamerUtils.cpp index 13a36ab5e..74c5f3703 100644 --- a/linphone-app/src/utils/MediastreamerUtils.cpp +++ b/linphone-app/src/utils/MediastreamerUtils.cpp @@ -64,9 +64,22 @@ void SimpleCaptureGraph::init() { if (!playbackVolumeFilter) { playbackVolumeFilter = ms_factory_create_filter(msFactory, MS_VOLUME_ID); } + if(!resamplerFilter) + resamplerFilter = ms_factory_create_filter(msFactory, MS_RESAMPLE_ID); + int captureRate, playbackRate, captureChannels, playbackChannels; + ms_filter_call_method(audioCapture,MS_FILTER_GET_SAMPLE_RATE,&captureRate); + ms_filter_call_method(audioSink,MS_FILTER_GET_SAMPLE_RATE,&playbackRate); + ms_filter_call_method(audioCapture,MS_FILTER_GET_NCHANNELS,&captureChannels); + ms_filter_call_method(audioSink,MS_FILTER_GET_NCHANNELS,&playbackChannels); + + ms_filter_call_method(resamplerFilter,MS_FILTER_SET_SAMPLE_RATE,&captureRate); + ms_filter_call_method(resamplerFilter,MS_FILTER_SET_OUTPUT_SAMPLE_RATE,&playbackRate); + ms_filter_call_method(resamplerFilter,MS_FILTER_SET_NCHANNELS,&captureChannels); + ms_filter_call_method(resamplerFilter,MS_FILTER_SET_OUTPUT_NCHANNELS,&playbackChannels); ms_filter_link(audioCapture, 0, captureVolumeFilter, 0); - ms_filter_link(captureVolumeFilter, 0, playbackVolumeFilter, 0); + ms_filter_link(captureVolumeFilter, 0, resamplerFilter, 0); + ms_filter_link(resamplerFilter, 0, playbackVolumeFilter, 0); ms_filter_link(playbackVolumeFilter, 0, audioSink, 0); //Mute playback @@ -99,14 +112,18 @@ void SimpleCaptureGraph::destroy() { if (audioSink) ms_filter_unlink(playbackVolumeFilter, 0, audioSink, 0); - if (captureVolumeFilter && playbackVolumeFilter) - ms_filter_unlink(captureVolumeFilter, 0, playbackVolumeFilter, 0); + if (captureVolumeFilter && resamplerFilter) + ms_filter_unlink(captureVolumeFilter, 0, resamplerFilter, 0); + if (resamplerFilter && playbackVolumeFilter) + ms_filter_unlink(resamplerFilter, 0, playbackVolumeFilter, 0); if (audioCapture) ms_filter_unlink(audioCapture, 0, captureVolumeFilter, 0); if (playbackVolumeFilter) ms_filter_destroy(playbackVolumeFilter); if (captureVolumeFilter) ms_filter_destroy(captureVolumeFilter); + if (resamplerFilter) + ms_filter_destroy(resamplerFilter); if (audioSink) ms_filter_destroy(audioSink); if (audioCapture) @@ -117,6 +134,7 @@ void SimpleCaptureGraph::destroy() { ticker = nullptr; playbackVolumeFilter = nullptr; captureVolumeFilter = nullptr; + resamplerFilter = nullptr; audioSink = nullptr; audioCapture = nullptr; } diff --git a/linphone-app/src/utils/MediastreamerUtils.hpp b/linphone-app/src/utils/MediastreamerUtils.hpp index 0afa33d9d..74f48e842 100644 --- a/linphone-app/src/utils/MediastreamerUtils.hpp +++ b/linphone-app/src/utils/MediastreamerUtils.hpp @@ -91,6 +91,7 @@ namespace MediastreamerUtils { MSFilter *audioCapture = nullptr; MSFilter *captureVolumeFilter = nullptr; MSFilter *playbackVolumeFilter = nullptr; + MSFilter *resamplerFilter = nullptr; MSTicker *ticker = nullptr; MSSndCard *playbackCard = nullptr; MSSndCard *captureCard = nullptr; diff --git a/linphone-app/ui/modules/Linphone/Contact/Contact.qml b/linphone-app/ui/modules/Linphone/Contact/Contact.qml index bea9e8e51..715e90d72 100644 --- a/linphone-app/ui/modules/Linphone/Contact/Contact.qml +++ b/linphone-app/ui/modules/Linphone/Contact/Contact.qml @@ -79,12 +79,11 @@ Rectangle { } Icon{ - anchors.right: parent.right anchors.top:parent.top - anchors.topMargin: -5 + anchors.horizontalCenter: parent.right visible: entry!=undefined && entry.haveEncryption != undefined && entry.haveEncryption icon: entry?(entry.securityLevel === 2?'secure_level_1': entry.securityLevel===3? 'secure_level_2' : 'secure_level_unsafe'):'secure_level_unsafe' - iconSize:15 + iconSize: parent.height/2 } MouseArea{ anchors.fill: parent diff --git a/linphone-app/ui/modules/Linphone/Notifications/NotificationReceivedCall.qml b/linphone-app/ui/modules/Linphone/Notifications/NotificationReceivedCall.qml index 3f6a399e4..33f47746f 100644 --- a/linphone-app/ui/modules/Linphone/Notifications/NotificationReceivedCall.qml +++ b/linphone-app/ui/modules/Linphone/Notifications/NotificationReceivedCall.qml @@ -58,7 +58,7 @@ Notification { isCustom: true backgroundRadius: 90 colorSet: NotificationReceivedCallStyle.acceptVideoCall - visible: SettingsModel.videoSupported + visible: SettingsModel.videoSupported && notification.call.getRemoteVideoEnabled() onClicked: notification._close(notification.call.acceptWithVideo) } diff --git a/linphone-app/ui/modules/Linphone/View/ParticipantsView.qml b/linphone-app/ui/modules/Linphone/View/ParticipantsView.qml index 52e8ab242..2e74ab158 100644 --- a/linphone-app/ui/modules/Linphone/View/ParticipantsView.qml +++ b/linphone-app/ui/modules/Linphone/View/ParticipantsView.qml @@ -129,10 +129,9 @@ ScrollableListView { visible: modelData.secure>0 && (sipAddressesView.actions[index].secureIconVisibleHandler ? sipAddressesView.actions[index].secureIconVisibleHandler({sipAddres:$sipAddress}) : true) icon:modelData.secure === 2?'secure_level_2':'secure_level_1' - iconSize:15 - anchors.right:parent.right + iconSize:parent.height/2 anchors.top:parent.top - anchors.topMargin: -3 + anchors.horizontalCenter: parent.right } } } @@ -296,10 +295,9 @@ ScrollableListView { visible: modelData.secure>0 && (sipAddressesView.actions[index].secureIconVisibleHandler ? sipAddressesView.actions[index].secureIconVisibleHandler({sipAddres:$sipAddress}) : true) icon:modelData.secure === 2?'secure_level_2':'secure_level_1' - iconSize:15 - anchors.right:parent.right + iconSize: parent.height/2 anchors.top:parent.top - anchors.topMargin: -3 + anchors.horizontalCenter: parent.right } } } diff --git a/linphone-app/ui/modules/Linphone/View/SipAddressesView.qml b/linphone-app/ui/modules/Linphone/View/SipAddressesView.qml index 6beaf0d21..42723f659 100644 --- a/linphone-app/ui/modules/Linphone/View/SipAddressesView.qml +++ b/linphone-app/ui/modules/Linphone/View/SipAddressesView.qml @@ -133,10 +133,9 @@ ScrollableListView { (sipAddressesView.actions[index].secureIconVisibleHandler ? sipAddressesView.actions[index].secureIconVisibleHandler({ sipAddress : sipAddressesView.interpretableSipAddress}) : true) icon: 'secure_on' - iconSize:15 - anchors.right:parent.right + iconSize: parent.height/2 anchors.top:parent.top - anchors.topMargin: -3 + anchors.horizontalCenter: parent.right } } } @@ -304,10 +303,9 @@ ScrollableListView { (sipAddressesView.actions[index].secureIconVisibleHandler ? sipAddressesView.actions[index].secureIconVisibleHandler(sipAddressEntry.entry) : true) icon: 'secure_on' - iconSize:15 - anchors.right:parent.right + iconSize: parent.height/2 anchors.top:parent.top - anchors.topMargin: -3 + anchors.horizontalCenter: parent.right } } } diff --git a/linphone-app/ui/views/App/Main/ContactEdit.qml b/linphone-app/ui/views/App/Main/ContactEdit.qml index b29b73e41..60b7c9aeb 100644 --- a/linphone-app/ui/views/App/Main/ContactEdit.qml +++ b/linphone-app/ui/views/App/Main/ContactEdit.qml @@ -190,10 +190,9 @@ ColumnLayout { enabled: AccountSettingsModel.conferenceURI != '' Icon{ icon:'secure_level_1' - iconSize:15 - anchors.right:parent.right + iconSize:parent.height/2 anchors.top:parent.top - anchors.topMargin: -3 + anchors.horizontalCenter: parent.right } onClicked: {sipAddressesMenu.open(sipAddressesMenu.createSecureChatRoom)} diff --git a/linphone-app/ui/views/App/Main/Contacts.qml b/linphone-app/ui/views/App/Main/Contacts.qml index 1edd4c3a5..e46c9ced9 100644 --- a/linphone-app/ui/views/App/Main/Contacts.qml +++ b/linphone-app/ui/views/App/Main/Contacts.qml @@ -168,10 +168,9 @@ ColumnLayout { enabled: AccountSettingsModel.conferenceURI != '' Icon{ icon:'secure_level_1' - iconSize:15 - anchors.right:parent.right + iconSize:parent.height/2 anchors.top:parent.top - anchors.topMargin: -3 + anchors.horizontalCenter: parent.right } onClicked: {actions.itemAt(3).open()} tooltipMaxWidth: actionBar.width diff --git a/linphone-app/ui/views/App/Main/Conversation.qml b/linphone-app/ui/views/App/Main/Conversation.qml index f36af48ae..81423dd6e 100644 --- a/linphone-app/ui/views/App/Main/Conversation.qml +++ b/linphone-app/ui/views/App/Main/Conversation.qml @@ -282,10 +282,9 @@ ColumnLayout { onClicked: CallsListModel.launchChat(chatRoomModel.participants.addressesToString, 1) Icon{ icon:'secure_level_1' - iconSize:15 - anchors.right:parent.right + iconSize: parent.height/2 anchors.top:parent.top - anchors.topMargin: -3 + anchors.horizontalCenter: parent.right } } diff --git a/linphone-app/ui/views/App/Main/Dialogs/NewChatRoom.qml b/linphone-app/ui/views/App/Main/Dialogs/NewChatRoom.qml index 45b683e1d..d706fda24 100644 --- a/linphone-app/ui/views/App/Main/Dialogs/NewChatRoom.qml +++ b/linphone-app/ui/views/App/Main/Dialogs/NewChatRoom.qml @@ -220,12 +220,11 @@ DialogPlus { image:modelData.avatar Icon{ property int securityLevel : 2 - anchors.right: parent.right anchors.top:parent.top - anchors.topMargin: -5 + anchors.horizontalCenter: parent.right visible: UtilsCpp.hasCapability(modelData.sipAddress, LinphoneEnums.FriendCapabilityLimeX3Dh) icon: 'secure_on' - iconSize:20 + iconSize: parent.height/2 } } Text{ @@ -411,4 +410,4 @@ DialogPlus { } } } -} \ No newline at end of file +} diff --git a/linphone-app/ui/views/App/Main/Dialogs/ParticipantsDevices.qml b/linphone-app/ui/views/App/Main/Dialogs/ParticipantsDevices.qml index 4a942b52d..943e950f1 100644 --- a/linphone-app/ui/views/App/Main/Dialogs/ParticipantsDevices.qml +++ b/linphone-app/ui/views/App/Main/Dialogs/ParticipantsDevices.qml @@ -72,12 +72,11 @@ DialogPlus { ):'' Icon{ property int securityLevel : modelData.securityLevel - anchors.right: parent.right anchors.top:parent.top - anchors.topMargin: -5 + anchors.horizontalCenter: parent.right visible: modelData && securityLevel !== 1 icon: modelData?(securityLevel === 2?'secure_level_1': securityLevel===3? 'secure_level_2' : 'secure_level_unsafe'):'secure_level_unsafe' - iconSize:15 + iconSize: parent.height/2 Timer{// Workaround : no security events are send when device's security change. onTriggered: parent.securityLevel = modelData.securityLevel repeat:true diff --git a/linphone-app/ui/views/App/Main/HistoryView.qml b/linphone-app/ui/views/App/Main/HistoryView.qml index 0b70f5d5d..27e90d4f0 100644 --- a/linphone-app/ui/views/App/Main/HistoryView.qml +++ b/linphone-app/ui/views/App/Main/HistoryView.qml @@ -118,10 +118,9 @@ ColumnLayout { onClicked: CallsListModel.launchChat(historyView.peerAddress, 1) Icon{ icon:'secure_level_1' - iconSize:15 - anchors.right:parent.right + iconSize: parent.height/2 anchors.top:parent.top - anchors.topMargin: -3 + anchors.horizontalCenter: parent.right } } } diff --git a/linphone-app/ui/views/App/Settings/SettingsAudio.qml b/linphone-app/ui/views/App/Settings/SettingsAudio.qml index 9b04c0e48..f659e3edc 100644 --- a/linphone-app/ui/views/App/Settings/SettingsAudio.qml +++ b/linphone-app/ui/views/App/Settings/SettingsAudio.qml @@ -230,6 +230,7 @@ TabContainer { active: window.visible sourceComponent: SoundPlayer { source: SettingsModel.ringPath + isRinger: true } } } diff --git a/linphone-app/ui/views/App/Settings/SettingsSipAccounts.qml b/linphone-app/ui/views/App/Settings/SettingsSipAccounts.qml index 579a7c2f7..249269aef 100644 --- a/linphone-app/ui/views/App/Settings/SettingsSipAccounts.qml +++ b/linphone-app/ui/views/App/Settings/SettingsSipAccounts.qml @@ -144,7 +144,7 @@ TabContainer { title: qsTr('assistantTitle') width: parent.width - + visible: SettingsModel.useWebview() || SettingsModel.developerSettingsEnabled FormLine { FormGroup { label: 'Registration URL' @@ -155,6 +155,7 @@ TabContainer { onEditingFinished: SettingsModel.assistantRegistrationUrl = text } } + visible: SettingsModel.useWebview() } FormLine { @@ -167,6 +168,7 @@ TabContainer { onEditingFinished: SettingsModel.assistantLoginUrl = text } } + visible: SettingsModel.useWebview() } FormLine { diff --git a/linphone-app/ui/views/App/Settings/SettingsWindow.qml b/linphone-app/ui/views/App/Settings/SettingsWindow.qml index 91d4f0325..89e95ef6f 100644 --- a/linphone-app/ui/views/App/Settings/SettingsWindow.qml +++ b/linphone-app/ui/views/App/Settings/SettingsWindow.qml @@ -19,7 +19,10 @@ ApplicationWindow { title: qsTr('settingsTitle') - onClosing: SettingsModel.settingsWindowClosing() + onClosing: { + SettingsModel.settingsWindowClosing() + tabBar.setCurrentIndex(0) + } // --------------------------------------------------------------------------- diff --git a/linphone-sdk b/linphone-sdk index 00fd2d08b..f3daa534e 160000 --- a/linphone-sdk +++ b/linphone-sdk @@ -1 +1 @@ -Subproject commit 00fd2d08b3cc24365aba7407c3885e11cc120024 +Subproject commit f3daa534e402049c95b300d2bbdab485fdab2f3e