Permalink
Browse files

added configurable display limit clamping settings through advancedse…

…ttings.xml
  • Loading branch information...
1 parent ae04d99 commit 08c9c6782a8bbda2b2554e1a52118323cf284904 @warhog warhog committed Nov 25, 2012
@@ -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)
@@ -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. */
@@ -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) {

0 comments on commit 08c9c67

Please sign in to comment.