mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 03:18:07 +00:00
Add support of Jabra headsets via the hidapi library.
This commit is contained in:
parent
0cf3938dc3
commit
befa4a2635
4 changed files with 80 additions and 4 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2010-2024 Belledonne Communications SARL.
|
||||
* Copyright (c) 2010-2026 Belledonne Communications SARL.
|
||||
*
|
||||
* This file is part of linphone-desktop
|
||||
* (see https://www.linphone.org).
|
||||
|
|
@ -28,6 +28,8 @@
|
|||
#include "tool/Utils.hpp"
|
||||
#include "tool/thread/SafeConnection.hpp"
|
||||
|
||||
#include <QQuickWindow>
|
||||
|
||||
DEFINE_ABSTRACT_OBJECT(CallCore)
|
||||
|
||||
/***********************************************************************/
|
||||
|
|
@ -449,6 +451,44 @@ void CallCore::setSelf(QSharedPointer<CallCore> me) {
|
|||
setVideoStats(videoStats);
|
||||
}
|
||||
});
|
||||
|
||||
mCallModelConnection->makeConnectToModel(&CallModel::headsetAnswerCallRequested, [this]() {
|
||||
mCallModelConnection->invokeToCore([this]() {
|
||||
const auto callList = App::getInstance()->getCallList();
|
||||
const auto currentPendingCall = callList->getFirstIncommingPendingCall();
|
||||
if (!currentPendingCall.isNull()) {
|
||||
const auto gui = new CallGui(currentPendingCall);
|
||||
Utils::openCallsWindow(gui);
|
||||
currentPendingCall->lAccept(false);
|
||||
}
|
||||
});
|
||||
});
|
||||
mCallModelConnection->makeConnectToModel(&CallModel::headsetEndCallRequested, [this]() {
|
||||
mCallModelConnection->invokeToCore([this]() {
|
||||
const auto window = Utils::getOrCreateCallsWindow();
|
||||
window->setProperty("callTerminatedByUser", true);
|
||||
lTerminate();
|
||||
});
|
||||
});
|
||||
mCallModelConnection->makeConnectToModel(&CallModel::headsetHoldCallRequested, [this]() {
|
||||
mCallModelConnection->invokeToCore([this]() { lSetPaused(true); });
|
||||
});
|
||||
mCallModelConnection->makeConnectToModel(&CallModel::headsetMicrophoneMuteToggled, [this](bool mute) {
|
||||
mCallModelConnection->invokeToCore([this, mute]() { lSetMicrophoneMuted(mute); });
|
||||
});
|
||||
mCallModelConnection->makeConnectToModel(&CallModel::headsetRejectCallRequested, [this]() {
|
||||
mCallModelConnection->invokeToCore([this]() {
|
||||
const auto callList = App::getInstance()->getCallList();
|
||||
const auto currentPendingCall = callList->getFirstIncommingPendingCall();
|
||||
if (!currentPendingCall.isNull()) {
|
||||
currentPendingCall->lDecline();
|
||||
}
|
||||
});
|
||||
});
|
||||
mCallModelConnection->makeConnectToModel(&CallModel::headsetResumeCallRequested, [this]() {
|
||||
mCallModelConnection->invokeToCore([this]() { lSetPaused(false); });
|
||||
});
|
||||
|
||||
if (mShouldFindRemoteFriend) findRemoteFriend(me);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2010-2024 Belledonne Communications SARL.
|
||||
* Copyright (c) 2010-2026 Belledonne Communications SARL.
|
||||
*
|
||||
* This file is part of linphone-desktop
|
||||
* (see https://www.linphone.org).
|
||||
|
|
@ -529,3 +529,27 @@ void CallModel::onRemoteRecording(const std::shared_ptr<linphone::Call> &call, b
|
|||
void CallModel::onAuthenticationTokenVerified(const std::shared_ptr<linphone::Call> &call, bool verified) {
|
||||
emit authenticationTokenVerified(call, verified);
|
||||
}
|
||||
|
||||
void CallModel::onHeadsetAnswerCallRequested(const std::shared_ptr<linphone::Call> &call) {
|
||||
emit headsetAnswerCallRequested();
|
||||
}
|
||||
|
||||
void CallModel::onHeadsetEndCallRequested(const std::shared_ptr<linphone::Call> &call) {
|
||||
emit headsetEndCallRequested();
|
||||
}
|
||||
|
||||
void CallModel::onHeadsetHoldCallRequested(const std::shared_ptr<linphone::Call> &call) {
|
||||
emit headsetHoldCallRequested();
|
||||
}
|
||||
|
||||
void CallModel::onHeadsetMicrophoneMuteToggled(const std::shared_ptr<linphone::Call> &call, bool mute) {
|
||||
emit headsetMicrophoneMuteToggled(mute);
|
||||
}
|
||||
|
||||
void CallModel::onHeadsetRejectCallRequested(const std::shared_ptr<linphone::Call> &call) {
|
||||
emit headsetRejectCallRequested();
|
||||
}
|
||||
|
||||
void CallModel::onHeadsetResumeCallRequested(const std::shared_ptr<linphone::Call> &call) {
|
||||
emit headsetResumeCallRequested();
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2010-2024 Belledonne Communications SARL.
|
||||
* Copyright (c) 2010-2026 Belledonne Communications SARL.
|
||||
*
|
||||
* This file is part of linphone-desktop
|
||||
* (see https://www.linphone.org).
|
||||
|
|
@ -156,6 +156,12 @@ private:
|
|||
const std::shared_ptr<linphone::AudioDevice> &audioDevice) override;
|
||||
virtual void onRemoteRecording(const std::shared_ptr<linphone::Call> &call, bool recording) override;
|
||||
virtual void onAuthenticationTokenVerified(const std::shared_ptr<linphone::Call> &call, bool verified) override;
|
||||
virtual void onHeadsetAnswerCallRequested(const std::shared_ptr<linphone::Call> &call) override;
|
||||
virtual void onHeadsetEndCallRequested(const std::shared_ptr<linphone::Call> &call) override;
|
||||
virtual void onHeadsetHoldCallRequested(const std::shared_ptr<linphone::Call> &call) override;
|
||||
virtual void onHeadsetMicrophoneMuteToggled(const std::shared_ptr<linphone::Call> &call, bool mute) override;
|
||||
virtual void onHeadsetRejectCallRequested(const std::shared_ptr<linphone::Call> &call) override;
|
||||
virtual void onHeadsetResumeCallRequested(const std::shared_ptr<linphone::Call> &call) override;
|
||||
|
||||
signals:
|
||||
void dtmfReceived(const std::shared_ptr<linphone::Call> &call, int dtmf);
|
||||
|
|
@ -185,6 +191,12 @@ signals:
|
|||
const std::shared_ptr<linphone::AudioDevice> &audioDevice);
|
||||
void remoteRecording(const std::shared_ptr<linphone::Call> &call, bool recording);
|
||||
void authenticationTokenVerified(const std::shared_ptr<linphone::Call> &call, bool verified);
|
||||
void headsetAnswerCallRequested();
|
||||
void headsetEndCallRequested();
|
||||
void headsetHoldCallRequested();
|
||||
void headsetMicrophoneMuteToggled(bool mute);
|
||||
void headsetRejectCallRequested();
|
||||
void headsetResumeCallRequested();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
2
external/linphone-sdk
vendored
2
external/linphone-sdk
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit 48f6fdf27e0810b5b0011aa02d41b95da0ae6a56
|
||||
Subproject commit dc5d0d260cc5db90dc4d7dcb49780a12aaada33b
|
||||
Loading…
Add table
Reference in a new issue