Skip to content
Snippets Groups Projects
Commit 5a0ee1c2 authored by Aline Gondim Santos's avatar Aline Gondim Santos Committed by Andreas Traczyk
Browse files

multistream: add video to audio only calls

Change-Id: Ife36489e1b9dc63e971789ce79047690eb681aeb
GitLab: #389
parent 7d0f4e00
No related branches found
No related tags found
No related merge requests found
...@@ -248,6 +248,26 @@ CallAdapter::onCallStatusChanged(const QString& callId, int code) ...@@ -248,6 +248,26 @@ CallAdapter::onCallStatusChanged(const QString& callId, int code)
} }
} }
void
CallAdapter::onCallInfosChanged(const QString& accountId, const QString& callId)
{
auto& accInfo = lrcInstance_->accountModel().getAccountInfo(accountId);
auto& callModel = accInfo.callModel;
try {
const auto call = callModel->getCall(callId);
/*
* Change status label text.
*/
const auto& convInfo = lrcInstance_->getConversationFromCallId(callId);
if (!convInfo.uid.isEmpty()) {
Q_EMIT callInfosChanged(call.isAudioOnly, accountId, convInfo.uid);
updateCallOverlay(convInfo);
}
} catch (...) {
}
}
void void
CallAdapter::onRemoteRecordingChanged(const QString& callId, CallAdapter::onRemoteRecordingChanged(const QString& callId,
const QSet<QString>& peerRec, const QSet<QString>& peerRec,
...@@ -604,6 +624,11 @@ CallAdapter::connectCallModel(const QString& accountId) ...@@ -604,6 +624,11 @@ CallAdapter::connectCallModel(const QString& accountId)
this, this,
&CallAdapter::onCallAddedToConference, &CallAdapter::onCallAddedToConference,
Qt::UniqueConnection); Qt::UniqueConnection);
connect(accInfo.callModel.get(),
&NewCallModel::callInfosChanged,
this,
QOverload<const QString&, const QString&>::of(&CallAdapter::onCallInfosChanged));
} }
void void
...@@ -979,7 +1004,7 @@ CallAdapter::muteThisCallToggle() ...@@ -979,7 +1004,7 @@ CallAdapter::muteThisCallToggle()
} }
auto* callModel = lrcInstance_->getCurrentCallModel(); auto* callModel = lrcInstance_->getCurrentCallModel();
if (callModel->hasCall(callId)) { if (callModel->hasCall(callId)) {
callModel->toggleMedia(callId, lrc::api::NewCallModel::Media::AUDIO); callModel->requestMediaChange(callId, "audio_0");
} }
} }
...@@ -1005,7 +1030,9 @@ CallAdapter::videoPauseThisCallToggle() ...@@ -1005,7 +1030,9 @@ CallAdapter::videoPauseThisCallToggle()
} }
auto* callModel = lrcInstance_->getCurrentCallModel(); auto* callModel = lrcInstance_->getCurrentCallModel();
if (callModel->hasCall(callId)) { if (callModel->hasCall(callId)) {
callModel->toggleMedia(callId, lrc::api::NewCallModel::Media::VIDEO); callModel->requestMediaChange(callId, "video_0");
// media label should come from qml
// also thi function can me emrged with "muteThisCallToggle"
} }
Q_EMIT previewVisibilityNeedToChange(shouldShowPreview(false)); Q_EMIT previewVisibilityNeedToChange(shouldShowPreview(false));
} }
......
...@@ -84,6 +84,7 @@ public: ...@@ -84,6 +84,7 @@ public:
Q_SIGNALS: Q_SIGNALS:
void callStatusChanged(int index, const QString& accountId, const QString& convUid); void callStatusChanged(int index, const QString& accountId, const QString& convUid);
void callInfosChanged(const QVariant& infos, const QString& accountId, const QString& convUid);
void updateParticipantsInfos(const QVariantList& infos, void updateParticipantsInfos(const QVariantList& infos,
const QString& accountId, const QString& accountId,
const QString& callId); const QString& callId);
...@@ -109,6 +110,7 @@ public Q_SLOTS: ...@@ -109,6 +110,7 @@ public Q_SLOTS:
void onShowCallView(const QString& accountId, const QString& convUid); void onShowCallView(const QString& accountId, const QString& convUid);
void onAccountChanged(); void onAccountChanged();
void onCallStatusChanged(const QString& accountId, const QString& callId); void onCallStatusChanged(const QString& accountId, const QString& callId);
void onCallInfosChanged(const QString& accountId, const QString& callId);
void onParticipantsChanged(const QString& confId); void onParticipantsChanged(const QString& confId);
void onCallStatusChanged(const QString& callId, int code); void onCallStatusChanged(const QString& callId, int code);
void onRemoteRecordingChanged(const QString& callId, const QSet<QString>& peerRec, bool state); void onRemoteRecordingChanged(const QString& callId, const QSet<QString>& peerRec, bool state);
......
...@@ -303,6 +303,7 @@ Control { ...@@ -303,6 +303,7 @@ Control {
Connections { Connections {
target: callOverlay target: callOverlay
function onIsAudioOnlyChanged() { reset() } function onIsAudioOnlyChanged() { reset() }
function onIsSIPChanged() { reset() } function onIsSIPChanged() { reset() }
function onIsModeratorChanged() { reset() } function onIsModeratorChanged() { reset() }
...@@ -317,8 +318,7 @@ Control { ...@@ -317,8 +318,7 @@ Control {
// centered controls // centered controls
CallOverlayModel.addPrimaryControl(muteAudioAction) CallOverlayModel.addPrimaryControl(muteAudioAction)
CallOverlayModel.addPrimaryControl(hangupAction) CallOverlayModel.addPrimaryControl(hangupAction)
if (!isAudioOnly) CallOverlayModel.addPrimaryControl(muteVideoAction)
CallOverlayModel.addPrimaryControl(muteVideoAction)
// overflow controls // overflow controls
CallOverlayModel.addSecondaryControl(audioOutputAction) CallOverlayModel.addSecondaryControl(audioOutputAction)
...@@ -337,7 +337,7 @@ Control { ...@@ -337,7 +337,7 @@ Control {
overflowItemCount = CallOverlayModel.secondaryModel().rowCount() overflowItemCount = CallOverlayModel.secondaryModel().rowCount()
muteAudioAction.checked = isAudioMuted muteAudioAction.checked = isAudioMuted
muteVideoAction.checked = isVideoMuted muteVideoAction.checked = isAudioOnly ? true : isVideoMuted
} }
Item { Item {
......
...@@ -56,8 +56,7 @@ Item { ...@@ -56,8 +56,7 @@ Item {
ParticipantsLayer { ParticipantsLayer {
id: __participantsLayer id: __participantsLayer
isAudioOnly: root.isAudioOnly visible: !root.isAudioOnly
isVideoMuted: root.isVideoMuted
anchors.fill: parent anchors.fill: parent
} }
......
...@@ -147,6 +147,13 @@ Rectangle { ...@@ -147,6 +147,13 @@ Rectangle {
Connections { Connections {
target: CallAdapter target: CallAdapter
function onCallInfosChanged(audioOnly, accountId, convUid) {
if (callStackMainView.currentItem.stackNumber === CallStackView.OngoingPageStack
&& responsibleConvUid === convUid && responsibleAccountId === accountId) {
ongoingCallPage.isAudioOnly = audioOnly
}
}
function onCallStatusChanged(status, accountId, convUid) { function onCallStatusChanged(status, accountId, convUid) {
if (callStackMainView.currentItem.stackNumber === CallStackView.InitialPageStack if (callStackMainView.currentItem.stackNumber === CallStackView.InitialPageStack
&& responsibleConvUid === convUid && responsibleAccountId === accountId) { && responsibleConvUid === convUid && responsibleAccountId === accountId) {
......
...@@ -202,7 +202,7 @@ Rectangle { ...@@ -202,7 +202,7 @@ Rectangle {
id: previewRenderer id: previewRenderer
lrcInstance: LRCInstance lrcInstance: LRCInstance
visible: !root.isAudioOnly visible: !callOverlay.isAudioOnly && !callOverlay.isConferenceCall && !callOverlay.isVideoMuted && !callOverlay.isPaused
Connections { Connections {
target: CallAdapter target: CallAdapter
...@@ -313,6 +313,7 @@ Rectangle { ...@@ -313,6 +313,7 @@ Rectangle {
isRecording, isSIP, isConferenceCall, isGrid, isRecording, isSIP, isConferenceCall, isGrid,
bestName) { bestName) {
callOverlay.showOnHoldImage(isPaused) callOverlay.showOnHoldImage(isPaused)
root.isAudioOnly = isAudioOnly
audioCallPageRectCentralRect.visible = !isPaused && root.isAudioOnly audioCallPageRectCentralRect.visible = !isPaused && root.isAudioOnly
callOverlay.updateUI(isPaused, isAudioOnly, callOverlay.updateUI(isPaused, isAudioOnly,
isAudioMuted, isVideoMuted, isAudioMuted, isVideoMuted,
......
...@@ -22,8 +22,6 @@ import QtQml 2.14 ...@@ -22,8 +22,6 @@ import QtQml 2.14
Item { Item {
id: root id: root
property bool isAudioOnly
property bool isVideoMuted
property var participantOverlays: [] property var participantOverlays: []
property var participantComponent: Qt.createComponent("ParticipantOverlay.qml") property var participantComponent: Qt.createComponent("ParticipantOverlay.qml")
...@@ -37,8 +35,6 @@ Item { ...@@ -37,8 +35,6 @@ Item {
} }
function update(infos) { function update(infos) {
if (isAudioOnly)
return;
// TODO: in the future the conference layout should be entirely managed by the client // TODO: in the future the conference layout should be entirely managed by the client
// Hack: truncate and ceil participant's overlay position and size to correct // Hack: truncate and ceil participant's overlay position and size to correct
// when they are not exacts // when they are not exacts
...@@ -95,7 +91,7 @@ Item { ...@@ -95,7 +91,7 @@ Item {
participantOverlays = participantOverlays.filter(part => !deletedUris.includes(part.uri)) participantOverlays = participantOverlays.filter(part => !deletedUris.includes(part.uri))
if (infos.length === 0) { // Return to normal call if (infos.length === 0) { // Return to normal call
previewRenderer.visible = !isVideoMuted previewRenderer.visible = !isAudioOnly && !isVideoMuted && !isConferenceCall && !isPaused
for (var part in participantOverlays) { for (var part in participantOverlays) {
if (participantOverlays[part]) { if (participantOverlays[part]) {
participantOverlays[part].destroy() participantOverlays[part].destroy()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment