diff options
author | popcornmix <popcornmix@gmail.com> | 2014-07-09 23:31:32 +0100 |
---|---|---|
committer | popcornmix <popcornmix@gmail.com> | 2014-08-05 00:11:08 +0100 |
commit | 2dc77c01d5cc11801a9679f293138d8fea878803 (patch) | |
tree | 70093ac11c1c5ffea55a726aa6aca3aeb92ffd18 | |
parent | 6f26fca0a4c12b94b39fd911afe2a37468946472 (diff) |
[rbp] Make gui limit default to 720 when memory is limited
On a 256M Pi, it's safest to default to 720p gui as memory is quite limited.
-rwxr-xr-x | language/English/strings.po | 27 | ||||
-rw-r--r-- | system/settings/rbp.xml | 13 | ||||
-rw-r--r-- | xbmc/linux/RBP.cpp | 5 | ||||
-rw-r--r-- | xbmc/linux/RBP.h | 2 | ||||
-rw-r--r-- | xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 3 |
5 files changed, 44 insertions, 6 deletions
diff --git a/language/English/strings.po b/language/English/strings.po index 04d3b15f3f..0724ce048c 100755 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -15559,7 +15559,7 @@ msgstr "" #: system/settings/rbp.xml msgctxt "#36548" -msgid "Limits resolution of GUI to save memory. Does not affect video playback. Use 1080 for unlimited. Requires restart." +msgid "Limits resolution of GUI to save memory. Does not affect video playback. Requires restart." msgstr "" #empty strings from id 36549 to 36599 @@ -15790,3 +15790,28 @@ msgstr "" msgctxt "#37025" msgid "Configure audio encoder settings such as quality and compression level" msgstr "" + +#: system/settings/rbp.xml +msgctxt "#37026" +msgid "Auto" +msgstr "" + +#: system/settings/rbp.xml +msgctxt "#37027" +msgid "540" +msgstr "" + +#: system/settings/rbp.xml +msgctxt "#37028" +msgid "720" +msgstr "" + +#: system/settings/rbp.xml +msgctxt "#37029" +msgid "900" +msgstr "" + +#: system/settings/rbp.xml +msgctxt "#37030" +msgid "Unlimited" +msgstr "" diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml index 2b7d0a636b..28e68eba63 100644 --- a/system/settings/rbp.xml +++ b/system/settings/rbp.xml @@ -39,12 +39,17 @@ </setting> <setting id="videoscreen.limitgui" type="integer" label="37021" help="36548"> <level>2</level> - <default>1080</default> + <default>0</default> <constraints> - <minimum>540</minimum> - <step>16</step> - <maximum>1080</maximum> + <options> + <option label="37026">0</option> <!-- auto --> + <option label="37027">540</option> <!-- 540 --> + <option label="37028">720</option> <!-- 720 --> + <option label="37029">900</option> <!-- 900 --> + <option label="37030">1080</option> <!-- unlimited --> + </options> </constraints> + <control type="spinner" format="string" /> <control type="edit" format="integer" /> </setting> </group> diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp index 50d5186da4..73a42c4481 100644 --- a/xbmc/linux/RBP.cpp +++ b/xbmc/linux/RBP.cpp @@ -21,6 +21,7 @@ #include "RBP.h" #if defined(TARGET_RASPBERRY_PI) +#include "settings/Settings.h" #include "utils/log.h" #include "cores/omxplayer/OMXImage.h" @@ -75,6 +76,10 @@ bool CRBP::Initialize() if (m_gpu_mem < 128) setenv("V3D_DOUBLE_BUFFER", "1", 1); + m_gui_resolution_limit = CSettings::Get().GetInt("videoscreen.limitgui"); + if (!m_gui_resolution_limit) + m_gui_resolution_limit = m_gpu_mem < 128 ? 720:1080; + g_OMXImage.Initialize(); m_omx_image_init = true; return true; diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h index 2aae579875..e9a2d5ab00 100644 --- a/xbmc/linux/RBP.h +++ b/xbmc/linux/RBP.h @@ -53,6 +53,7 @@ public: bool GetCodecMpg2() { return m_codec_mpg2_enabled; } bool GetCodecWvc1() { return m_codec_wvc1_enabled; } void GetDisplaySize(int &width, int &height); + int GetGUIResolutionLimit() { return m_gui_resolution_limit; } // stride can be null for packed output unsigned char *CaptureDisplay(int width, int height, int *stride, bool swap_red_blue, bool video_only = true); DllOMX *GetDllOMX() { return m_OMX ? m_OMX->GetDll() : NULL; } @@ -64,6 +65,7 @@ private: bool m_omx_image_init; int m_arm_mem; int m_gpu_mem; + int m_gui_resolution_limit; bool m_codec_mpg2_enabled; bool m_codec_wvc1_enabled; COMXCore *m_OMX; diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp index a9c51ca039..c58c28a3f4 100644 --- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp @@ -25,6 +25,7 @@ #include "utils/log.h" #include "guilib/gui3d.h" #include "linux/DllBCM.h" +#include "linux/RBP.h" #include "utils/StringUtils.h" #include "settings/Settings.h" @@ -370,7 +371,7 @@ static float get_display_aspect_ratio(SDTV_ASPECT_T aspect) static bool ClampToGUIDisplayLimits(int &width, int &height) { - float max_height = (float)CSettings::Get().GetInt("videoscreen.limitgui"); + float max_height = (float)g_RBP.GetGUIResolutionLimit(); float default_ar = 16.0f/9.0f; if (max_height < 540.0f || max_height > 1080.0f) max_height = 1080.0f; |