Local Address, meeting dates, carshes on meeting and dial-out.

This commit is contained in:
Julien Wadel 2024-04-10 10:27:37 +02:00
parent 06a80173e6
commit 22b3e80717
16 changed files with 74 additions and 45 deletions

View file

@ -57,6 +57,7 @@ endif()
set(CMAKE_INSTALL_PREFIX "${APPLICATION_OUTPUT_DIR}")
if( APPLE )
set(LINPHONEAPP_MACOS_ARCHS "x86_64" CACHE STRING "MacOS architectures to build: comma-separated list of values in [arm64, x86_64]")
set(LINPHONESDK_BUILD_TYPE "Default")#Using Mac will remove all SDK targets.
set(ENABLE_FAT_BINARY "ON") # Disable XCFrameworks as it is not supported.
@ -66,15 +67,11 @@ if( APPLE )
set(CMAKE_INSTALL_DATAROOTDIR "${APPLICATION_NAME}.app/Contents/Resources/share")
if( NOT CMAKE_OSX_DEPLOYMENT_TARGET)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15")#Qt: 'path' is unavailable: introduced in macOS 10.15
endif()
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm64")# TODO: add universal build
set(LINPHONESDK_MACOS_ARCHS "x86_64" CACHE STRING "MacOS architectures to build for: comma-separated list of values in [x86_64]")
else()
set(LINPHONESDK_MACOS_ARCHS "x86_64" CACHE STRING "MacOS architectures to build for: comma-separated list of values in [x86_64]")
#set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15")#Qt: 'path' is unavailable: introduced in macOS 10.15
set(CMAKE_OSX_DEPLOYMENT_TARGET "12.3")#ScreenSharing: 'SCStreamConfiguration' has been introduced in macOS 12.3
endif()
set(LINPHONESDK_MACOS_ARCHS ${LINPHONEAPP_MACOS_ARCHS})
set(CMAKE_OSX_ARCHITECTURES ${LINPHONESDK_MACOS_ARCHS} CACHE STRING "")
set(CMAKE_SYSTEM_PROCESSOR "x86_64")
elseif(WIN32)
set(LINPHONESDK_BUILD_TYPE "Default")
else()
@ -186,12 +183,11 @@ set(ENABLE_CSHARP_WRAPPER OFF CACHE BOOL "Build the CSharp wrapper for Liblinpho
set(ENABLE_THEORA OFF)
set(ENABLE_QT_GL ${ENABLE_VIDEO})
# Qt5.13 because of Spitview
#find_package(Qt5 5.13 COMPONENTS Core REQUIRED)
find_package(Qt6 REQUIRED COMPONENTS Core)
#if(NOT Qt5_FOUND)
# message(FATAL_ERROR "Minimum supported Qt5 version is 5.13!")
#endif()
if(NOT Qt6_FOUND)
message(FATAL_ERROR "Minimum supported Qt6!")
endif()
set(LINPHONEAPP_BUILD_TYPE "Default" CACHE STRING "Type of build")
set_property(CACHE LINPHONEAPP_BUILD_TYPE PROPERTY STRINGS "Default" "Macos" "Normal")

View file

@ -125,6 +125,7 @@ void AccountCore::setUnreadNotifications(int unread) {
void AccountCore::onRegistrationStateChanged(const std::shared_ptr<linphone::Account> &account,
linphone::RegistrationState state,
const std::string &message) {
qDebug() << log().arg(Q_FUNC_INFO) << (int)state;
mRegistrationState = LinphoneEnums::fromLinphone(state);
emit registrationStateChanged(Utils::coreStringToAppString(message));
}

View file

@ -59,6 +59,7 @@ CallCore::CallCore(const std::shared_ptr<linphone::Call> &call) : QObject(nullpt
videoDirection == linphone::MediaDirection::SendOnly || videoDirection == linphone::MediaDirection::SendRecv;
mState = LinphoneEnums::fromLinphone(call->getState());
mPeerAddress = Utils::coreStringToAppString(call->getRemoteAddress()->asStringUriOnly());
mLocalAddress = Utils::coreStringToAppString(call->getCallLog()->getLocalAddress()->asStringUriOnly());
mStatus = LinphoneEnums::fromLinphone(call->getCallLog()->getStatus());
mTransferState = LinphoneEnums::fromLinphone(call->getTransferState());
auto token = Utils::coreStringToAppString(mCallModel->getAuthenticationToken());
@ -271,6 +272,10 @@ QString CallCore::getPeerAddress() const {
return mPeerAddress;
}
QString CallCore::getLocalAddress() const {
return mLocalAddress;
}
LinphoneEnums::CallStatus CallCore::getStatus() const {
return mStatus;
}

View file

@ -44,6 +44,7 @@ class CallCore : public QObject, public AbstractObject {
Q_PROPERTY(bool cameraEnabled READ getCameraEnabled WRITE lSetCameraEnabled NOTIFY cameraEnabledChanged)
Q_PROPERTY(bool paused READ getPaused WRITE lSetPaused NOTIFY pausedChanged)
Q_PROPERTY(QString peerAddress READ getPeerAddress CONSTANT)
Q_PROPERTY(QString localAddress READ getLocalAddress CONSTANT)
Q_PROPERTY(bool isSecured READ isSecured NOTIFY securityUpdated)
Q_PROPERTY(bool isConference READ isConference NOTIFY conferenceChanged)
Q_PROPERTY(LinphoneEnums::MediaEncryption encryption READ getEncryption NOTIFY securityUpdated)
@ -72,6 +73,7 @@ public:
void setSelf(QSharedPointer<CallCore> me);
QString getPeerAddress() const;
QString getLocalAddress() const;
LinphoneEnums::CallStatus getStatus() const;
void setStatus(LinphoneEnums::CallStatus status);
@ -222,6 +224,7 @@ private:
QString mLastErrorMessage;
QString mPeerAddress;
QString mLocalAddress;
bool mIsSecured;
bool mIsConference = false;
int mDuration = 0;

View file

@ -87,6 +87,9 @@ QQuickFramebufferObject::Renderer *CameraGui::createRenderer(bool resetWindowId)
} else {
renderer = (QQuickFramebufferObject::Renderer *)call->createNativeVideoWindowId();
if (renderer) call->setNativeVideoWindowId(renderer);
else {
renderer = (QQuickFramebufferObject::Renderer *)call->createNativeVideoWindowId();
}
}
}
};

View file

@ -45,12 +45,14 @@ ConferenceInfoCore::ConferenceInfoCore(std::shared_ptr<linphone::ConferenceInfo>
QTimeZone::systemTimeZone())); // Always return system timezone because this info is not stored in database.
connect(this, &ConferenceInfoCore::dateTimeChanged, [this] {
setDuration(mDateTime.secsTo(mEndDateTime) / 60.0);
setIsScheduled(mDateTime != QDateTime::currentDateTime());
setDuration(mDateTime.isValid() ? mDateTime.secsTo(mEndDateTime) / 60.0 : 60);
setIsScheduled(mDateTime.isValid());
});
connect(this, &ConferenceInfoCore::endDateTimeChanged,
[this] { setDuration(mDateTime.secsTo(mEndDateTime) / 60.0); });
connect(this, &ConferenceInfoCore::durationChanged, [this] { setEndDateTime(mDateTime.addSecs(mDuration * 60)); });
[this] { setDuration(mDateTime.isValid() ? mDateTime.secsTo(mEndDateTime) / 60.0 : 60); });
connect(this, &ConferenceInfoCore::durationChanged, [this] {
if (mDateTime.isValid()) setEndDateTime(mDateTime.addSecs(mDuration * 60));
});
if (conferenceInfo) {
mustBeInLinphoneThread(getClassName());
@ -68,6 +70,7 @@ ConferenceInfoCore::ConferenceInfoCore(std::shared_ptr<linphone::ConferenceInfo>
mDateTime = QDateTime::fromMSecsSinceEpoch(conferenceInfo->getDateTime() * 1000, Qt::LocalTime);
mDuration = conferenceInfo->getDuration();
mEndDateTime = mDateTime.addSecs(mDuration * 60);
mIsScheduled = mDateTime.isValid();
mOrganizerAddress = Utils::coreStringToAppString(conferenceInfo->getOrganizer()->asStringUriOnly());
mOrganizerName = Utils::coreStringToAppString(conferenceInfo->getOrganizer()->getDisplayName());
if (mOrganizerName.isEmpty()) {
@ -93,8 +96,10 @@ ConferenceInfoCore::ConferenceInfoCore(std::shared_ptr<linphone::ConferenceInfo>
}
mConferenceInfoState = LinphoneEnums::fromLinphone(conferenceInfo->getState());
} else {
mDateTime = QDateTime();
mEndDateTime = mDateTime;
mDateTime = QDateTime::currentDateTime();
mIsScheduled = true;
mDuration = 60;
mEndDateTime = mDateTime.addSecs(mDuration * 60);
App::postModelSync([this]() {
auto defaultAccount = CoreModel::getInstance()->getCore()->getDefaultAccount();
if (defaultAccount) {
@ -471,9 +476,6 @@ LinphoneEnums::ConferenceSchedulerState ConferenceInfoCore::getConferenceSchedul
// Datetime is in Custom (Locale/UTC/System). Convert into UTC for conference info
void ConferenceInfoCore::setIsScheduled(const bool &on) {
if (!on) setDateTime(QDateTime());
else mDateTime = QDateTime::currentDateTime();
qDebug() << "set d ate time valid" << mDateTime.isValid();
if (mIsScheduled != on) {
mIsScheduled = on;
emit isScheduledChanged();
@ -527,10 +529,13 @@ void ConferenceInfoCore::writeFromModel(const std::shared_ptr<ConferenceInfoMode
void ConferenceInfoCore::writeIntoModel(std::shared_ptr<ConferenceInfoModel> model) {
mustBeInLinphoneThread(getClassName() + "::writeIntoModel()");
model->setDateTime(mDateTime);
model->setDateTime(mIsScheduled ? mDateTime : QDateTime());
model->setDuration(mDuration);
model->setSubject(mSubject);
model->setOrganizer(mOrganizerAddress);
if (!mOrganizerAddress.isEmpty()) {
model->setOrganizer(mOrganizerAddress);
qDebug() << "Use of " << mOrganizerAddress;
} else qDebug() << "Use of " << model->getOrganizerAddress();
model->setDescription(mDescription);
std::list<std::shared_ptr<linphone::ParticipantInfo>> participantInfos;
for (auto &p : mParticipants) {
@ -570,8 +575,8 @@ void ConferenceInfoCore::save() {
if (!linphoneConf->getOrganizer()) linphoneConf->setOrganizer(cleanedClonedAddress);
if (mOrganizerAddress.isEmpty())
mOrganizerAddress = Utils::coreStringToAppString(accountAddress->asStringUriOnly());
}
}
} else qCritical() << "No contact address";
} else qCritical() << "No default account";
mConferenceInfoModel = Utils::makeQObject_ptr<ConferenceInfoModel>(linphoneConf);
// mConferenceInfoModel->createConferenceScheduler();
auto confSchedulerModel = mConferenceInfoModel->getConferenceScheduler();
@ -643,4 +648,4 @@ void ConferenceInfoCore::onInvitationsSent(const std::list<std::shared_ptr<linph
bool ConferenceInfoCore::isAllDayConf() const {
return mDateTime.time().hour() == 0 && mDateTime.time().minute() == 0 && mEndDateTime.time().hour() == 23 &&
mEndDateTime.time().minute() == 59;
}
}

View file

@ -182,7 +182,7 @@ private:
LinphoneEnums::ConferenceSchedulerState mConferenceSchedulerState;
LinphoneEnums::ConferenceInfoState mConferenceInfoState =
LinphoneEnums::ConferenceInfoState::ConferenceInfoStateNew;
bool mIsScheduled = true;
bool mIsScheduled;
bool mIsEnded = false;
QTimer mCheckEndTimer;
int mInviteMode = 0;

View file

@ -185,6 +185,7 @@ void ParticipantDeviceCore::setState(LinphoneEnums::ParticipantDeviceState state
void ParticipantDeviceCore::setIsVideoEnabled(bool enabled) {
if (mIsVideoEnabled != enabled) {
mIsVideoEnabled = enabled;
qDebug() << log().arg(Q_FUNC_INFO) << getAddress() << mIsVideoEnabled;
emit videoEnabledChanged();
}
}

View file

@ -355,6 +355,7 @@ void CallModel::onInfoMessageReceived(const std::shared_ptr<linphone::Call> &cal
void CallModel::onStateChanged(const std::shared_ptr<linphone::Call> &call,
linphone::Call::State state,
const std::string &message) {
qDebug() << "CallModel::onStateChanged" << (int)state;
if (state == linphone::Call::State::StreamsRunning) {
// After UpdatedByRemote, video direction could be changed.
auto params = call->getRemoteParams();
@ -371,6 +372,7 @@ void CallModel::onStateChanged(const std::shared_ptr<linphone::Call> &call,
}
void CallModel::onStatusChanged(const std::shared_ptr<linphone::Call> &call, linphone::Call::Status status) {
qDebug() << "CallModel::onStatusChanged" << (int)status;
emit statusChanged(status);
}

View file

@ -92,7 +92,7 @@ void CoreModel::start() {
mCore->start();
setPathAfterStart();
mCore->enableFriendListSubscription(true);
auto videoPolicy = mCore->getVideoActivationPolicy();
auto videoPolicy = mCore->getVideoActivationPolicy()->clone();
videoPolicy->setAutomaticallyAccept(true);
videoPolicy->setAutomaticallyInitiate(false);
mCore->setVideoActivationPolicy(videoPolicy);

View file

@ -106,17 +106,22 @@ void ParticipantDeviceModel::onIsMuted(const std::shared_ptr<linphone::Participa
}
void ParticipantDeviceModel::onStateChanged(const std::shared_ptr<linphone::ParticipantDevice> &participantDevice,
linphone::ParticipantDevice::State state) {
qDebug() << log().arg(Q_FUNC_INFO) << participantDevice->getAddress()->asStringUriOnly() << (int)state;
emit stateChanged(LinphoneEnums::fromLinphone(state));
}
void ParticipantDeviceModel::onStreamCapabilityChanged(
const std::shared_ptr<linphone::ParticipantDevice> &participantDevice,
linphone::MediaDirection direction,
linphone::StreamType streamType) {
qDebug() << log().arg(Q_FUNC_INFO) << participantDevice->getAddress()->asStringUriOnly() << (int)direction
<< (int)streamType;
emit streamCapabilityChanged(streamType);
}
void ParticipantDeviceModel::onStreamAvailabilityChanged(
const std::shared_ptr<linphone::ParticipantDevice> &participantDevice,
bool available,
linphone::StreamType streamType) {
qDebug() << log().arg(Q_FUNC_INFO) << participantDevice->getAddress()->asStringUriOnly() << available
<< (int)streamType;
emit streamAvailabilityChanged(streamType);
}
}

View file

@ -21,8 +21,8 @@ Item {
property bool displayBorder : participantDevice && participantDevice.core.isSpeaking || false
property color color: DefaultStyle.grey_600
property int radius: 15 * DefaultStyle.dp
property var peerAddressObj: previewEnabled
? UtilsCpp.getDisplayName(account.core.identityAddress)
property var peerAddressObj: previewEnabled && (call || account)
? UtilsCpp.getDisplayName(account ? account.core.identityAddress : call.core.localAddress)
: participantDevice && participantDevice.core
? UtilsCpp.getDisplayName(participantDevice.core.address)
: !previewEnabled && call && call.core
@ -30,9 +30,9 @@ Item {
: null
property string peerAddress:peerAddressObj ? peerAddressObj.value : ""
onPeerAddressChanged: console.log("TOTO " +qmlName + " => " +peerAddress)
property var identityAddress: account ? UtilsCpp.getDisplayName(account.core.identityAddress) : null
property bool cameraEnabled: previewEnabled || participantDevice && participantDevice.core.videoEnabled
property bool cameraEnabled: (previewEnabled && call && call.core.cameraEnabled)
|| (!previewEnabled && participantDevice && participantDevice.core.videoEnabled)
property string qmlName
Rectangle {

View file

@ -40,6 +40,7 @@ ListView {
bottomPadding: 16 * DefaultStyle.dp
text: section
height: 29 * DefaultStyle.dp + topPadding + bottomPadding
wrapMode: Text.NoWrap
font {
pixelSize: 20 * DefaultStyle.dp
weight: 800 * DefaultStyle.dp
@ -81,12 +82,11 @@ ListView {
spacing: 0
//anchors.leftMargin: 45 * DefaultStyle.dp
Text {
//Layout.preferredWidth: 32 * DefaultStyle.dp
Layout.preferredHeight: 19 * DefaultStyle.dp
Layout.fillWidth: true
// opacity: (!previousItem || !previousDateTime.startsWith(displayName[0])) ? 1 : 0
text: day
text: day.substring(0,3) + '.'
color: DefaultStyle.main2_500main
wrapMode: Text.NoWrap
elide: Text.ElideNone
font {
pixelSize: 14 * DefaultStyle.dp
weight: 400 * DefaultStyle.dp
@ -95,7 +95,6 @@ ListView {
}
Rectangle {
id: dayNum
//Layout.preferredWidth: Math.max(32 * DefaultStyle.dp, dayNumText.width+17*DefaultStyle.dp)
Layout.fillWidth: true
Layout.preferredHeight: width
Layout.alignment: Qt.AlignCenter

View file

@ -19,12 +19,12 @@ Mosaic {
property ParticipantDeviceProxy participantDevices : ParticipantDeviceProxy {
id: allDevices
qmlName: "G"
Component.onCompleted: console.log("Loaded : " +allDevices)
Component.onCompleted: console.log("Loaded : " +allDevices + " = " +allDevices.count)
}
model: participantDevices
model: grid.call.core.isConference ? participantDevices: [0,1]
delegate: Item{
id: avatarCell
property ParticipantDeviceGui currentDevice: gridModel.participantDevices.getAt(index)
property ParticipantDeviceGui currentDevice: grid.call.core.isConference ? gridModel.participantDevices.getAt(index) : null
onCurrentDeviceChanged: {
if(index < 0) cameraView.enabled = false // this is a delegate destruction. We need to stop camera before Qt change its currentDevice (and then, let CameraView to delete wrong renderer)
}
@ -37,9 +37,10 @@ Mosaic {
visible: mainItem.callState != LinphoneEnums.CallState.End && mainItem.callState != LinphoneEnums.CallState.Released
anchors.fill: parent
qmlName: 'G_'+index
call: !grid.call.core.isConference ? grid.call : null
participantDevice: avatarCell.currentDevice
Component.onCompleted: console.log(qmlName + " is " +modelData.core.address)
Component.onCompleted: console.log(qmlName + " is " +(call ? call.core.peerAddress : currentDevice ? currentDevice.core.address : 'addr_NotDefined'))
}
/*
Sticker{

View file

@ -15,6 +15,12 @@ AbstractMainPage {
signal listViewUpdated()
property ConferenceInfoGui confInfoGui
property AccountProxy accounts: AccountProxy{id: accountProxy}
property AccountGui account: accountProxy.defaultAccount
property var state: account && account.core.registrationState || 0
onStateChanged: console.log(state)
property bool isRegistered: account ? account.core.registrationState == LinphoneEnums.RegistrationState.Ok : false
onIsRegisteredChanged: console.log(isRegistered)
Connections {
enabled: confInfoGui
@ -404,7 +410,9 @@ AbstractMainPage {
onValidateRequested: {
if (groupName.length === 0) {
UtilsCpp.showInformationPopup(qsTr("Erreur"), qsTr("Un nom doit être donné à l'appel de groupe"), false)
} else {
} if(!mainItem.isRegistered) {
UtilsCpp.showInformationPopup(qsTr("Erreur"), qsTr("Vous n'etes pas connecté"), false)
}else {
mainItem.confInfoGui.core.subject = groupName
mainItem.confInfoGui.core.isScheduled = false
mainItem.confInfoGui.core.addParticipants(selectedParticipants)

@ -1 +1 @@
Subproject commit 1f9db257fe224ea6d9b067e69ee6b9f72102e129
Subproject commit 6c146121c0c717c566e5c1ba3aa1a5167df5732f