Upgrade to SDK 5.4.11

This commit is contained in:
Julien Wadel 2025-04-28 10:41:03 +02:00
parent b6ad444fd2
commit a1bfe9ec77
9 changed files with 58 additions and 43 deletions

View file

@ -170,7 +170,6 @@ static void cliInitiateConference(QHash<QString, QString> &args) {
}
}
shared_ptr<linphone::Conference> conference = core->getConference();
const QString id = args["conference-id"];
auto updateCallsWindow = []() {
@ -183,23 +182,20 @@ static void cliInitiateConference(QHash<QString, QString> &args) {
} else App::smartShowWindow(callsWindow);
};
shared_ptr<linphone::Conference> conference = core->searchConferenceByIdentifier(Utils::appStringToCoreString(id));
if (conference) {
if (conference->getId() == Utils::appStringToCoreString(id)) {
qInfo() << QStringLiteral("Conference `%1` already exists.").arg(id);
updateCallsWindow();
return;
}
qInfo() << QStringLiteral("Remove existing conference with id: `%1`.")
.arg(Utils::coreStringToAppString(conference->getId()));
core->terminateConference();
qInfo() << QStringLiteral("Conference `%1` already exists.").arg(id);
updateCallsWindow();
return;
}
qInfo() << QStringLiteral("Create conference with id: `%1`.").arg(id);
auto confParameters = core->createConferenceParams(conference);
confParameters->enableVideo(false); // Video is not yet fully supported by the application in conference
conference = core->createConferenceWithParams(confParameters);
conference->setId(Utils::appStringToCoreString(id));
auto confAddress = conference->getConferenceAddress()->clone();
confAddress->setHeader("conf-id", Utils::appStringToCoreString(id));
conference->setConferenceAddress(confAddress);
if (core->enterConference() == -1) {
qWarning() << QStringLiteral("Unable to join created conference: `%1`.").arg(id);

View file

@ -395,16 +395,14 @@ int CallsListModel::addAllToConference(){
void CallsListModel::mergeAll(){
auto core = CoreManager::getInstance()->getCore();
auto currentCalls = CoreManager::getInstance()->getCore()->getCalls();
shared_ptr<linphone::Conference> conference = core->getConference();
shared_ptr<linphone::Conference> conference;
// Search a managable conference from calls
if(!conference){
for(auto call : currentCalls){
auto dbConference = call->getConference();
if(dbConference && dbConference->getMe()->isAdmin()){
conference = dbConference;
break;
}
for(auto call : currentCalls){
auto dbConference = call->getConference();
if(dbConference && dbConference->getMe()->isAdmin()){
conference = dbConference;
break;
}
}
@ -563,15 +561,15 @@ static void joinConference (const shared_ptr<linphone::Call> &call) {
return;
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
if (!core->getConference()) {
if (!core->isInConference()) {
qWarning() << QStringLiteral("Not in a conference. => Responding to `join-conference` as a simple call...");
return;
}
shared_ptr<linphone::Conference> conference = core->getConference();
shared_ptr<linphone::Conference> conference = core->searchConferenceByIdentifier(call->getToHeader("conference-id"));
const QString conferenceId = Utils::coreStringToAppString(call->getToHeader("conference-id"));
if (conference->getId() != Utils::appStringToCoreString(conferenceId)) {
if (!conference) {
qWarning() << QStringLiteral("Trying to join conference with an invalid conference id: `%1`. Responding as a simple call...")
.arg(conferenceId);
return;

View file

@ -146,12 +146,14 @@ bool ConferenceHelperModel::ConferenceAddModel::removeFromConference (const QStr
// -----------------------------------------------------------------------------
void ConferenceHelperModel::ConferenceAddModel::update () {
shared_ptr<linphone::Conference> conference = mConferenceHelperModel->mCore->getConference();
shared_ptr<linphone::Conference> conference;
auto currentCall = CoreManager::getInstance()->getCore()->getCurrentCall();
bool enablingVideo = false;
if( currentCall )
enablingVideo = currentCall->getCurrentParams()->videoEnabled();
if( currentCall ) {
enablingVideo = currentCall->getCurrentParams()->videoEnabled();
conference = currentCall->getConference();
}
if(!conference){
auto parameters = mConferenceHelperModel->mCore->createConferenceParams(conference);
if(!CoreManager::getInstance()->getSettingsModel()->getVideoConferenceEnabled()) {

View file

@ -46,7 +46,7 @@ void ConferenceListener::onActiveSpeakerParticipantDevice(const std::shared_ptr<
emit activeSpeakerParticipantDevice(participantDevice);
}
void ConferenceListener::onParticipantAdded(const std::shared_ptr<linphone::Conference> & conference, const std::shared_ptr<const linphone::Participant> & participant){
void ConferenceListener::onParticipantAdded(const std::shared_ptr<linphone::Conference> & conference, const std::shared_ptr<linphone::Participant> & participant){
qDebug() << "onParticipantAdded: " << participant->getAddress()->asString().c_str();
emit participantAdded(participant);
}
@ -54,7 +54,7 @@ void ConferenceListener::onParticipantRemoved(const std::shared_ptr<linphone::Co
qDebug() << "onParticipantRemoved";
emit participantRemoved(participant);
}
void ConferenceListener::onParticipantDeviceAdded(const std::shared_ptr<linphone::Conference> & conference, const std::shared_ptr<const linphone::ParticipantDevice> & participantDevice){
void ConferenceListener::onParticipantDeviceAdded(const std::shared_ptr<linphone::Conference> & conference, const std::shared_ptr<linphone::ParticipantDevice> & participantDevice){
qDebug() << "onParticipantDeviceAdded";
qDebug() << "Me devices : " << conference->getMe()->getDevices().size();
if( conference->getMe()->getDevices().size() > 1)

View file

@ -36,10 +36,10 @@ public:
// LINPHONE LISTENERS
virtual void onActiveSpeakerParticipantDevice(const std::shared_ptr<linphone::Conference> & conference, const std::shared_ptr<const linphone::ParticipantDevice> & participantDevice) override;
virtual void onParticipantAdded(const std::shared_ptr<linphone::Conference> & conference, const std::shared_ptr<const linphone::Participant> & participant) override;
virtual void onParticipantAdded(const std::shared_ptr<linphone::Conference> & conference, const std::shared_ptr<linphone::Participant> & participant) override;
virtual void onParticipantRemoved(const std::shared_ptr<linphone::Conference> & conference, const std::shared_ptr<const linphone::Participant> & participant) override;
virtual void onParticipantAdminStatusChanged(const std::shared_ptr<linphone::Conference> & conference, const std::shared_ptr<const linphone::Participant> & participant) override;
virtual void onParticipantDeviceAdded(const std::shared_ptr<linphone::Conference> & conference, const std::shared_ptr<const linphone::ParticipantDevice> & participantDevice) override;
virtual void onParticipantDeviceAdded(const std::shared_ptr<linphone::Conference> & conference, const std::shared_ptr<linphone::ParticipantDevice> & participantDevice) override;
virtual void onParticipantDeviceRemoved(const std::shared_ptr<linphone::Conference> & conference, const std::shared_ptr<const linphone::ParticipantDevice> & participantDevice) override;
virtual void onParticipantDeviceStateChanged(const std::shared_ptr<linphone::Conference> & conference, const std::shared_ptr<const linphone::ParticipantDevice> & device, linphone::ParticipantDevice::State state) override;
virtual void onParticipantDeviceMediaCapabilityChanged(const std::shared_ptr<linphone::Conference> & conference, const std::shared_ptr<const linphone::ParticipantDevice> & device) override;

View file

@ -69,15 +69,25 @@ void ConferenceProxyModel::terminate () {
void ConferenceProxyModel::startRecording () {
if (mRecording)
return;
CoreManager *coreManager = CoreManager::getInstance();
auto currentCall = coreManager->getCore()->getCurrentCall();
if (!currentCall) {
qWarning() << "Cannot start record: No call is running";
return;
}
auto conference = currentCall->getConference();
if (!conference) {
qWarning() << "Cannot start record: Current call is not a conference";
return;
}
qInfo() << QStringLiteral("Start recording conference:") << this;
CoreManager *coreManager = CoreManager::getInstance();
mLastRecordFile =
QStringLiteral("%1%2.mkv")
.arg(coreManager->getSettingsModel()->getSavedCallsFolder())
.arg(QDateTime::currentDateTime().toString("yyyy-MM-dd_hh-mm-ss"));
coreManager->getCore()->startConferenceRecording(Utils::appStringToCoreString(mLastRecordFile) );
conference->startRecording(Utils::appStringToCoreString(mLastRecordFile) );
mRecording = true;
emit recordingChanged(true);
@ -86,12 +96,22 @@ void ConferenceProxyModel::startRecording () {
void ConferenceProxyModel::stopRecording () {
if (!mRecording)
return;
CoreManager *coreManager = CoreManager::getInstance();
auto currentCall = coreManager->getCore()->getCurrentCall();
if (!currentCall) {
qWarning() << "Cannot stop record: No call is running";
return;
}
auto conference = currentCall->getConference();
if (!conference) {
qWarning() << "Cannot stop record: Current call is not a conference";
return;
}
qInfo() << QStringLiteral("Stop recording conference:") << this;
mRecording = false;
CoreManager::getInstance()->getCore()->stopConferenceRecording();
conference->stopRecording();
App::getInstance()->getNotifier()->notifyRecordingCompleted(mLastRecordFile);
emit recordingChanged(false);

View file

@ -21,7 +21,7 @@
#include <QQmlApplicationEngine>
#include "app/App.hpp"
#include "components/core/CoreManager.hpp"
#include "ContactModel.hpp"
#include "VcardModel.hpp"
@ -42,12 +42,11 @@ ContactModel::ContactModel (VcardModel *vcardModel, QObject * parent) : QObject(
Q_CHECK_PTR(vcardModel);
Q_CHECK_PTR(vcardModel->mVcard);
Q_ASSERT(!vcardModel->mIsReadOnly);
mLinphoneFriend = linphone::Friend::newFromVcard(vcardModel->mVcard);
mLinphoneFriend->setData("contact-model", *this);
if(mLinphoneFriend)
qInfo() << QStringLiteral("Create contact from vcard:") << this << vcardModel;
else
mLinphoneFriend = CoreManager::getInstance()->getCore()->createFriendFromVcard(vcardModel->mVcard);
if(mLinphoneFriend) {
qInfo() << QStringLiteral("Create contact from vcard:") << this << vcardModel;
mLinphoneFriend->setData("contact-model", *this);
}else
qCritical() << QStringLiteral("Friend couldn't be created for vcard:") << this << vcardModel;
setVcardModelInternal(vcardModel);
}

View file

@ -45,7 +45,7 @@ RecorderModel* RecorderManager::getVocalRecorder(){
if( !mVocalRecorder) {
auto core = CoreManager::getInstance()->getCore();
std::shared_ptr<linphone::RecorderParams> params = core->createRecorderParams();
params->setFileFormat(linphone::Recorder::FileFormat::Mkv);
params->setFileFormat(linphone::MediaFileFormat::Mkv);
params->setVideoCodec("");
auto recorder = core->createRecorder(params);
if(recorder)

@ -1 +1 @@
Subproject commit 0acac761a66f8c1f748095d807d0c7c1ed1134cb
Subproject commit e1c2a336c2030d4523a3cc3d9127694a5272abe9