mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
Fix audio issues when using audio settings while being in call.
Media cards must not be used twice (capture card + call) else we will get latencies issues and bad echo calibrations in call. Force to close all capture graph when going in call.
This commit is contained in:
parent
683f6fc51c
commit
d243ffaa2e
5 changed files with 32 additions and 11 deletions
|
|
@ -93,6 +93,7 @@ void CallsListModel::askForAttendedTransfer (CallModel *callModel) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void CallsListModel::launchAudioCall (const QString &sipAddress, const QString& prepareTransfertAddress, const QHash<QString, QString> &headers) const {
|
||||
CoreManager::getInstance()->getSettingsModel()->stopCaptureGraphs();
|
||||
CoreManager::getInstance()->getTimelineListModel()->mAutoSelectAfterCreation = true;
|
||||
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
|
||||
|
||||
|
|
@ -133,6 +134,7 @@ void CallsListModel::launchAudioCall (const QString &sipAddress, const QString&
|
|||
}
|
||||
|
||||
void CallsListModel::launchSecureAudioCall (const QString &sipAddress, LinphoneEnums::MediaEncryption encryption, const QHash<QString, QString> &headers, const QString& prepareTransfertAddress) const {
|
||||
CoreManager::getInstance()->getSettingsModel()->stopCaptureGraphs();
|
||||
CoreManager::getInstance()->getTimelineListModel()->mAutoSelectAfterCreation = true;
|
||||
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
|
||||
|
||||
|
|
@ -172,6 +174,7 @@ void CallsListModel::launchSecureAudioCall (const QString &sipAddress, LinphoneE
|
|||
}
|
||||
|
||||
void CallsListModel::launchVideoCall (const QString &sipAddress, const QString& prepareTransfertAddress, const bool& autoSelectAfterCreation, QVariantMap options) const {
|
||||
CoreManager::getInstance()->getSettingsModel()->stopCaptureGraphs();
|
||||
CoreManager::getInstance()->getTimelineListModel()->mAutoSelectAfterCreation = autoSelectAfterCreation;
|
||||
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
|
||||
if (!CoreManager::getInstance()->getSettingsModel()->getVideoEnabled()) {
|
||||
|
|
|
|||
|
|
@ -343,10 +343,11 @@ void SettingsModel::createCaptureGraph() {
|
|||
mSimpleCaptureGraph->start();
|
||||
emit captureGraphRunningChanged(getCaptureGraphRunning());
|
||||
}
|
||||
void SettingsModel::startCaptureGraph(){
|
||||
if(!mSimpleCaptureGraph)
|
||||
createCaptureGraph();
|
||||
++mCaptureGraphListenerCount;
|
||||
void SettingsModel::startCaptureGraph() {
|
||||
if(!getIsInCall()) {
|
||||
if (!mSimpleCaptureGraph) createCaptureGraph();
|
||||
++mCaptureGraphListenerCount;
|
||||
}
|
||||
}
|
||||
void SettingsModel::stopCaptureGraph(){
|
||||
if(mCaptureGraphListenerCount > 0 ){
|
||||
|
|
@ -354,7 +355,13 @@ void SettingsModel::stopCaptureGraph(){
|
|||
deleteCaptureGraph();
|
||||
}
|
||||
}
|
||||
void SettingsModel::deleteCaptureGraph(){
|
||||
void SettingsModel::stopCaptureGraphs() {
|
||||
if (mCaptureGraphListenerCount > 0) {
|
||||
mCaptureGraphListenerCount = 0;
|
||||
deleteCaptureGraph();
|
||||
}
|
||||
}
|
||||
void SettingsModel::deleteCaptureGraph() {
|
||||
if (mSimpleCaptureGraph) {
|
||||
if (mSimpleCaptureGraph->isRunning()) {
|
||||
mSimpleCaptureGraph->stop();
|
||||
|
|
@ -374,9 +381,10 @@ void SettingsModel::accessAudioSettings() {
|
|||
emit playbackGainChanged(getPlaybackGain());
|
||||
emit captureGainChanged(getCaptureGain());
|
||||
|
||||
//if (!getIsInCall()) {
|
||||
// Media cards must not be used twice (capture card + call) else we will get latencies issues and bad echo calibrations in call.
|
||||
if (!getIsInCall()) {
|
||||
startCaptureGraph();
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsModel::closeAudioSettings() {
|
||||
|
|
@ -2054,11 +2062,15 @@ void SettingsModel::setDeveloperSettingsEnabled (bool status) {
|
|||
}
|
||||
|
||||
void SettingsModel::handleCallCreated(const shared_ptr<linphone::Call> &) {
|
||||
emit isInCallChanged(getIsInCall());
|
||||
bool isInCall = getIsInCall();
|
||||
if(isInCall) stopCaptureGraphs(); // Ensure to stop all graphs
|
||||
emit isInCallChanged(isInCall);
|
||||
}
|
||||
|
||||
void SettingsModel::handleCallStateChanged(const shared_ptr<linphone::Call> &, linphone::Call::State) {
|
||||
emit isInCallChanged(getIsInCall());
|
||||
bool isInCall = getIsInCall();
|
||||
if(isInCall) stopCaptureGraphs(); // Ensure to stop all graphs
|
||||
emit isInCallChanged(isInCall);
|
||||
}
|
||||
void SettingsModel::handleEcCalibrationResult(linphone::EcCalibratorStatus status, int delayMs){
|
||||
emit echoCancellationStatus((int)status, delayMs);
|
||||
|
|
|
|||
|
|
@ -335,7 +335,8 @@ public:
|
|||
// Audio. --------------------------------------------------------------------
|
||||
|
||||
Q_INVOKABLE void startCaptureGraph();
|
||||
Q_INVOKABLE void stopCaptureGraph();
|
||||
Q_INVOKABLE void stopCaptureGraph();;
|
||||
Q_INVOKABLE void stopCaptureGraphs();
|
||||
Q_INVOKABLE void resetCaptureGraph();
|
||||
void createCaptureGraph();
|
||||
void deleteCaptureGraph();
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@ DialogPlus {
|
|||
Component.onCompleted: {
|
||||
SettingsModel.stopCaptureGraph()
|
||||
SettingsModel.reloadDevices()
|
||||
SettingsModel.startCaptureGraph()
|
||||
if(!call)
|
||||
SettingsModel.startCaptureGraph()
|
||||
if( fixedSize){
|
||||
height = fitHeight
|
||||
width = fitWidth
|
||||
|
|
|
|||
|
|
@ -320,4 +320,8 @@ TabContainer {
|
|||
}
|
||||
}
|
||||
}
|
||||
Connections{
|
||||
target: SettingsModel
|
||||
onIsInCall: if(!SettingsModel.isInCall) SettingsModel.startCaptureGraph()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue