1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-09-10 12:03:18 +02:00

multistream: add video to audio only calls

Change-Id: Ife36489e1b9dc63e971789ce79047690eb681aeb
GitLab: #389
This commit is contained in:
agsantos 2021-05-28 10:28:04 -04:00 committed by Andreas Traczyk
parent 7d0f4e00ff
commit 5a0ee1c2f4
7 changed files with 45 additions and 13 deletions

View file

@ -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
CallAdapter::onRemoteRecordingChanged(const QString& callId,
const QSet<QString>& peerRec,
@ -604,6 +624,11 @@ CallAdapter::connectCallModel(const QString& accountId)
this,
&CallAdapter::onCallAddedToConference,
Qt::UniqueConnection);
connect(accInfo.callModel.get(),
&NewCallModel::callInfosChanged,
this,
QOverload<const QString&, const QString&>::of(&CallAdapter::onCallInfosChanged));
}
void
@ -979,7 +1004,7 @@ CallAdapter::muteThisCallToggle()
}
auto* callModel = lrcInstance_->getCurrentCallModel();
if (callModel->hasCall(callId)) {
callModel->toggleMedia(callId, lrc::api::NewCallModel::Media::AUDIO);
callModel->requestMediaChange(callId, "audio_0");
}
}
@ -1005,7 +1030,9 @@ CallAdapter::videoPauseThisCallToggle()
}
auto* callModel = lrcInstance_->getCurrentCallModel();
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));
}

View file

@ -84,6 +84,7 @@ public:
Q_SIGNALS:
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,
const QString& accountId,
const QString& callId);
@ -109,6 +110,7 @@ public Q_SLOTS:
void onShowCallView(const QString& accountId, const QString& convUid);
void onAccountChanged();
void onCallStatusChanged(const QString& accountId, const QString& callId);
void onCallInfosChanged(const QString& accountId, const QString& callId);
void onParticipantsChanged(const QString& confId);
void onCallStatusChanged(const QString& callId, int code);
void onRemoteRecordingChanged(const QString& callId, const QSet<QString>& peerRec, bool state);

View file

@ -303,6 +303,7 @@ Control {
Connections {
target: callOverlay
function onIsAudioOnlyChanged() { reset() }
function onIsSIPChanged() { reset() }
function onIsModeratorChanged() { reset() }
@ -317,8 +318,7 @@ Control {
// centered controls
CallOverlayModel.addPrimaryControl(muteAudioAction)
CallOverlayModel.addPrimaryControl(hangupAction)
if (!isAudioOnly)
CallOverlayModel.addPrimaryControl(muteVideoAction)
CallOverlayModel.addPrimaryControl(muteVideoAction)
// overflow controls
CallOverlayModel.addSecondaryControl(audioOutputAction)
@ -337,7 +337,7 @@ Control {
overflowItemCount = CallOverlayModel.secondaryModel().rowCount()
muteAudioAction.checked = isAudioMuted
muteVideoAction.checked = isVideoMuted
muteVideoAction.checked = isAudioOnly ? true : isVideoMuted
}
Item {

View file

@ -56,8 +56,7 @@ Item {
ParticipantsLayer {
id: __participantsLayer
isAudioOnly: root.isAudioOnly
isVideoMuted: root.isVideoMuted
visible: !root.isAudioOnly
anchors.fill: parent
}

View file

@ -147,6 +147,13 @@ Rectangle {
Connections {
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) {
if (callStackMainView.currentItem.stackNumber === CallStackView.InitialPageStack
&& responsibleConvUid === convUid && responsibleAccountId === accountId) {

View file

@ -202,7 +202,7 @@ Rectangle {
id: previewRenderer
lrcInstance: LRCInstance
visible: !root.isAudioOnly
visible: !callOverlay.isAudioOnly && !callOverlay.isConferenceCall && !callOverlay.isVideoMuted && !callOverlay.isPaused
Connections {
target: CallAdapter
@ -313,6 +313,7 @@ Rectangle {
isRecording, isSIP, isConferenceCall, isGrid,
bestName) {
callOverlay.showOnHoldImage(isPaused)
root.isAudioOnly = isAudioOnly
audioCallPageRectCentralRect.visible = !isPaused && root.isAudioOnly
callOverlay.updateUI(isPaused, isAudioOnly,
isAudioMuted, isVideoMuted,

View file

@ -22,8 +22,6 @@ import QtQml 2.14
Item {
id: root
property bool isAudioOnly
property bool isVideoMuted
property var participantOverlays: []
property var participantComponent: Qt.createComponent("ParticipantOverlay.qml")
@ -37,8 +35,6 @@ Item {
}
function update(infos) {
if (isAudioOnly)
return;
// 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
// when they are not exacts
@ -95,7 +91,7 @@ Item {
participantOverlays = participantOverlays.filter(part => !deletedUris.includes(part.uri))
if (infos.length === 0) { // Return to normal call
previewRenderer.visible = !isVideoMuted
previewRenderer.visible = !isAudioOnly && !isVideoMuted && !isConferenceCall && !isPaused
for (var part in participantOverlays) {
if (participantOverlays[part]) {
participantOverlays[part].destroy()