Allwinner/kodi: rebase guisize patch for kodi-19

This commit is contained in:
MilhouseVH 2019-10-25 05:05:08 +01:00
parent d8666ed479
commit 8cb8be6aa5

View File

@ -1,96 +1,88 @@
From 7a88b0ad7a90a8ac2266f87ccb08dca5df0c0867 Mon Sep 17 00:00:00 2001 From a1818990f68fe77d02a63c07c29e7832e2b9da27 Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se> From: Jonas Karlman <jonas@kwiboo.se>
Date: Sun, 14 Oct 2018 14:20:03 +0200 Date: Wed, 16 Oct 2019 19:38:11 +0000
Subject: [PATCH] WIP: windowing/gbm: add option to limit gui size Subject: [PATCH] windowing/gbm: add option to limit gui size
--- ---
.../resources/strings.po | 52 ++++++++++++++++++- .../resources/strings.po | 44 ++++++++++++++++++-
system/settings/gbm.xml | 15 ++++++ system/settings/gbm.xml | 15 +++++++
xbmc/windowing/gbm/DRMUtils.cpp | 28 ++++++++++ xbmc/windowing/gbm/DRMUtils.cpp | 32 ++++++++++++++
3 files changed, 94 insertions(+), 1 deletion(-) 3 files changed, 90 insertions(+), 1 deletion(-)
diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po
index 97211d3b718a..eaa5b3fed759 100644 index c573f6e5f9c9..a520acda5ca7 100644
--- a/addons/resource.language.en_gb/resources/strings.po --- a/addons/resource.language.en_gb/resources/strings.po
+++ b/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po
@@ -7256,7 +7256,57 @@ msgctxt "#13465" @@ -7234,7 +7234,49 @@ msgctxt "#13465"
msgid "EGL" msgid "EGL"
msgstr "" msgstr ""
-#empty strings from id 13466 to 13504 -#empty strings from id 13466 to 13504
+#empty strings from id 13466 to 13485
+
+#. String for options 3 of setting with label #13482 "HDMI Quantization Range"
+#: system/settings/gbm.xml
+msgctxt "#13486"
+msgid "Limited"
+msgstr ""
+
+#. Option for setting Limit GUI Size +#. Option for setting Limit GUI Size
+#: system/settings/gbm.xml +#: system/settings/gbm.xml
+msgctxt "#13487" +msgctxt "#13466"
+msgid "Limit GUI Size" +msgid "Limit GUI Size"
+msgstr "" +msgstr ""
+ +
+#. Description of setting with label #13487 "Limit GUI Size" +#. Description of setting with label #13466 "Limit GUI Size"
+#: system/settings/gbm.xml +#: system/settings/gbm.xml
+msgctxt "#13488" +msgctxt "#13467"
+msgid "This option limits GUI size for screen resolutions above 1080p. Requires restart." +msgid "This option limits GUI size for screen resolutions above 1080p. Requires restart."
+msgstr "" +msgstr ""
+ +
+#. String for options 1 of setting with label #13487 "Limit GUI Size" +#. String for options 1 of setting with label #13466 "Limit GUI Size"
+#: system/settings/gbm.xml +#: system/settings/gbm.xml
+msgctxt "#13489" +msgctxt "#13468"
+msgid "No limit" +msgid "No limit"
+msgstr "" +msgstr ""
+ +
+#. String for options 2 of setting with label #13487 "Limit GUI Size" +#. String for options 2 of setting with label #13466 "Limit GUI Size"
+#: system/settings/gbm.xml +#: system/settings/gbm.xml
+msgctxt "#13490" +msgctxt "#13469"
+msgid "720p" +msgid "720p"
+msgstr "" +msgstr ""
+ +
+#. String for options 3 of setting with label #13487 "Limit GUI Size" +#. String for options 3 of setting with label #13466 "Limit GUI Size"
+#: system/settings/gbm.xml +#: system/settings/gbm.xml
+msgctxt "#13491" +msgctxt "#13470"
+msgid "1080p / 720p (>30hz)" +msgid "1080p / 720p (>30hz)"
+msgstr "" +msgstr ""
+ +
+#. String for options 4 of setting with label #13487 "Limit GUI Size" +#. String for options 4 of setting with label #13466 "Limit GUI Size"
+#: system/settings/gbm.xml +#: system/settings/gbm.xml
+msgctxt "#13492" +msgctxt "#13471"
+msgid "1080p" +msgid "1080p"
+msgstr "" +msgstr ""
+ +
+#. String for options 5 of setting with label #13487 "Limit GUI Size" +#. String for options 5 of setting with label #13466 "Limit GUI Size"
+#: system/settings/gbm.xml +#: system/settings/gbm.xml
+msgctxt "#13493" +msgctxt "#13472"
+msgid "No limit / 1080p (>30hz)" +msgid "No limit / 1080p (>30hz)"
+msgstr "" +msgstr ""
+ +
+#empty strings from id 13494 to 13504 +#empty strings from id 13473 to 13504
#: system/settings/settings.xml #: system/settings/settings.xml
msgctxt "#13505" msgctxt "#13505"
diff --git a/system/settings/gbm.xml b/system/settings/gbm.xml diff --git a/system/settings/gbm.xml b/system/settings/gbm.xml
index c5e4d98e0bef..830576c156a6 100644 index 939ca12ba287..9bd1d04dfb7a 100644
--- a/system/settings/gbm.xml --- a/system/settings/gbm.xml
+++ b/system/settings/gbm.xml +++ b/system/settings/gbm.xml
@@ -41,6 +41,21 @@ @@ -36,6 +36,21 @@
<setting id="videoscreen.screen"> <setting id="videoscreen.screen">
<visible>false</visible> <visible>false</visible>
</setting> </setting>
+ <setting id="videoscreen.limitguisize" type="integer" label="13487" help="13488"> + <setting id="videoscreen.limitguisize" type="integer" label="13466" help="13467">
+ <visible>false</visible> + <visible>false</visible>
+ <level>3</level> + <level>3</level>
+ <default>0</default> + <default>0</default>
+ <constraints> + <constraints>
+ <options> + <options>
+ <option label="13489">0</option> <!-- No limit --> + <option label="13468">0</option> <!-- No limit -->
+ <option label="13490">1</option> <!-- 720p --> + <option label="13469">1</option> <!-- 720p -->
+ <option label="13491">2</option> <!-- 1080p / 720p (>30hz) --> + <option label="13470">2</option> <!-- 1080p / 720p (>30hz) -->
+ <option label="13492">3</option> <!-- 1080p --> + <option label="13471">3</option> <!-- 1080p -->
+ <option label="13493">4</option> <!-- No limit / 1080p (>30hz) --> + <option label="13472">4</option> <!-- No limit / 1080p (>30hz) -->
+ </options> + </options>
+ </constraints> + </constraints>
+ <control type="list" format="string" /> + <control type="list" format="string" />
@ -99,55 +91,60 @@ index c5e4d98e0bef..830576c156a6 100644
<level>3</level> <level>3</level>
<default>false</default> <default>false</default>
diff --git a/xbmc/windowing/gbm/DRMUtils.cpp b/xbmc/windowing/gbm/DRMUtils.cpp diff --git a/xbmc/windowing/gbm/DRMUtils.cpp b/xbmc/windowing/gbm/DRMUtils.cpp
index fceaf770d363..21a6f8f1b926 100644 index bbbc447498cf..3980ef7058e9 100644
--- a/xbmc/windowing/gbm/DRMUtils.cpp --- a/xbmc/windowing/gbm/DRMUtils.cpp
+++ b/xbmc/windowing/gbm/DRMUtils.cpp +++ b/xbmc/windowing/gbm/DRMUtils.cpp
@@ -17,6 +17,8 @@ @@ -8,6 +8,8 @@
#include <unistd.h>
#include "DRMUtils.h"
#include "platform/linux/XTimeUtils.h"
+#include "settings/Settings.h" +#include "settings/Settings.h"
+#include "settings/SettingsComponent.h" +#include "settings/SettingsComponent.h"
#include "utils/log.h"
#include "utils/StringUtils.h" #include "utils/StringUtils.h"
#include "utils/log.h"
#include "windowing/GraphicContext.h" #include "windowing/GraphicContext.h"
@@ -25,6 +27,8 @@ @@ -27,6 +29,11 @@
using namespace KODI::WINDOWING::GBM; using namespace KODI::WINDOWING::GBM;
+namespace
+{
+const std::string SETTING_VIDEOSCREEN_LIMITGUISIZE = "videoscreen.limitguisize"; +const std::string SETTING_VIDEOSCREEN_LIMITGUISIZE = "videoscreen.limitguisize";
+}
+ +
CDRMUtils::CDRMUtils() CDRMUtils::CDRMUtils()
: m_connector(new connector) : m_connector(new connector)
, m_encoder(new encoder) , m_encoder(new encoder)
@@ -731,6 +735,30 @@ RESOLUTION_INFO CDRMUtils::GetResolutionInfo(drmModeModeInfoPtr mode) @@ -763,6 +770,31 @@ RESOLUTION_INFO CDRMUtils::GetResolutionInfo(drmModeModeInfoPtr mode)
res.iWidth = res.iScreenWidth; res.iWidth = res.iScreenWidth;
res.iHeight = res.iScreenHeight; res.iHeight = res.iScreenHeight;
+ int limit = CServiceBroker::GetSettingsComponent()->GetSettings()->GetInt(SETTING_VIDEOSCREEN_LIMITGUISIZE); + int limit = CServiceBroker::GetSettingsComponent()->GetSettings()->GetInt(
+ SETTING_VIDEOSCREEN_LIMITGUISIZE);
+ if (limit > 0 && res.iScreenWidth > 1920 && res.iScreenHeight > 1080) + if (limit > 0 && res.iScreenWidth > 1920 && res.iScreenHeight > 1080)
+ { + {
+ switch (limit) + switch (limit)
+ { + {
+ case 1: + case 1: // 720p
+ res.iWidth = 1280; + res.iWidth = 1280;
+ res.iHeight = 720; + res.iHeight = 720;
+ break; + break;
+ case 2: + case 2: // 1080p / 720p (>30hz)
+ res.iWidth = mode->vrefresh > 30 ? 1280 : 1920; + res.iWidth = mode->vrefresh > 30 ? 1280 : 1920;
+ res.iHeight = mode->vrefresh > 30 ? 720 : 1080; + res.iHeight = mode->vrefresh > 30 ? 720 : 1080;
+ break; + break;
+ case 3: + case 3: // 1080p
+ res.iWidth = 1920; + res.iWidth = 1920;
+ res.iHeight = 1080; + res.iHeight = 1080;
+ break; + break;
+ case 4: + case 4: // No limit / 1080p (>30hz)
+ res.iWidth = mode->vrefresh > 30 ? 1920 : res.iScreenWidth; + res.iWidth = mode->vrefresh > 30 ? 1920 : res.iScreenWidth;
+ res.iHeight = mode->vrefresh > 30 ? 1080 : res.iScreenHeight; + res.iHeight = mode->vrefresh > 30 ? 1080 : res.iScreenHeight;
+ break; + break;
+ } + }
+ } + }
+ +
if (mode->clock % 5 != 0) if (mode->clock % 5 != 0)
res.fRefreshRate = static_cast<float>(mode->vrefresh) * (1000.0f/1001.0f); res.fRefreshRate = static_cast<float>(mode->vrefresh) * (1000.0f/1001.0f);
else else