diff --git a/daemon b/daemon index 95832cfc9d5f4bd09a7f3e3e7d26d8227b1fa3f2..2c615dbc8aaf79b4cf5023b700051f2097f98ef5 160000 --- a/daemon +++ b/daemon @@ -1 +1 @@ -Subproject commit 95832cfc9d5f4bd09a7f3e3e7d26d8227b1fa3f2 +Subproject commit 2c615dbc8aaf79b4cf5023b700051f2097f98ef5 diff --git a/src/app/avadapter.cpp b/src/app/avadapter.cpp index e3167a752a4dfc74e9aa084090b836bc625fccaf..6557d43a5692d3476f94c78e26d12eeb1784e726 100644 --- a/src/app/avadapter.cpp +++ b/src/app/avadapter.cpp @@ -345,9 +345,11 @@ AvAdapter::shareScreenArea(unsigned x, unsigned y, unsigned width, unsigned heig } void -AvAdapter::shareWindow(const QString& windowProcessId, const QString& windowId) +AvAdapter::shareWindow(const QString& windowProcessId, const QString& windowId, const int fps) { - auto resource = lrcInstance_->getCurrentCallModel()->getDisplay(windowProcessId, windowId); + auto resource = lrcInstance_->getCurrentCallModel()->getDisplay(windowProcessId, + windowId, + fps); auto callId = lrcInstance_->getCurrentCallId(); muteCamera_ = !isCapturing(); @@ -356,7 +358,10 @@ AvAdapter::shareWindow(const QString& windowProcessId, const QString& windowId) } QString -AvAdapter::getSharingResource(int screenId, const QString& windowProcessId, const QString& windowId) +AvAdapter::getSharingResource(int screenId, + const QString& windowProcessId, + const QString& windowId, + const int fps) { if (screenId == -1) { const auto arrangementRect = getAllScreensBoundingRect(); @@ -387,7 +392,7 @@ AvAdapter::getSharingResource(int screenId, const QString& windowProcessId, cons rect.height() * screen->devicePixelRatio()); } else if (!windowId.isEmpty()) { - return lrcInstance_->getCurrentCallModel()->getDisplay(windowProcessId, windowId); + return lrcInstance_->getCurrentCallModel()->getDisplay(windowProcessId, windowId, fps); } return ""; diff --git a/src/app/avadapter.h b/src/app/avadapter.h index 029492c0f3f36129f3ceb31d1533daedc91963df..faa861200ebcbe69147196bb12031aa1dcfc3c1a 100644 --- a/src/app/avadapter.h +++ b/src/app/avadapter.h @@ -96,7 +96,9 @@ protected: Q_INVOKABLE void shareScreenArea(unsigned x, unsigned y, unsigned width, unsigned height); // Select window to display (all platforms except Wayland). - Q_INVOKABLE void shareWindow(const QString& windowProcessId, const QString& windowId); + Q_INVOKABLE void shareWindow(const QString& windowProcessId, + const QString& windowId, + const int fps = -1); #ifdef Q_OS_LINUX // Share a window on Wayland. @@ -110,7 +112,8 @@ protected: // Returns the screensharing resource Q_INVOKABLE QString getSharingResource(int screenId = -2, const QString& windowProcessId = "", - const QString& key = ""); + const QString& key = "", + const int fps = -1); Q_INVOKABLE void getListWindows(); diff --git a/src/app/mainview/components/SelectScreen.qml b/src/app/mainview/components/SelectScreen.qml index d987e42f480b770b15609901a643c5ce8848df69..cef3cf0eb227531ddaeb1eceb4cd1df5dd1bfb83 100644 --- a/src/app/mainview/components/SelectScreen.qml +++ b/src/app/mainview/components/SelectScreen.qml @@ -49,35 +49,33 @@ Window { function calculateRepeaterModel() { var newModel = []; var idx; - if (!showWindows) { for (idx in Qt.application.screens) { newModel.push({ - title: JamiStrings.screen.arg(idx), - index: parseInt(idx), - isAllScreens: false - }); + title: JamiStrings.screen.arg(idx), + index: parseInt(idx), + isAllScreens: false + }); } } else { AvAdapter.getListWindows(); for (idx in AvAdapter.windowsNames) { newModel.push({ - title: AvAdapter.windowsNames[idx], - index: parseInt(idx), - isAllScreens: false - }); + title: AvAdapter.windowsNames[idx], + index: parseInt(idx), + isAllScreens: false + }); } } // Add "All Screens" option for non-Windows platforms when showing screens if (!showWindows && Qt.application.screens.length > 1 && Qt.platform.os.toString() !== "windows") { newModel.unshift({ - title: JamiStrings.allScreens, - index: -1, - isAllScreens: true - }); + title: JamiStrings.allScreens, + index: -1, + isAllScreens: true + }); } - listModel = newModel; } @@ -129,7 +127,7 @@ Window { var calculatedWidth = Math.floor(width / cellsPerRow); return Math.max(componentMinWidth, calculatedWidth); } - cellHeight: cellWidth * 3/4 + marginSize * 2 + cellHeight: cellWidth * 3 / 4 + marginSize * 2 model: listModel @@ -137,8 +135,7 @@ Window { width: screenGrid.cellWidth - marginSize height: screenGrid.cellHeight - marginSize - visible: JamiStrings.selectScreen !== modelData.title && - JamiStrings.selectWindow !== modelData.title + visible: JamiStrings.selectScreen !== modelData.title && JamiStrings.selectWindow !== modelData.title ScreenSharePreview { id: screenItem @@ -152,8 +149,7 @@ Window { if (modelData.isAllScreens) return AvAdapter.getSharingResource(-1); else if (showWindows) - return AvAdapter.getSharingResource(-2, AvAdapter.windowsIds[modelData.index], - AvAdapter.windowsNames[modelData.index]); + return AvAdapter.getSharingResource(-2, AvAdapter.windowsIds[modelData.index], AvAdapter.windowsNames[modelData.index], 1); return AvAdapter.getSharingResource(modelData.index); } } @@ -192,8 +188,7 @@ Window { if (!showWindows) AvAdapter.shareEntireScreen(selectedScreenNumber); else { - AvAdapter.shareWindow(AvAdapter.windowsIds[selectedScreenNumber], - AvAdapter.windowsNames[selectedScreenNumber]); + AvAdapter.shareWindow(AvAdapter.windowsIds[selectedScreenNumber], AvAdapter.windowsNames[selectedScreenNumber]); } } root.close(); diff --git a/src/libclient/api/callmodel.h b/src/libclient/api/callmodel.h index 4e1b512f901d7bfad9fdc4fabc89209021fb1a31..0f11da97ba14a86f7f913adadebf86933f74ee92 100644 --- a/src/libclient/api/callmodel.h +++ b/src/libclient/api/callmodel.h @@ -406,7 +406,9 @@ public: * @param windowProcessId * @param windowId */ - QString getDisplay(const QString& windowProcessId, const QString& windowId); + QString getDisplay(const QString& windowProcessId, + const QString& windowId, + const int fps = -1); void emplaceConversationConference(const QString& callId); @@ -481,7 +483,9 @@ Q_SIGNALS: * @param conversationId * @param confId */ - void callAddedToConference(const QString& callId, const QString& conversationId, const QString& confId) const; + void callAddedToConference(const QString& callId, + const QString& conversationId, + const QString& confId) const; /** * Emitted when a voice mail notice arrives diff --git a/src/libclient/callmodel.cpp b/src/libclient/callmodel.cpp index d7fa0371b8eea7392c6a665ef8d1b8af5c8cb87f..2a6b466b2c79444daa373421faa060482490fa3c 100644 --- a/src/libclient/callmodel.cpp +++ b/src/libclient/callmodel.cpp @@ -989,7 +989,7 @@ CallModel::getDisplay(int idx, int x, int y, int w, int h) } QString -CallModel::getDisplay(const QString& windowProcessId, const QString& windowId) +CallModel::getDisplay(const QString& windowProcessId, const QString& windowId, const int fps) { #if defined(__APPLE__) Q_UNUSED(windowProcessId) @@ -1010,6 +1010,11 @@ CallModel::getDisplay(const QString& windowProcessId, const QString& windowId) .arg(sep) .arg(windowProcessId); #endif + // Usefull if the window is a preview to set a custom fps rate of 1 + if (fps > 0) { + ret += QString(" fps:%1").arg(fps); + } + return ret; #endif }