Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Added configurable clamp gui to display limits feature #1843

Closed
wants to merge 1 commit into from

2 participants

@warhog

Added the feature to set gui clamp limits on raspberry pi platform through advancedsettings.xml configuration file.
Default behaviour without advancedsettings is still 1280x720.
The configuration entries are "clampguilimitwidth" and "clampguilimitheight".
Allowed resolutions are between 320x240(vhs) and 3840x2160 (uhd, 4k) right now.
I will update the wiki entry too if request gets applied.

@theuni
Owner

Please explain why? The rpi (and all egl implementations) explicitly query the possible usable resolutions. All of that clamping is a relic from how things were done before, and we really need to be removing it rather than adding to it.

@warhog

hm? on rpi the menu rendering resolution is fixed to a maximum of 1280x720 (ignoring higher resolutions
the display offers).
afaik this was done due to performance reasons.
but now the pi scales the menu which is rendered in 720p to 1080p(native tv resolutions) which makes it very blurry.
the only thing the patch adds is the ability to set the resolution limit through configuration to not
patch every xbmc release.

@warhog warhog closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 25, 2012
  1. @warhog
This page is out of date. Refresh to see the latest.
View
28 xbmc/settings/AdvancedSettings.cpp
@@ -287,6 +287,12 @@ void CAdvancedSettings::Initialize()
#endif
m_bgInfoLoaderMaxThreads = 5;
+
+#if defined(TARGET_RASPBERRY_PI)
+ m_clampGUILimitWidth = 1280;
+ m_clampGUILimitHeight = 720;
+#endif
+
m_iPVRTimeCorrection = 0;
m_iPVRInfoToggleInterval = 3000;
@@ -970,6 +976,28 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file)
XMLUtils::GetInt(pRootElement, "bginfoloadermaxthreads", m_bgInfoLoaderMaxThreads);
m_bgInfoLoaderMaxThreads = std::max(1, m_bgInfoLoaderMaxThreads);
+
+#if defined(TARGET_RASPBERRY_PI)
+ if (!XMLUtils::GetInt(pRootElement, "clampguilimitwidth", m_clampGUILimitWidth))
+ m_clampGUILimitWidth = 1280;
+
+ if (m_clampGUILimitWidth < 320)
+ // clamp to vhs resolution
+ m_clampGUILimitWidth = 320;
+ else if (m_clampGUILimitWidth > 3840)
+ // clamp to 4k (uhd) resolution
+ m_clampGUILimitWidth = 3840;
+
+ if (!XMLUtils::GetInt(pRootElement, "clampguilimitheight", m_clampGUILimitHeight))
+ m_clampGUILimitHeight = 720;
+
+ if (m_clampGUILimitHeight < 240)
+ // clamp to vhs resolution
+ m_clampGUILimitHeight = 240;
+ else if (m_clampGUILimitHeight > 2160)
+ // clamp to 4k (uhd) resolution
+ m_clampGUILimitHeight = 2160;
+#endif
TiXmlElement *pPVR = pRootElement->FirstChildElement("pvr");
if (pPVR)
View
6 xbmc/settings/AdvancedSettings.h
@@ -326,6 +326,12 @@ class CAdvancedSettings
CStdString m_cpuTempCmd;
CStdString m_gpuTempCmd;
int m_bgInfoLoaderMaxThreads;
+
+#if defined(TARGET_RASPBERRY_PI)
+ /* display resolution clamping for windowing */
+ int m_clampGUILimitWidth;
+ int m_clampGUILimitHeight;
+#endif
/* PVR/TV related advanced settings */
int m_iPVRTimeCorrection; /*!< @brief correct all times (epg tags, timer tags, recording tags) by this amount of minutes. defaults to 0. */
View
4 xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp
@@ -24,6 +24,7 @@
#include "utils/log.h"
#include "guilib/gui3d.h"
#include "linux/DllBCM.h"
+#include "settings/AdvancedSettings.h"
#ifndef __VIDEOCORE4__
#define __VIDEOCORE4__
@@ -554,7 +555,8 @@ void CEGLNativeTypeRaspberryPI::CallbackTvServiceCallback(void *userdata, uint32
bool CEGLNativeTypeRaspberryPI::ClampToGUIDisplayLimits(int &width, int &height)
{
- const int max_width = 1280, max_height = 720;
+ int max_width = g_advancedSettings.m_clampGUILimitWidth;
+ int max_height = g_advancedSettings.m_clampGUILimitHeight;
float ar = (float)width/(float)height;
// bigger than maximum, so need to clamp
if (width > max_width || height > max_height) {
Something went wrong with that request. Please try again.