fix preview/cameras.
CameraEnabled => localVideoEnabled. Meeting invitations.
This commit is contained in:
parent
f795007b30
commit
d4139fddd1
23 changed files with 121 additions and 317 deletions
|
|
@ -111,8 +111,6 @@ void App::setSelf(QSharedPointer<App>(me)) {
|
||||||
auto win = getCallsWindow(QVariant::fromValue(callGui));
|
auto win = getCallsWindow(QVariant::fromValue(callGui));
|
||||||
Utils::smartShowWindow(win);
|
Utils::smartShowWindow(win);
|
||||||
qDebug() << "App : call created" << callGui;
|
qDebug() << "App : call created" << callGui;
|
||||||
// callGui.value<CallGui
|
|
||||||
// * > ()->getCore()->lSetCameraEnabled(true);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,9 +53,12 @@ CallCore::CallCore(const std::shared_ptr<linphone::Call> &call) : QObject(nullpt
|
||||||
mDuration = call->getDuration();
|
mDuration = call->getDuration();
|
||||||
mMicrophoneMuted = call->getMicrophoneMuted();
|
mMicrophoneMuted = call->getMicrophoneMuted();
|
||||||
mSpeakerMuted = call->getSpeakerMuted();
|
mSpeakerMuted = call->getSpeakerMuted();
|
||||||
// mCameraEnabled = call->cameraEnabled();
|
|
||||||
auto videoDirection = call->getCurrentParams()->getVideoDirection();
|
auto videoDirection = call->getCurrentParams()->getVideoDirection();
|
||||||
mCameraEnabled =
|
mLocalVideoEnabled =
|
||||||
|
videoDirection == linphone::MediaDirection::SendOnly || videoDirection == linphone::MediaDirection::SendRecv;
|
||||||
|
auto remoteParams = call->getRemoteParams();
|
||||||
|
videoDirection = remoteParams ? remoteParams->getVideoDirection() : linphone::MediaDirection::Inactive;
|
||||||
|
mRemoteVideoEnabled =
|
||||||
videoDirection == linphone::MediaDirection::SendOnly || videoDirection == linphone::MediaDirection::SendRecv;
|
videoDirection == linphone::MediaDirection::SendOnly || videoDirection == linphone::MediaDirection::SendRecv;
|
||||||
mState = LinphoneEnums::fromLinphone(call->getState());
|
mState = LinphoneEnums::fromLinphone(call->getState());
|
||||||
mPeerAddress = Utils::coreStringToAppString(call->getRemoteAddress()->asStringUriOnly());
|
mPeerAddress = Utils::coreStringToAppString(call->getRemoteAddress()->asStringUriOnly());
|
||||||
|
|
@ -79,7 +82,7 @@ CallCore::CallCore(const std::shared_ptr<linphone::Call> &call) : QObject(nullpt
|
||||||
}
|
}
|
||||||
mPaused = mState == LinphoneEnums::CallState::Pausing || mState == LinphoneEnums::CallState::Paused ||
|
mPaused = mState == LinphoneEnums::CallState::Pausing || mState == LinphoneEnums::CallState::Paused ||
|
||||||
mState == LinphoneEnums::CallState::PausedByRemote;
|
mState == LinphoneEnums::CallState::PausedByRemote;
|
||||||
mRemoteVideoEnabled = call->getRemoteParams() && call->getRemoteParams()->videoEnabled();
|
|
||||||
mRecording = call->getParams() && call->getParams()->isRecording();
|
mRecording = call->getParams() && call->getParams()->isRecording();
|
||||||
mRemoteRecording = call->getRemoteParams() && call->getRemoteParams()->isRecording();
|
mRemoteRecording = call->getRemoteParams() && call->getRemoteParams()->isRecording();
|
||||||
mSpeakerVolumeGain = mCallModel->getSpeakerVolumeGain();
|
mSpeakerVolumeGain = mCallModel->getSpeakerVolumeGain();
|
||||||
|
|
@ -123,8 +126,8 @@ void CallCore::setSelf(QSharedPointer<CallCore> me) {
|
||||||
mCallModelConnection->makeConnectToModel(&CallModel::speakerMutedChanged, [this](bool isMuted) {
|
mCallModelConnection->makeConnectToModel(&CallModel::speakerMutedChanged, [this](bool isMuted) {
|
||||||
mCallModelConnection->invokeToCore([this, isMuted]() { setSpeakerMuted(isMuted); });
|
mCallModelConnection->invokeToCore([this, isMuted]() { setSpeakerMuted(isMuted); });
|
||||||
});
|
});
|
||||||
mCallModelConnection->makeConnectToCore(&CallCore::lSetCameraEnabled, [this](bool enabled) {
|
mCallModelConnection->makeConnectToCore(&CallCore::lSetLocalVideoEnabled, [this](bool enabled) {
|
||||||
mCallModelConnection->invokeToModel([this, enabled]() { mCallModel->setCameraEnabled(enabled); });
|
mCallModelConnection->invokeToModel([this, enabled]() { mCallModel->setLocalVideoEnabled(enabled); });
|
||||||
});
|
});
|
||||||
mCallModelConnection->makeConnectToCore(&CallCore::lStartRecording, [this]() {
|
mCallModelConnection->makeConnectToCore(&CallCore::lStartRecording, [this]() {
|
||||||
mCallModelConnection->invokeToModel([this]() { mCallModel->startRecording(); });
|
mCallModelConnection->invokeToModel([this]() { mCallModel->startRecording(); });
|
||||||
|
|
@ -146,8 +149,8 @@ void CallCore::setSelf(QSharedPointer<CallCore> me) {
|
||||||
&CallModel::remoteRecording, [this](const std::shared_ptr<linphone::Call> &call, bool recording) {
|
&CallModel::remoteRecording, [this](const std::shared_ptr<linphone::Call> &call, bool recording) {
|
||||||
mCallModelConnection->invokeToCore([this, recording]() { setRemoteRecording(recording); });
|
mCallModelConnection->invokeToCore([this, recording]() { setRemoteRecording(recording); });
|
||||||
});
|
});
|
||||||
mCallModelConnection->makeConnectToModel(&CallModel::cameraEnabledChanged, [this](bool enabled) {
|
mCallModelConnection->makeConnectToModel(&CallModel::localVideoEnabledChanged, [this](bool enabled) {
|
||||||
mCallModelConnection->invokeToCore([this, enabled]() { setCameraEnabled(enabled); });
|
mCallModelConnection->invokeToCore([this, enabled]() { setLocalVideoEnabled(enabled); });
|
||||||
});
|
});
|
||||||
mCallModelConnection->makeConnectToModel(&CallModel::durationChanged, [this](int duration) {
|
mCallModelConnection->makeConnectToModel(&CallModel::durationChanged, [this](int duration) {
|
||||||
mCallModelConnection->invokeToCore([this, duration]() { setDuration(duration); });
|
mCallModelConnection->invokeToCore([this, duration]() { setDuration(duration); });
|
||||||
|
|
@ -356,15 +359,15 @@ void CallCore::setMicrophoneMuted(bool isMuted) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CallCore::getCameraEnabled() const {
|
bool CallCore::getLocalVideoEnabled() const {
|
||||||
return mCameraEnabled;
|
return mLocalVideoEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CallCore::setCameraEnabled(bool enabled) {
|
void CallCore::setLocalVideoEnabled(bool enabled) {
|
||||||
if (mCameraEnabled != enabled) {
|
if (mLocalVideoEnabled != enabled) {
|
||||||
mCameraEnabled = enabled;
|
mLocalVideoEnabled = enabled;
|
||||||
qWarning() << "CameraEnabled: " << mCameraEnabled;
|
qWarning() << "LocalVideoEnabled: " << mLocalVideoEnabled;
|
||||||
emit cameraEnabledChanged();
|
emit localVideoEnabledChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,6 @@ class CallCore : public QObject, public AbstractObject {
|
||||||
Q_PROPERTY(int duration READ getDuration NOTIFY durationChanged)
|
Q_PROPERTY(int duration READ getDuration NOTIFY durationChanged)
|
||||||
Q_PROPERTY(bool speakerMuted READ getSpeakerMuted WRITE lSetSpeakerMuted NOTIFY speakerMutedChanged)
|
Q_PROPERTY(bool speakerMuted READ getSpeakerMuted WRITE lSetSpeakerMuted NOTIFY speakerMutedChanged)
|
||||||
Q_PROPERTY(bool microphoneMuted READ getMicrophoneMuted WRITE lSetMicrophoneMuted NOTIFY microphoneMutedChanged)
|
Q_PROPERTY(bool microphoneMuted READ getMicrophoneMuted WRITE lSetMicrophoneMuted NOTIFY microphoneMutedChanged)
|
||||||
Q_PROPERTY(bool cameraEnabled READ getCameraEnabled WRITE lSetCameraEnabled NOTIFY cameraEnabledChanged)
|
|
||||||
Q_PROPERTY(bool paused READ getPaused WRITE lSetPaused NOTIFY pausedChanged)
|
Q_PROPERTY(bool paused READ getPaused WRITE lSetPaused NOTIFY pausedChanged)
|
||||||
Q_PROPERTY(QString peerAddress READ getPeerAddress CONSTANT)
|
Q_PROPERTY(QString peerAddress READ getPeerAddress CONSTANT)
|
||||||
Q_PROPERTY(QString localAddress READ getLocalAddress CONSTANT)
|
Q_PROPERTY(QString localAddress READ getLocalAddress CONSTANT)
|
||||||
|
|
@ -52,6 +51,8 @@ class CallCore : public QObject, public AbstractObject {
|
||||||
Q_PROPERTY(QString remoteSas WRITE setRemoteSas MEMBER mRemoteSas NOTIFY remoteSasChanged)
|
Q_PROPERTY(QString remoteSas WRITE setRemoteSas MEMBER mRemoteSas NOTIFY remoteSasChanged)
|
||||||
Q_PROPERTY(
|
Q_PROPERTY(
|
||||||
bool remoteVideoEnabled READ getRemoteVideoEnabled WRITE setRemoteVideoEnabled NOTIFY remoteVideoEnabledChanged)
|
bool remoteVideoEnabled READ getRemoteVideoEnabled WRITE setRemoteVideoEnabled NOTIFY remoteVideoEnabledChanged)
|
||||||
|
Q_PROPERTY(
|
||||||
|
bool localVideoEnabled READ getLocalVideoEnabled WRITE lSetLocalVideoEnabled NOTIFY localVideoEnabledChanged)
|
||||||
Q_PROPERTY(bool recording READ getRecording WRITE setRecording NOTIFY recordingChanged)
|
Q_PROPERTY(bool recording READ getRecording WRITE setRecording NOTIFY recordingChanged)
|
||||||
Q_PROPERTY(bool remoteRecording READ getRemoteRecording WRITE setRemoteRecording NOTIFY remoteRecordingChanged)
|
Q_PROPERTY(bool remoteRecording READ getRemoteRecording WRITE setRemoteRecording NOTIFY remoteRecordingChanged)
|
||||||
Q_PROPERTY(bool recordable READ getRecordable WRITE setRecordable NOTIFY recordableChanged)
|
Q_PROPERTY(bool recordable READ getRecordable WRITE setRecordable NOTIFY recordableChanged)
|
||||||
|
|
@ -96,9 +97,6 @@ public:
|
||||||
bool getMicrophoneMuted() const;
|
bool getMicrophoneMuted() const;
|
||||||
void setMicrophoneMuted(bool isMuted);
|
void setMicrophoneMuted(bool isMuted);
|
||||||
|
|
||||||
bool getCameraEnabled() const;
|
|
||||||
void setCameraEnabled(bool enabled);
|
|
||||||
|
|
||||||
bool getPaused() const;
|
bool getPaused() const;
|
||||||
void setPaused(bool paused);
|
void setPaused(bool paused);
|
||||||
|
|
||||||
|
|
@ -121,6 +119,9 @@ public:
|
||||||
bool getRemoteVideoEnabled() const;
|
bool getRemoteVideoEnabled() const;
|
||||||
void setRemoteVideoEnabled(bool enabled);
|
void setRemoteVideoEnabled(bool enabled);
|
||||||
|
|
||||||
|
bool getLocalVideoEnabled() const;
|
||||||
|
void setLocalVideoEnabled(bool enabled);
|
||||||
|
|
||||||
bool getRecording() const;
|
bool getRecording() const;
|
||||||
void setRecording(bool recording);
|
void setRecording(bool recording);
|
||||||
|
|
||||||
|
|
@ -158,13 +159,13 @@ signals:
|
||||||
void durationChanged(int duration);
|
void durationChanged(int duration);
|
||||||
void speakerMutedChanged();
|
void speakerMutedChanged();
|
||||||
void microphoneMutedChanged();
|
void microphoneMutedChanged();
|
||||||
void cameraEnabledChanged();
|
|
||||||
void pausedChanged();
|
void pausedChanged();
|
||||||
void transferStateChanged();
|
void transferStateChanged();
|
||||||
void securityUpdated();
|
void securityUpdated();
|
||||||
void localSasChanged();
|
void localSasChanged();
|
||||||
void remoteSasChanged();
|
void remoteSasChanged();
|
||||||
void remoteVideoEnabledChanged(bool remoteVideoEnabled);
|
void remoteVideoEnabledChanged(bool remoteVideoEnabled);
|
||||||
|
void localVideoEnabledChanged();
|
||||||
void recordingChanged();
|
void recordingChanged();
|
||||||
void remoteRecordingChanged();
|
void remoteRecordingChanged();
|
||||||
void recordableChanged();
|
void recordableChanged();
|
||||||
|
|
@ -181,7 +182,7 @@ signals:
|
||||||
void lTerminateAllCalls(); // Hangup all calls
|
void lTerminateAllCalls(); // Hangup all calls
|
||||||
void lSetSpeakerMuted(bool muted);
|
void lSetSpeakerMuted(bool muted);
|
||||||
void lSetMicrophoneMuted(bool isMuted);
|
void lSetMicrophoneMuted(bool isMuted);
|
||||||
void lSetCameraEnabled(bool enabled);
|
void lSetLocalVideoEnabled(bool enabled);
|
||||||
void lSetVideoEnabled(bool enabled);
|
void lSetVideoEnabled(bool enabled);
|
||||||
void lSetPaused(bool paused);
|
void lSetPaused(bool paused);
|
||||||
void lTransferCall(QString &est);
|
void lTransferCall(QString &est);
|
||||||
|
|
@ -230,7 +231,7 @@ private:
|
||||||
int mDuration = 0;
|
int mDuration = 0;
|
||||||
bool mSpeakerMuted;
|
bool mSpeakerMuted;
|
||||||
bool mMicrophoneMuted;
|
bool mMicrophoneMuted;
|
||||||
bool mCameraEnabled = false;
|
bool mLocalVideoEnabled = false;
|
||||||
bool mVideoEnabled = false;
|
bool mVideoEnabled = false;
|
||||||
bool mPaused = false;
|
bool mPaused = false;
|
||||||
bool mRemoteVideoEnabled = false;
|
bool mRemoteVideoEnabled = false;
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ ConferenceInfoCore::ConferenceInfoCore(const ConferenceInfoCore &conferenceInfoC
|
||||||
mHaveModel = conferenceInfoCore.mHaveModel;
|
mHaveModel = conferenceInfoCore.mHaveModel;
|
||||||
mIsScheduled = conferenceInfoCore.mIsScheduled;
|
mIsScheduled = conferenceInfoCore.mIsScheduled;
|
||||||
mIsEnded = conferenceInfoCore.mIsEnded;
|
mIsEnded = conferenceInfoCore.mIsEnded;
|
||||||
mInviteMode = conferenceInfoCore.mInviteMode;
|
mInviteEnabled = conferenceInfoCore.mInviteEnabled;
|
||||||
mConferenceInfoState = conferenceInfoCore.mConferenceInfoState;
|
mConferenceInfoState = conferenceInfoCore.mConferenceInfoState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -150,7 +150,7 @@ void ConferenceInfoCore::reset(const ConferenceInfoCore &conf) {
|
||||||
setTimeZoneModel(conf.getTimeZoneModel());
|
setTimeZoneModel(conf.getTimeZoneModel());
|
||||||
setIsScheduled(conf.isScheduled());
|
setIsScheduled(conf.isScheduled());
|
||||||
setIsEnded(conf.isEnded());
|
setIsEnded(conf.isEnded());
|
||||||
setInviteMode(conf.getInviteMode());
|
enableInvite(conf.inviteEnabled());
|
||||||
setConferenceInfoState(conf.getConferenceInfoState());
|
setConferenceInfoState(conf.getConferenceInfoState());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -367,8 +367,8 @@ bool ConferenceInfoCore::isEnded() const {
|
||||||
return mIsEnded;
|
return mIsEnded;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ConferenceInfoCore::getInviteMode() const {
|
bool ConferenceInfoCore::inviteEnabled() const {
|
||||||
return mInviteMode;
|
return mInviteEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariantList ConferenceInfoCore::getParticipants() const {
|
QVariantList ConferenceInfoCore::getParticipants() const {
|
||||||
|
|
@ -503,10 +503,10 @@ void ConferenceInfoCore::setIsEnded(bool ended) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConferenceInfoCore::setInviteMode(const int &mode) {
|
void ConferenceInfoCore::enableInvite(const bool &enable) {
|
||||||
if (mode != mInviteMode) {
|
if (enable != mInviteEnabled) {
|
||||||
mInviteMode = mode;
|
mInviteEnabled = enable;
|
||||||
emit inviteModeChanged();
|
emit inviteEnabledChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ public:
|
||||||
Q_PROPERTY(bool haveModel READ getHaveModel NOTIFY haveModelChanged)
|
Q_PROPERTY(bool haveModel READ getHaveModel NOTIFY haveModelChanged)
|
||||||
Q_PROPERTY(bool isScheduled READ isScheduled WRITE setIsScheduled NOTIFY isScheduledChanged)
|
Q_PROPERTY(bool isScheduled READ isScheduled WRITE setIsScheduled NOTIFY isScheduledChanged)
|
||||||
Q_PROPERTY(bool isEnded READ isEnded WRITE setIsEnded NOTIFY isEndedChanged)
|
Q_PROPERTY(bool isEnded READ isEnded WRITE setIsEnded NOTIFY isEndedChanged)
|
||||||
Q_PROPERTY(int inviteMode READ getInviteMode WRITE setInviteMode NOTIFY inviteModeChanged)
|
Q_PROPERTY(bool inviteEnabled READ inviteEnabled WRITE enableInvite NOTIFY inviteEnabledChanged)
|
||||||
Q_PROPERTY(int participantCount READ getParticipantCount NOTIFY participantsChanged)
|
Q_PROPERTY(int participantCount READ getParticipantCount NOTIFY participantsChanged)
|
||||||
|
|
||||||
Q_PROPERTY(QVariantList participants READ getParticipants NOTIFY participantsChanged)
|
Q_PROPERTY(QVariantList participants READ getParticipants NOTIFY participantsChanged)
|
||||||
|
|
@ -92,7 +92,7 @@ public:
|
||||||
bool computeIsEnded() const;
|
bool computeIsEnded() const;
|
||||||
bool isEnded() const;
|
bool isEnded() const;
|
||||||
void setIsEnded(bool ended);
|
void setIsEnded(bool ended);
|
||||||
int getInviteMode() const;
|
bool inviteEnabled() const;
|
||||||
QVariantList getParticipants() const;
|
QVariantList getParticipants() const;
|
||||||
// Q_INVOKABLE QVariantList getAllParticipants() const;
|
// Q_INVOKABLE QVariantList getAllParticipants() const;
|
||||||
int getParticipantCount() const;
|
int getParticipantCount() const;
|
||||||
|
|
@ -112,7 +112,7 @@ public:
|
||||||
void setUri(const QString &uri);
|
void setUri(const QString &uri);
|
||||||
void setTimeZoneModel(TimeZoneModel *model);
|
void setTimeZoneModel(TimeZoneModel *model);
|
||||||
void setDescription(const QString &description);
|
void setDescription(const QString &description);
|
||||||
void setInviteMode(const int &mode);
|
void enableInvite(const bool &enable);
|
||||||
void setConferenceInfoState(LinphoneEnums::ConferenceInfoState state);
|
void setConferenceInfoState(LinphoneEnums::ConferenceInfoState state);
|
||||||
void setConferenceSchedulerState(LinphoneEnums::ConferenceSchedulerState state);
|
void setConferenceSchedulerState(LinphoneEnums::ConferenceSchedulerState state);
|
||||||
|
|
||||||
|
|
@ -156,7 +156,7 @@ signals:
|
||||||
void haveModelChanged();
|
void haveModelChanged();
|
||||||
void isScheduledChanged();
|
void isScheduledChanged();
|
||||||
void isEndedChanged();
|
void isEndedChanged();
|
||||||
void inviteModeChanged();
|
void inviteEnabledChanged();
|
||||||
void conferenceInfoStateChanged();
|
void conferenceInfoStateChanged();
|
||||||
void conferenceSchedulerStateChanged();
|
void conferenceSchedulerStateChanged();
|
||||||
void timeZoneModelChanged();
|
void timeZoneModelChanged();
|
||||||
|
|
@ -192,7 +192,7 @@ private:
|
||||||
bool mIsScheduled;
|
bool mIsScheduled;
|
||||||
bool mIsEnded = false;
|
bool mIsEnded = false;
|
||||||
QTimer mCheckEndTimer;
|
QTimer mCheckEndTimer;
|
||||||
int mInviteMode = 0;
|
bool mInviteEnabled = true;
|
||||||
// bool mRemoveRequested = false; // true if user has request its deletion from DB
|
// bool mRemoveRequested = false; // true if user has request its deletion from DB
|
||||||
// linphone::ConferenceScheduler::State mLastConferenceSchedulerState =
|
// linphone::ConferenceScheduler::State mLastConferenceSchedulerState =
|
||||||
// linphone::ConferenceScheduler::State::Idle; // Workaround for missing getter in scheduler.
|
// linphone::ConferenceScheduler::State::Idle; // Workaround for missing getter in scheduler.
|
||||||
|
|
|
||||||
|
|
@ -57,13 +57,11 @@ void CallModel::accept(bool withVideo) {
|
||||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||||
auto core = CoreModel::getInstance()->getCore();
|
auto core = CoreModel::getInstance()->getCore();
|
||||||
auto params = core->createCallParams(mMonitor);
|
auto params = core->createCallParams(mMonitor);
|
||||||
params->enableVideo(withVideo);
|
|
||||||
params->setRecordFile(
|
params->setRecordFile(
|
||||||
Paths::getCapturesDirPath()
|
Paths::getCapturesDirPath()
|
||||||
.append(Utils::generateSavedFilename(QString::fromStdString(mMonitor->getToAddress()->getUsername()), ""))
|
.append(Utils::generateSavedFilename(QString::fromStdString(mMonitor->getToAddress()->getUsername()), ""))
|
||||||
.append(".mkv")
|
.append(".mkv")
|
||||||
.toStdString());
|
.toStdString());
|
||||||
mMonitor->enableCamera(withVideo);
|
|
||||||
// Answer with local call address.
|
// Answer with local call address.
|
||||||
auto localAddress = mMonitor->getCallLog()->getLocalAddress();
|
auto localAddress = mMonitor->getCallLog()->getLocalAddress();
|
||||||
for (auto account : core->getAccountList()) {
|
for (auto account : core->getAccountList()) {
|
||||||
|
|
@ -72,8 +70,9 @@ void CallModel::accept(bool withVideo) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
activateLocalVideo(params, mMonitor->getCurrentParams(), withVideo);
|
||||||
mMonitor->acceptWithParams(params);
|
mMonitor->acceptWithParams(params);
|
||||||
emit cameraEnabledChanged(withVideo);
|
emit localVideoEnabledChanged(withVideo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CallModel::decline() {
|
void CallModel::decline() {
|
||||||
|
|
@ -122,14 +121,13 @@ void CallModel::setSpeakerMuted(bool isMuted) {
|
||||||
emit speakerMutedChanged(isMuted);
|
emit speakerMutedChanged(isMuted);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CallModel::setCameraEnabled(bool enabled) {
|
void CallModel::activateLocalVideo(std::shared_ptr<linphone::CallParams> ¶ms,
|
||||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
const std::shared_ptr<const linphone::CallParams> ¤tParams,
|
||||||
// mMonitor->enableCamera(enabled);
|
bool enable) {
|
||||||
auto params = CoreModel::getInstance()->getCore()->createCallParams(mMonitor);
|
|
||||||
params->enableVideo(true);
|
params->enableVideo(true);
|
||||||
auto direction = mMonitor->getCurrentParams()->getVideoDirection();
|
auto direction = currentParams ? currentParams->getVideoDirection() : params->getVideoDirection();
|
||||||
auto videoDirection = linphone::MediaDirection::RecvOnly;
|
auto videoDirection = linphone::MediaDirection::RecvOnly;
|
||||||
if (enabled) { // +Send
|
if (enable) { // +Send
|
||||||
switch (direction) {
|
switch (direction) {
|
||||||
case linphone::MediaDirection::RecvOnly:
|
case linphone::MediaDirection::RecvOnly:
|
||||||
videoDirection = linphone::MediaDirection::SendRecv;
|
videoDirection = linphone::MediaDirection::SendRecv;
|
||||||
|
|
@ -168,6 +166,12 @@ void CallModel::setCameraEnabled(bool enabled) {
|
||||||
: linphone::MediaDirection::SendOnly;
|
: linphone::MediaDirection::SendOnly;
|
||||||
*/
|
*/
|
||||||
params->setVideoDirection(videoDirection);
|
params->setVideoDirection(videoDirection);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CallModel::setLocalVideoEnabled(bool enabled) {
|
||||||
|
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||||
|
auto params = CoreModel::getInstance()->getCore()->createCallParams(mMonitor);
|
||||||
|
activateLocalVideo(params, mMonitor->getCurrentParams(), enabled);
|
||||||
mMonitor->update(params);
|
mMonitor->update(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -359,12 +363,12 @@ void CallModel::onStateChanged(const std::shared_ptr<linphone::Call> &call,
|
||||||
if (state == linphone::Call::State::StreamsRunning) {
|
if (state == linphone::Call::State::StreamsRunning) {
|
||||||
// After UpdatedByRemote, video direction could be changed.
|
// After UpdatedByRemote, video direction could be changed.
|
||||||
auto params = call->getRemoteParams();
|
auto params = call->getRemoteParams();
|
||||||
emit remoteVideoEnabledChanged(params && params->videoEnabled());
|
auto videoDirection = params ? params->getVideoDirection() : linphone::MediaDirection::Inactive;
|
||||||
qDebug() << "CallCameraEnabled:" << call->cameraEnabled();
|
emit remoteVideoEnabledChanged(videoDirection == linphone::MediaDirection::SendOnly ||
|
||||||
auto videoDirection = call->getCurrentParams()->getVideoDirection();
|
videoDirection == linphone::MediaDirection::SendRecv);
|
||||||
emit cameraEnabledChanged(videoDirection == linphone::MediaDirection::SendOnly ||
|
videoDirection = call->getCurrentParams()->getVideoDirection();
|
||||||
videoDirection == linphone::MediaDirection::SendRecv);
|
emit localVideoEnabledChanged(videoDirection == linphone::MediaDirection::SendOnly ||
|
||||||
// emit cameraEnabledChanged(call->cameraEnabled());
|
videoDirection == linphone::MediaDirection::SendRecv);
|
||||||
setConference(call->getConference());
|
setConference(call->getConference());
|
||||||
updateConferenceVideoLayout();
|
updateConferenceVideoLayout();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ public:
|
||||||
|
|
||||||
void setMicrophoneMuted(bool isMuted);
|
void setMicrophoneMuted(bool isMuted);
|
||||||
void setSpeakerMuted(bool isMuted);
|
void setSpeakerMuted(bool isMuted);
|
||||||
void setCameraEnabled(bool enabled);
|
void setLocalVideoEnabled(bool enabled);
|
||||||
void startRecording();
|
void startRecording();
|
||||||
void stopRecording();
|
void stopRecording();
|
||||||
void setRecordFile(const std::string &path);
|
void setRecordFile(const std::string &path);
|
||||||
|
|
@ -72,14 +72,18 @@ public:
|
||||||
void changeConferenceVideoLayout(LinphoneEnums::ConferenceLayout layout); // Make a call request
|
void changeConferenceVideoLayout(LinphoneEnums::ConferenceLayout layout); // Make a call request
|
||||||
void updateConferenceVideoLayout(); // Called from call state changed ater the new layout has been set.
|
void updateConferenceVideoLayout(); // Called from call state changed ater the new layout has been set.
|
||||||
|
|
||||||
|
static void activateLocalVideo(std::shared_ptr<linphone::CallParams> ¶ms,
|
||||||
|
const std::shared_ptr<const linphone::CallParams> ¤tParams,
|
||||||
|
bool enable);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void microphoneMutedChanged(bool isMuted);
|
void microphoneMutedChanged(bool isMuted);
|
||||||
void speakerMutedChanged(bool isMuted);
|
void speakerMutedChanged(bool isMuted);
|
||||||
void cameraEnabledChanged(bool enabled);
|
|
||||||
void durationChanged(int);
|
void durationChanged(int);
|
||||||
void microphoneVolumeChanged(float);
|
void microphoneVolumeChanged(float);
|
||||||
void pausedChanged(bool paused);
|
void pausedChanged(bool paused);
|
||||||
void remoteVideoEnabledChanged(bool remoteVideoEnabled);
|
void remoteVideoEnabledChanged(bool remoteVideoEnabled);
|
||||||
|
void localVideoEnabledChanged(bool enabled);
|
||||||
void recordingChanged(bool recording);
|
void recordingChanged(bool recording);
|
||||||
void authenticationTokenVerifiedChanged(bool verified);
|
void authenticationTokenVerifiedChanged(bool verified);
|
||||||
void speakerVolumeGainChanged(float volume);
|
void speakerVolumeGainChanged(float volume);
|
||||||
|
|
|
||||||
|
|
@ -57,8 +57,14 @@ void ConferenceInfoModel::setConferenceScheduler(const std::shared_ptr<Conferenc
|
||||||
mConferenceSchedulerModel->removeListener();
|
mConferenceSchedulerModel->removeListener();
|
||||||
}
|
}
|
||||||
mConferenceSchedulerModel = model;
|
mConferenceSchedulerModel = model;
|
||||||
connect(mConferenceSchedulerModel.get(), &ConferenceSchedulerModel::stateChanged, this,
|
connect(mConferenceSchedulerModel.get(), &ConferenceSchedulerModel::stateChanged,
|
||||||
&ConferenceInfoModel::schedulerStateChanged);
|
[this](linphone::ConferenceScheduler::State state) {
|
||||||
|
if (state == linphone::ConferenceScheduler::State::Ready && mInviteEnabled) {
|
||||||
|
auto params = CoreModel::getInstance()->getCore()->createDefaultChatRoomParams();
|
||||||
|
mConferenceSchedulerModel->getMonitor()->sendInvitations(params);
|
||||||
|
}
|
||||||
|
emit schedulerStateChanged(state);
|
||||||
|
});
|
||||||
connect(mConferenceSchedulerModel.get(), &ConferenceSchedulerModel::invitationsSent, this,
|
connect(mConferenceSchedulerModel.get(), &ConferenceSchedulerModel::invitationsSent, this,
|
||||||
&ConferenceInfoModel::invitationsSent);
|
&ConferenceInfoModel::invitationsSent);
|
||||||
mConferenceSchedulerModel->setSelf(mConferenceSchedulerModel);
|
mConferenceSchedulerModel->setSelf(mConferenceSchedulerModel);
|
||||||
|
|
@ -110,6 +116,10 @@ std::list<std::shared_ptr<linphone::ParticipantInfo>> ConferenceInfoModel::getPa
|
||||||
return mConferenceInfo->getParticipantInfos();
|
return mConferenceInfo->getParticipantInfos();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ConferenceInfoModel::inviteEnabled() const {
|
||||||
|
return mInviteEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
void ConferenceInfoModel::setDateTime(const QDateTime &date) {
|
void ConferenceInfoModel::setDateTime(const QDateTime &date) {
|
||||||
mConferenceInfo->setDateTime(date.isValid() ? date.toMSecsSinceEpoch() / 1000 : -1); // toMSecsSinceEpoch() is UTC
|
mConferenceInfo->setDateTime(date.isValid() ? date.toMSecsSinceEpoch() / 1000 : -1); // toMSecsSinceEpoch() is UTC
|
||||||
emit dateTimeChanged(date);
|
emit dateTimeChanged(date);
|
||||||
|
|
@ -158,3 +168,10 @@ void ConferenceInfoModel::cancelConference() {
|
||||||
void ConferenceInfoModel::updateConferenceInfo() {
|
void ConferenceInfoModel::updateConferenceInfo() {
|
||||||
mConferenceSchedulerModel->setInfo(mConferenceInfo);
|
mConferenceSchedulerModel->setInfo(mConferenceInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConferenceInfoModel::enableInvite(bool enable) {
|
||||||
|
if (mInviteEnabled != enable) {
|
||||||
|
mInviteEnabled = enable;
|
||||||
|
emit inviteEnabledChanged(mInviteEnabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ public:
|
||||||
QString getDescription() const;
|
QString getDescription() const;
|
||||||
QString getUri() const;
|
QString getUri() const;
|
||||||
std::list<std::shared_ptr<linphone::ParticipantInfo>> getParticipantInfos() const;
|
std::list<std::shared_ptr<linphone::ParticipantInfo>> getParticipantInfos() const;
|
||||||
|
bool inviteEnabled() const;
|
||||||
|
|
||||||
void setDateTime(const QDateTime &date);
|
void setDateTime(const QDateTime &date);
|
||||||
void setDuration(int duration);
|
void setDuration(int duration);
|
||||||
|
|
@ -58,6 +59,7 @@ public:
|
||||||
void deleteConferenceInfo();
|
void deleteConferenceInfo();
|
||||||
void cancelConference();
|
void cancelConference();
|
||||||
void updateConferenceInfo();
|
void updateConferenceInfo();
|
||||||
|
void enableInvite(bool enable);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void dateTimeChanged(const QDateTime &date);
|
void dateTimeChanged(const QDateTime &date);
|
||||||
|
|
@ -71,10 +73,12 @@ signals:
|
||||||
void schedulerStateChanged(linphone::ConferenceScheduler::State state);
|
void schedulerStateChanged(linphone::ConferenceScheduler::State state);
|
||||||
void infoStateChanged(linphone::ConferenceInfo::State state);
|
void infoStateChanged(linphone::ConferenceInfo::State state);
|
||||||
void invitationsSent(const std::list<std::shared_ptr<linphone::Address>> &failedInvitations);
|
void invitationsSent(const std::list<std::shared_ptr<linphone::Address>> &failedInvitations);
|
||||||
|
void inviteEnabledChanged(bool enable);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<linphone::ConferenceInfo> mConferenceInfo;
|
std::shared_ptr<linphone::ConferenceInfo> mConferenceInfo;
|
||||||
std::shared_ptr<ConferenceSchedulerModel> mConferenceSchedulerModel = nullptr;
|
std::shared_ptr<ConferenceSchedulerModel> mConferenceSchedulerModel = nullptr;
|
||||||
|
bool mInviteEnabled = true;
|
||||||
DECLARE_ABSTRACT_OBJECT
|
DECLARE_ABSTRACT_OBJECT
|
||||||
|
|
||||||
// LINPHONE
|
// LINPHONE
|
||||||
|
|
|
||||||
|
|
@ -58,11 +58,11 @@ public:
|
||||||
signals:
|
signals:
|
||||||
void microphoneMutedChanged(bool isMuted);
|
void microphoneMutedChanged(bool isMuted);
|
||||||
void speakerMutedChanged(bool isMuted);
|
void speakerMutedChanged(bool isMuted);
|
||||||
void cameraEnabledChanged(bool enabled);
|
|
||||||
void durationChanged(int);
|
void durationChanged(int);
|
||||||
void microphoneVolumeChanged(float);
|
void microphoneVolumeChanged(float);
|
||||||
void pausedChanged(bool paused);
|
void pausedChanged(bool paused);
|
||||||
void remoteVideoEnabledChanged(bool remoteVideoEnabled);
|
void remoteVideoEnabledChanged(bool remoteVideoEnabled);
|
||||||
|
void localVideoEnabledChanged(bool enabled);
|
||||||
void recordingChanged(bool recording);
|
void recordingChanged(bool recording);
|
||||||
void speakerVolumeGainChanged(float volume);
|
void speakerVolumeGainChanged(float volume);
|
||||||
void microphoneVolumeGainChanged(float volume);
|
void microphoneVolumeGainChanged(float volume);
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ bool ToolModel::createCall(const QString &sipAddress,
|
||||||
QString *errorMessage) {
|
QString *errorMessage) {
|
||||||
bool waitRegistrationForCall = true; // getSettingsModel()->getWaitRegistrationForCall()
|
bool waitRegistrationForCall = true; // getSettingsModel()->getWaitRegistrationForCall()
|
||||||
std::shared_ptr<linphone::Core> core = CoreModel::getInstance()->getCore();
|
std::shared_ptr<linphone::Core> core = CoreModel::getInstance()->getCore();
|
||||||
bool cameraEnabled = options.contains("cameraEnabled") ? options["cameraEnabled"].toBool() : false;
|
bool localVideoEnabled = options.contains("localVideoEnabled") ? options["localVideoEnabled"].toBool() : false;
|
||||||
|
|
||||||
std::shared_ptr<linphone::Address> address = interpretUrl(sipAddress);
|
std::shared_ptr<linphone::Address> address = interpretUrl(sipAddress);
|
||||||
if (!address) {
|
if (!address) {
|
||||||
|
|
@ -115,8 +115,7 @@ bool ToolModel::createCall(const QString &sipAddress,
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<linphone::CallParams> params = core->createCallParams(nullptr);
|
std::shared_ptr<linphone::CallParams> params = core->createCallParams(nullptr);
|
||||||
params->enableVideo(true);
|
CallModel::activateLocalVideo(params, nullptr, localVideoEnabled);
|
||||||
params->setVideoDirection(cameraEnabled ? linphone::MediaDirection::SendRecv : linphone::MediaDirection::Inactive);
|
|
||||||
|
|
||||||
params->setMediaEncryption(mediaEncryption);
|
params->setMediaEncryption(mediaEncryption);
|
||||||
if (Utils::coreStringToAppString(params->getRecordFile()).isEmpty()) {
|
if (Utils::coreStringToAppString(params->getRecordFile()).isEmpty()) {
|
||||||
|
|
@ -137,7 +136,6 @@ bool ToolModel::createCall(const QString &sipAddress,
|
||||||
|
|
||||||
if (core->getDefaultAccount()) params->setAccount(core->getDefaultAccount());
|
if (core->getDefaultAccount()) params->setAccount(core->getDefaultAccount());
|
||||||
auto call = core->inviteAddressWithParams(address, params);
|
auto call = core->inviteAddressWithParams(address, params);
|
||||||
call->enableCamera(cameraEnabled);
|
|
||||||
return call != nullptr;
|
return call != nullptr;
|
||||||
|
|
||||||
/* TODO transfer
|
/* TODO transfer
|
||||||
|
|
|
||||||
|
|
@ -788,7 +788,7 @@ Window {
|
||||||
target: rightPanel
|
target: rightPanel
|
||||||
onVisibleChanged: if (!visible) waitingRoomIn.settingsButtonChecked = false
|
onVisibleChanged: if (!visible) waitingRoomIn.settingsButtonChecked = false
|
||||||
}
|
}
|
||||||
onJoinConfRequested: mainWindow.joinConference({'microEnabled':microEnabled, 'cameraEnabled':cameraEnabled})
|
onJoinConfRequested: mainWindow.joinConference({'microEnabled':microEnabled, 'localVideoEnabled':localVideoEnabled})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Component {
|
Component {
|
||||||
|
|
@ -948,12 +948,12 @@ Window {
|
||||||
enabled: mainWindow.conferenceInfo || (mainWindow.callState === LinphoneEnums.CallState.Connected || mainWindow.callState === LinphoneEnums.CallState.StreamsRunning)
|
enabled: mainWindow.conferenceInfo || (mainWindow.callState === LinphoneEnums.CallState.Connected || mainWindow.callState === LinphoneEnums.CallState.StreamsRunning)
|
||||||
iconUrl: AppIcons.videoCamera
|
iconUrl: AppIcons.videoCamera
|
||||||
checkedIconUrl: AppIcons.videoCameraSlash
|
checkedIconUrl: AppIcons.videoCameraSlash
|
||||||
checked: mainWindow.call && !mainWindow.call.core.cameraEnabled
|
checked: mainWindow.call && !mainWindow.call.core.localVideoEnabled
|
||||||
Layout.preferredWidth: 55 * DefaultStyle.dp
|
Layout.preferredWidth: 55 * DefaultStyle.dp
|
||||||
Layout.preferredHeight: 55 * DefaultStyle.dp
|
Layout.preferredHeight: 55 * DefaultStyle.dp
|
||||||
icon.width: 32 * DefaultStyle.dp
|
icon.width: 32 * DefaultStyle.dp
|
||||||
icon.height: 32 * DefaultStyle.dp
|
icon.height: 32 * DefaultStyle.dp
|
||||||
onClicked: mainWindow.call.core.lSetCameraEnabled(!mainWindow.call.core.cameraEnabled)
|
onClicked: mainWindow.call.core.lSetLocalVideoEnabled(!mainWindow.call.core.localVideoEnabled)
|
||||||
}
|
}
|
||||||
CheckableButton {
|
CheckableButton {
|
||||||
iconUrl: AppIcons.microphone
|
iconUrl: AppIcons.microphone
|
||||||
|
|
|
||||||
|
|
@ -245,7 +245,7 @@ Item {
|
||||||
height: 24 * DefaultStyle.dp
|
height: 24 * DefaultStyle.dp
|
||||||
source: AppIcons.videoCamera
|
source: AppIcons.videoCamera
|
||||||
}
|
}
|
||||||
onClicked: UtilsCpp.createCall(sipAddr.text, {'cameraEnabled':true})
|
onClicked: UtilsCpp.createCall(sipAddr.text, {'localVideoEnabled':true})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Button {
|
Button {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import UtilsCpp 1.0
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: mainItem
|
id: mainItem
|
||||||
property alias cameraEnabled: preview.cameraEnabled
|
property alias localVideoEnabled: preview.videoEnabled
|
||||||
property bool microEnabled: true
|
property bool microEnabled: true
|
||||||
property bool settingsButtonChecked: settingsButton.checked
|
property bool settingsButtonChecked: settingsButton.checked
|
||||||
property ConferenceInfoGui conferenceInfo
|
property ConferenceInfoGui conferenceInfo
|
||||||
|
|
@ -43,7 +43,7 @@ RowLayout {
|
||||||
Layout.preferredHeight: 55 * DefaultStyle.dp
|
Layout.preferredHeight: 55 * DefaultStyle.dp
|
||||||
icon.width: 32 * DefaultStyle.dp
|
icon.width: 32 * DefaultStyle.dp
|
||||||
icon.height: 32 * DefaultStyle.dp
|
icon.height: 32 * DefaultStyle.dp
|
||||||
onCheckedChanged: mainItem.cameraEnabled = !mainItem.cameraEnabled
|
onCheckedChanged: mainItem.localVideoEnabled = !mainItem.localVideoEnabled
|
||||||
}
|
}
|
||||||
CheckableButton {
|
CheckableButton {
|
||||||
id: microButton
|
id: microButton
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,7 @@ ListView {
|
||||||
height: 24 * DefaultStyle.dp
|
height: 24 * DefaultStyle.dp
|
||||||
source: AppIcons.videoCamera
|
source: AppIcons.videoCamera
|
||||||
}
|
}
|
||||||
onClicked: UtilsCpp.createCall(modelData.core.defaultAddress, {'cameraEnabled':true})
|
onClicked: UtilsCpp.createCall(modelData.core.defaultAddress, {'localVideoEnabled':true})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PopupButton {
|
PopupButton {
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,8 @@ Item {
|
||||||
|
|
||||||
property string peerAddress:peerAddressObj ? peerAddressObj.value : ""
|
property string peerAddress:peerAddressObj ? peerAddressObj.value : ""
|
||||||
property var identityAddress: account ? UtilsCpp.getDisplayName(account.core.identityAddress) : null
|
property var identityAddress: account ? UtilsCpp.getDisplayName(account.core.identityAddress) : null
|
||||||
property bool cameraEnabled: (previewEnabled && call && call.core.cameraEnabled)
|
property bool videoEnabled: (previewEnabled && call && call.core.localVideoEnabled)
|
||||||
|| (!previewEnabled && participantDevice && participantDevice.core.videoEnabled)
|
|| (participantDevice && participantDevice.core.videoEnabled)
|
||||||
property string qmlName
|
property string qmlName
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
@ -86,7 +86,7 @@ Item {
|
||||||
triggeredOnStart: true
|
triggeredOnStart: true
|
||||||
onTriggered: {cameraLoader.reset = !cameraLoader.reset}
|
onTriggered: {cameraLoader.reset = !cameraLoader.reset}
|
||||||
}
|
}
|
||||||
active: mainItem.visible && mainItem.cameraEnabled && !mainItem.reset
|
active: mainItem.visible && mainItem.videoEnabled && !mainItem.reset
|
||||||
onActiveChanged: console.log("("+mainItem.qmlName+") Camera active " + active)
|
onActiveChanged: console.log("("+mainItem.qmlName+") Camera active " + active)
|
||||||
sourceComponent: cameraComponent
|
sourceComponent: cameraComponent
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -446,10 +446,8 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
Switch {
|
Switch {
|
||||||
text: qsTr("Send invitation to participants")
|
text: qsTr("Send invitation to participants")
|
||||||
Component.onCompleted: {
|
checked: mainItem.conferenceInfoGui.core.inviteEnabled
|
||||||
console.log("TODO : handle send invitation to participants")
|
onToggled: mainItem.conferenceInfoGui.core.inviteEnabled = checked
|
||||||
toggle()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Item {
|
Item {
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ Item{
|
||||||
call: mainItem.call
|
call: mainItem.call
|
||||||
participantDevice: mainItem.conference && mainItem.conference.core.activeSpeaker
|
participantDevice: mainItem.conference && mainItem.conference.core.activeSpeaker
|
||||||
property var address: participantDevice && participantDevice.core.address
|
property var address: participantDevice && participantDevice.core.address
|
||||||
cameraEnabled: call && call.core.remoteVideoEnabled
|
videoEnabled: (participantDevice && participantDevice.core.videoEnabled) || (!participantDevice && call && call.core.remoteVideoEnabled)
|
||||||
qmlName: 'AS'
|
qmlName: 'AS'
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
|
|
@ -113,8 +113,8 @@ Item{
|
||||||
anchors.rightMargin: 10 * DefaultStyle.dp
|
anchors.rightMargin: 10 * DefaultStyle.dp
|
||||||
anchors.bottomMargin: 10 * DefaultStyle.dp
|
anchors.bottomMargin: 10 * DefaultStyle.dp
|
||||||
//participantDevice: allDevices.me
|
//participantDevice: allDevices.me
|
||||||
cameraEnabled: preview.visible && mainItem.call && mainItem.call.core.cameraEnabled
|
videoEnabled: preview.visible && mainItem.call && mainItem.call.core.localVideoEnabled
|
||||||
onCameraEnabledChanged: console.log("P : " +cameraEnabled + " / " +visible +" / " +mainItem.call)
|
onVideoEnabledChanged: console.log("P : " +videoEnabled + " / " +visible +" / " +mainItem.call)
|
||||||
property AccountProxy accounts: AccountProxy{id: accountProxy}
|
property AccountProxy accounts: AccountProxy{id: accountProxy}
|
||||||
account: accountProxy.defaultAccount
|
account: accountProxy.defaultAccount
|
||||||
call: mainItem.call
|
call: mainItem.call
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,13 @@ Item {
|
||||||
property bool callTerminatedByUser: false
|
property bool callTerminatedByUser: false
|
||||||
readonly property var callState: call && call.core.state || undefined
|
readonly property var callState: call && call.core.state || undefined
|
||||||
property int conferenceLayout: call && call.core.conferenceVideoLayout || 0
|
property int conferenceLayout: call && call.core.conferenceVideoLayout || 0
|
||||||
onConferenceLayoutChanged:console.log("CallLayout change : " +conferenceLayout)
|
onConferenceLayoutChanged: {
|
||||||
|
console.log("CallLayout change : " +conferenceLayout)
|
||||||
|
callLayout.sourceComponent = undefined // unload old view before opening the new view to avoid conflicts in Video UI.
|
||||||
|
callLayout.sourceComponent = mainItem.conferenceLayout == LinphoneEnums.ConferenceLayout.ActiveSpeaker
|
||||||
|
? activeSpeakerComponent
|
||||||
|
: gridComponent
|
||||||
|
}
|
||||||
onCallStateChanged: if (callState === LinphoneEnums.CallState.End) {
|
onCallStateChanged: if (callState === LinphoneEnums.CallState.End) {
|
||||||
callTerminatedText.visible = true
|
callTerminatedText.visible = true
|
||||||
}else if( callState === LinphoneEnums.CallState.Error) {
|
}else if( callState === LinphoneEnums.CallState.Error) {
|
||||||
|
|
@ -46,9 +52,7 @@ Item {
|
||||||
id: callLayout
|
id: callLayout
|
||||||
Layout.Layout.fillWidth: true
|
Layout.Layout.fillWidth: true
|
||||||
Layout.Layout.fillHeight: true
|
Layout.Layout.fillHeight: true
|
||||||
sourceComponent: mainItem.conferenceLayout == LinphoneEnums.ConferenceLayout.ActiveSpeaker
|
sourceComponent: gridComponent
|
||||||
? activeSpeakerComponent
|
|
||||||
: gridComponent
|
|
||||||
}
|
}
|
||||||
Layout.ColumnLayout {
|
Layout.ColumnLayout {
|
||||||
id: userNotFoundLayout
|
id: userNotFoundLayout
|
||||||
|
|
@ -100,230 +104,4 @@ Item {
|
||||||
// Layout.preferredHeight: 47 * DefaultStyle.dp
|
// Layout.preferredHeight: 47 * DefaultStyle.dp
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
/*
|
|
||||||
Sticker {
|
|
||||||
id: preview
|
|
||||||
visible: mainItem.callState != LinphoneEnums.CallState.End
|
|
||||||
&& mainItem.callState != LinphoneEnums.CallState.Released
|
|
||||||
height: 180 * DefaultStyle.dp
|
|
||||||
width: 300 * DefaultStyle.dp
|
|
||||||
anchors.right: mainItem.right
|
|
||||||
anchors.bottom: mainItem.bottom
|
|
||||||
anchors.rightMargin: 10 * DefaultStyle.dp
|
|
||||||
anchors.bottomMargin: 10 * DefaultStyle.dp
|
|
||||||
AccountProxy{
|
|
||||||
id: accounts
|
|
||||||
}
|
|
||||||
account: accounts.defaultAccount
|
|
||||||
previewEnabled: mainItem.call.core.cameraEnabled
|
|
||||||
|
|
||||||
MovableMouseArea {
|
|
||||||
id: previewMouseArea
|
|
||||||
anchors.fill: parent
|
|
||||||
// visible: mainItem.participantCount <= 2
|
|
||||||
movableArea: mainItem
|
|
||||||
margin: 10 * DefaultStyle.dp
|
|
||||||
function resetPosition(){
|
|
||||||
preview.anchors.right = mainItem.right
|
|
||||||
preview.anchors.bottom = mainItem.bottom
|
|
||||||
preview.anchors.rightMargin = previewMouseArea.margin
|
|
||||||
preview.anchors.bottomMargin = previewMouseArea.margin
|
|
||||||
}
|
|
||||||
onVisibleChanged: if(!visible){
|
|
||||||
resetPosition()
|
|
||||||
}
|
|
||||||
drag.target: preview
|
|
||||||
onDraggingChanged: if(dragging) {
|
|
||||||
preview.anchors.right = undefined
|
|
||||||
preview.anchors.bottom = undefined
|
|
||||||
}
|
|
||||||
onRequestResetPosition: resetPosition()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
property int previousWidth
|
|
||||||
Component.onCompleted: {
|
|
||||||
previousWidth = width
|
|
||||||
}
|
|
||||||
onWidthChanged: {
|
|
||||||
if (width < previousWidth) {
|
|
||||||
previewMouseArea.updatePosition(0, 0)
|
|
||||||
} else {
|
|
||||||
previewMouseArea.updatePosition(width - previousWidth, 0)
|
|
||||||
}
|
|
||||||
previousWidth = width
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: mainItem
|
|
||||||
property CallModel callModel
|
|
||||||
property bool isRightReducedLayout: false
|
|
||||||
property bool isLeftReducedLayout: false
|
|
||||||
property bool cameraEnabled: true
|
|
||||||
property bool isConference: callModel && callModel.isConference
|
|
||||||
property bool isConferenceReady: isConference && callModel.conferenceModel && callModel.conferenceModel.isReady
|
|
||||||
|
|
||||||
property int participantCount: isConference ? allDevices.count + 1 : 2 // +me. allDevices==0 if !conference
|
|
||||||
|
|
||||||
property ParticipantDeviceProxyModel participantDevices : ParticipantDeviceProxyModel {
|
|
||||||
id: allDevices
|
|
||||||
callModel: mainItem.callModel
|
|
||||||
showMe: false
|
|
||||||
|
|
||||||
onConferenceCreated: cameraView.resetCamera()
|
|
||||||
}
|
|
||||||
|
|
||||||
Sticker{
|
|
||||||
id: cameraView
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.leftMargin: isRightReducedLayout || isLeftReducedLayout? 30 : 140
|
|
||||||
anchors.rightMargin: isRightReducedLayout ? 10 : 140
|
|
||||||
cameraQmlName: 'AS'
|
|
||||||
callModel: mainItem.callModel
|
|
||||||
currentDevice: isPreview
|
|
||||||
? allDevices.me
|
|
||||||
: mainItem.isConference
|
|
||||||
? allDevices.activeSpeaker
|
|
||||||
: null
|
|
||||||
deactivateCamera: !mainItem.cameraEnabled || (isPreview && callModel.pausedByUser)
|
|
||||||
? true
|
|
||||||
: mainItem.isConference
|
|
||||||
? (callModel && (callModel.pausedByUser || callModel.status === CallModel.CallStatusPaused) )
|
|
||||||
|| (!(callModel && callModel.cameraEnabled) && mainItem.participantCount == 1)
|
|
||||||
|| (currentDevice && !currentDevice.videoEnabled)// && mainItem.participantCount == 2)
|
|
||||||
|| !mainItem.isConferenceReady
|
|
||||||
: (callModel && (callModel.pausedByUser || callModel.status === CallModel.CallStatusPaused || !callModel.videoEnabled) )
|
|
||||||
|| currentDevice && !currentDevice.videoEnabled
|
|
||||||
isPreview: !preview.visible && mainItem.participantCount == 1
|
|
||||||
onIsPreviewChanged: {cameraView.resetCamera() }
|
|
||||||
isCameraFromDevice: isPreview
|
|
||||||
isPaused: isPreview && callModel.pausedByUser
|
|
||||||
? false
|
|
||||||
: mainItem.isConference
|
|
||||||
? //callModel && callModel.pausedByUser && mainItem.participantCount != 2 ||
|
|
||||||
(currentDevice && currentDevice.isPaused)
|
|
||||||
: callModel && !callModel.pausedByUser && (callModel.status === CallModel.CallStatusPaused)
|
|
||||||
|
|
||||||
quickTransition: true
|
|
||||||
showCloseButton: false
|
|
||||||
showActiveSpeakerOverlay: false // This is an active speaker. We don't need to show the indicator.
|
|
||||||
showCustomButton: false
|
|
||||||
avatarStickerBackgroundColor: isPreview ? IncallStyle.container.avatar.stickerPreviewBackgroundColor.color : IncallStyle.container.avatar.stickerBackgroundColor.color
|
|
||||||
avatarBackgroundColor: IncallStyle.container.avatar.backgroundColor.color
|
|
||||||
}
|
|
||||||
Item{// Need an item to not override Sticker internal states. States are needed for changing anchors.
|
|
||||||
id: preview
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.rightMargin: 30
|
|
||||||
anchors.bottomMargin: 15
|
|
||||||
|
|
||||||
height: visible ? miniViews.cellHeight : 0
|
|
||||||
width: 16 * height / 9
|
|
||||||
|
|
||||||
visible: mainItem.isConferenceReady && allDevices.count >= 1
|
|
||||||
|| (!mainItem.isConference && mainItem.callModel && mainItem.callModel.cameraEnabled)// use videoEnabled if we want to show the preview sticker
|
|
||||||
|
|
||||||
Loader{
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: 3
|
|
||||||
sourceComponent:
|
|
||||||
Sticker{
|
|
||||||
id: previewSticker
|
|
||||||
cameraQmlName: 'AS_Preview'
|
|
||||||
deactivateCamera: !mainItem.cameraEnabled || !mainItem.callModel || callModel.pausedByUser || !mainItem.callModel.cameraEnabled
|
|
||||||
currentDevice: allDevices.me
|
|
||||||
isPreview: true
|
|
||||||
callModel: mainItem.callModel
|
|
||||||
isCameraFromDevice: true
|
|
||||||
showCloseButton: false
|
|
||||||
showCustomButton: false
|
|
||||||
showAvatarBorder: true
|
|
||||||
avatarStickerBackgroundColor: IncallStyle.container.avatar.stickerPreviewBackgroundColor.color
|
|
||||||
avatarBackgroundColor: IncallStyle.container.avatar.backgroundColor.color
|
|
||||||
}
|
|
||||||
active: parent.visible
|
|
||||||
}
|
|
||||||
|
|
||||||
MovableMouseArea{
|
|
||||||
id: dragger
|
|
||||||
anchors.fill: parent
|
|
||||||
visible: mainItem.participantCount <= 2
|
|
||||||
function resetPosition(){
|
|
||||||
preview.anchors.right = mainItem.right
|
|
||||||
preview.anchors.bottom = mainItem.bottom
|
|
||||||
}
|
|
||||||
onVisibleChanged: if(!visible){
|
|
||||||
resetPosition()
|
|
||||||
}
|
|
||||||
drag.target: preview
|
|
||||||
onDraggingChanged: if(dragging){
|
|
||||||
preview.anchors.right = undefined
|
|
||||||
preview.anchors.bottom = undefined
|
|
||||||
}
|
|
||||||
onRequestResetPosition: resetPosition()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item{
|
|
||||||
id: miniViewArea
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.bottom: preview.top
|
|
||||||
anchors.rightMargin: 30
|
|
||||||
anchors.topMargin: 15
|
|
||||||
anchors.bottomMargin: 0
|
|
||||||
//---------------
|
|
||||||
width: 16 * miniViews.cellHeight / 9
|
|
||||||
visible: mainItem.isConferenceReady || !mainItem.isConference
|
|
||||||
property int heightLeft: parent.height - preview.height
|
|
||||||
onHeightLeftChanged: {Qt.callLater(miniViewArea.forceRefresh)}
|
|
||||||
function forceRefresh(){// Force a content refresh via margins. Qt is buggy when managing sizes in ListView.
|
|
||||||
++miniViewArea.anchors.topMargin
|
|
||||||
--miniViewArea.anchors.topMargin
|
|
||||||
}
|
|
||||||
|
|
||||||
ScrollableListView{
|
|
||||||
id: miniViews
|
|
||||||
property int cellHeight: 150
|
|
||||||
anchors.fill: parent
|
|
||||||
model : mainItem.isConference && mainItem.participantDevices.count > 1 ? mainItem.participantDevices : []
|
|
||||||
spacing: 0
|
|
||||||
verticalLayoutDirection: ListView.BottomToTop
|
|
||||||
fitCacheToContent: false
|
|
||||||
property int oldCount : 0// Count changed can be called without a change... (bug?). Use oldCount to avoid it.
|
|
||||||
onCountChanged: {if(oldCount != count){ oldCount = count ; Qt.callLater(miniViewArea.forceRefresh)}}
|
|
||||||
Component.onCompleted: {Qt.callLater(miniViewArea.forceRefresh)}
|
|
||||||
delegate:Item{
|
|
||||||
height: visible ? miniViews.cellHeight + 15 : 0
|
|
||||||
width: visible ? miniViews.width : 0
|
|
||||||
visible: cameraView.currentDevice != modelData
|
|
||||||
clip:false
|
|
||||||
Sticker{
|
|
||||||
id: miniView
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.topMargin: 3
|
|
||||||
anchors.leftMargin: 3
|
|
||||||
anchors.rightMargin: 3
|
|
||||||
anchors.bottomMargin: 18
|
|
||||||
cameraQmlName: 'S_'+index
|
|
||||||
deactivateCamera: (!mainItem.isConferenceReady || !mainItem.isConference)
|
|
||||||
&& (index <0 || !mainItem.cameraEnabled || (!modelData.videoEnabled) || (callModel && callModel.pausedByUser) )
|
|
||||||
currentDevice: modelData.isPreview ? null : modelData
|
|
||||||
callModel: modelData.isPreview ? null : mainItem.callModel
|
|
||||||
isCameraFromDevice: mainItem.isConference
|
|
||||||
isPaused: currentDevice && currentDevice.isPaused
|
|
||||||
showCloseButton: false
|
|
||||||
showCustomButton: false
|
|
||||||
showAvatarBorder: true
|
|
||||||
avatarStickerBackgroundColor: IncallStyle.container.avatar.stickerBackgroundColor.color
|
|
||||||
avatarBackgroundColor: IncallStyle.container.avatar.backgroundColor.color
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import Linphone
|
||||||
Mosaic {
|
Mosaic {
|
||||||
id: grid
|
id: grid
|
||||||
property alias call: allDevices.currentCall
|
property alias call: allDevices.currentCall
|
||||||
property bool cameraEnabled: true
|
property bool videoEnabled: true
|
||||||
property int participantCount: gridModel.count
|
property int participantCount: gridModel.count
|
||||||
|
|
||||||
// On grid view, we limit the quality if there are enough participants// The vga mode has been activated from the factory rc
|
// On grid view, we limit the quality if there are enough participants// The vga mode has been activated from the factory rc
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import 'qrc:/ui/scripts/Utils/utils.js' as Utils
|
||||||
Mosaic {
|
Mosaic {
|
||||||
id: grid
|
id: grid
|
||||||
property alias callModel: participantDevices.callModel
|
property alias callModel: participantDevices.callModel
|
||||||
property bool cameraEnabled: true
|
property bool videoEnabled: true
|
||||||
property int participantCount: gridModel.count
|
property int participantCount: gridModel.count
|
||||||
|
|
||||||
// On grid view, we limit the quality if there are enough participants// The vga mode has been activated from the factory rc
|
// On grid view, we limit the quality if there are enough participants// The vga mode has been activated from the factory rc
|
||||||
|
|
@ -50,7 +50,7 @@ Mosaic {
|
||||||
|
|
||||||
cameraQmlName: 'G_'+index
|
cameraQmlName: 'G_'+index
|
||||||
callModel: index >= 0 ? participantDevices.callModel : null // do this before to prioritize changing call on remove
|
callModel: index >= 0 ? participantDevices.callModel : null // do this before to prioritize changing call on remove
|
||||||
deactivateCamera: index <0 || !grid.cameraEnabled || grid.callModel.pausedByUser
|
deactivateCamera: index <0 || !grid.videoEnabled || grid.callModel.pausedByUser
|
||||||
currentDevice: gridModel.participantDevices.getAt(index)
|
currentDevice: gridModel.participantDevices.getAt(index)
|
||||||
|
|
||||||
isCameraFromDevice: true
|
isCameraFromDevice: true
|
||||||
|
|
|
||||||
|
|
@ -152,8 +152,7 @@ ColumnLayout {
|
||||||
label: qsTr("Appel Video")
|
label: qsTr("Appel Video")
|
||||||
button.onClicked: {
|
button.onClicked: {
|
||||||
var addr = UtilsCpp.generateLinphoneSipAddress(mainItem.contactAddress)
|
var addr = UtilsCpp.generateLinphoneSipAddress(mainItem.contactAddress)
|
||||||
UtilsCpp.createCall(addr)
|
UtilsCpp.createCall(addr, {'localVideoEnabled':true})
|
||||||
console.log("[CallPage.qml] TODO : enable video")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue