Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[rbp] Support the split gui/display resolution. #1529

Merged
merged 1 commit into from

8 participants

@popcornmix
Collaborator

Gui is limited to 720p. Display can be 1080p. Remove temporary hack of downsizing the textures

@popcornmix popcornmix [rbp] Support the split gui/display resolution. Gui is limited to 720…
…p. Display can be 1080p. Remove temporary hack of downsizing the textures.
23888b9
@huceke
Collaborator

@theuni, @davilla: Ok to merge ?

@davilla
Collaborator

looks fine with me, hit the green button.

@huceke huceke merged commit 57529e8 into from
@buxit

would there be a way to work around the memory limitation without scaling the whole gui? what was the drawback of the old solution?

but one that allowed the gui to be drawn at full resolution ...

Collaborator

@buxit: yes, take out your solder iron :D

The effect of 720p GUI caps on 1080p screen is quite noticeable: image is blur and texts are not as sharp as they used to be. Instead of forcing everyone to have "low resolution" (unscaled from 720p) its better to have an option so user can turn the cap on/off. Remember not everyone use fanart.

Owner

Which skin?

The default skin confluence lite I believe with blue bubbles background. Its not just me, other users have confirmed the difference.

Owner

Confluence is 720p, as are almost all skins that would run on the Pi. It's always been scaled, so I'm calling BS.
In fact, the change here is that images that were previously scaled by 50% are now scaled down to 1280x720, so you're now getting twice the resolution for the bubbles.

For the 720p->1080p stretch, the scaling has moved from GL to the hardware scalers, which should be better anyway.

Text.. I could maybe buy that.

Since this was commited, subtitles have disappeared on 720p video :(
subtitles still appear on lowres video (xvid), but they aren't visible anymore when i play a x264 720p video

(yes, i'm sure it's because of that patch. i reverted it & it works now)

Collaborator

i think the subtitle "issue" is more a question of calibrating the subtitle position, see:
http://www.raspihub.com/go/20fa93d823e8a56229c0aeb1d9e084952656b0cae2d873b103ce02a03dba0f10

but its something to look into

Collaborator

I'm pretty sure it is the initial calibrtation which is wrong. Fix is in the works ;)

i don't care about fanart or other backdrops. i have fanart enabled and it all looks good when scaled (either by GL or hardware). i do care about ui and font sharpness though. subtitles specifically look a lot worse since the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 3, 2012
  1. @popcornmix

    [rbp] Support the split gui/display resolution. Gui is limited to 720…

    popcornmix authored
    …p. Display can be 1080p. Remove temporary hack of downsizing the textures.
This page is out of date. Refresh to see the latest.
View
8 xbmc/cores/omxplayer/OMXVideo.cpp
@@ -30,6 +30,8 @@
#include "linux/XMemUtils.h"
#include "DVDDemuxers/DVDDemuxUtils.h"
#include "settings/AdvancedSettings.h"
+#include "xbmc/guilib/GraphicContext.h"
+#include "settings/Settings.h"
#include <sys/time.h>
#include <inttypes.h>
@@ -875,8 +877,12 @@ void COMXVideo::SetVideoRect(const CRect& SrcRect, const CRect& DestRect)
OMX_CONFIG_DISPLAYREGIONTYPE configDisplay;
OMX_INIT_STRUCTURE(configDisplay);
configDisplay.nPortIndex = m_omx_render.GetInputPort();
+ RESOLUTION res = g_graphicsContext.GetVideoResolution();
+ // DestRect is in GUI coordinates, rather than display coordinates, so we have to scale
+ float xscale = (float)g_settings.m_ResInfo[res].iScreenWidth / (float)g_settings.m_ResInfo[res].iWidth;
+ float yscale = (float)g_settings.m_ResInfo[res].iScreenHeight / (float)g_settings.m_ResInfo[res].iHeight;
float sx1 = SrcRect.x1, sy1 = SrcRect.y1, sx2 = SrcRect.x2, sy2 = SrcRect.y2;
- float dx1 = DestRect.x1, dy1 = DestRect.y1, dx2 = DestRect.x2, dy2 = DestRect.y2;
+ float dx1 = DestRect.x1*xscale, dy1 = DestRect.y1*yscale, dx2 = DestRect.x2*xscale, dy2 = DestRect.y2*yscale;
float sw = SrcRect.Width() / DestRect.Width();
float sh = SrcRect.Height() / DestRect.Height();
View
9 xbmc/guilib/Texture.cpp
@@ -224,8 +224,13 @@ bool CBaseTexture::LoadFromFileInternal(const CStdString& texturePath, unsigned
if(omx_image.ReadFile(texturePath))
{
- // TODO: we only decode as half width and height. this is a workaround for the PI memory limitation
- if(omx_image.Decode(omx_image.GetWidth() / 2, omx_image.GetHeight() / 2))
+ int width = omx_image.GetWidth();
+ int height = omx_image.GetHeight();
+
+ // We restict textures to the maximum GUI size. This is a workaround for the PI memory limitation
+ g_Windowing.ClampToGUIDisplayLimits(width, height);
+
+ if(omx_image.Decode(width, height))
{
Allocate(omx_image.GetDecodedWidth(), omx_image.GetDecodedHeight(), XB_FMT_A8R8G8B8);
View
30 xbmc/windowing/egl/WinEGLPlatformRaspberryPI.cpp
@@ -100,7 +100,7 @@ bool CWinEGLPlatformRaspberryPI::SetDisplayResolution(RESOLUTION_INFO& res)
for (size_t i = 0; i < m_res.size(); i++)
{
- if(m_res[i].iWidth == res.iWidth && m_res[i].iHeight == res.iHeight && m_res[i].fRefreshRate == res.fRefreshRate)
+ if(m_res[i].iScreenWidth == res.iScreenWidth && m_res[i].iScreenHeight == res.iScreenHeight && m_res[i].fRefreshRate == res.fRefreshRate)
{
int score = 0;
@@ -152,8 +152,8 @@ bool CWinEGLPlatformRaspberryPI::SetDisplayResolution(RESOLUTION_INFO& res)
dst_rect.x = 0;
dst_rect.y = 0;
- dst_rect.width = res.iWidth;
- dst_rect.height = res.iHeight;
+ dst_rect.width = res.iScreenWidth;
+ dst_rect.height = res.iScreenHeight;
src_rect.x = 0;
src_rect.y = 0;
@@ -178,8 +178,8 @@ bool CWinEGLPlatformRaspberryPI::SetDisplayResolution(RESOLUTION_INFO& res)
if(bFound && (resSearch.dwFlags & D3DPRESENTFLAG_MODE3DSBS))
{
// right side
- dst_rect.x = res.iWidth;
- dst_rect.width >>= dst_rect.width - dst_rect.x;
+ dst_rect.x = res.iScreenWidth;
+ dst_rect.width = res.iScreenWidth;
m_dispman_element2 = m_DllBcmHost.vc_dispmanx_element_add(dispman_update,
m_dispman_display,
@@ -196,7 +196,7 @@ bool CWinEGLPlatformRaspberryPI::SetDisplayResolution(RESOLUTION_INFO& res)
// left side - fall through
dst_rect.x = 0;
- dst_rect.width = res.iWidth - dst_rect.x;
+ dst_rect.width = res.iScreenWidth;
}
m_dispman_element = m_DllBcmHost.vc_dispmanx_element_add(dispman_update,
@@ -227,7 +227,23 @@ bool CWinEGLPlatformRaspberryPI::SetDisplayResolution(RESOLUTION_INFO& res)
bool CWinEGLPlatformRaspberryPI::ClampToGUIDisplayLimits(int &width, int &height)
{
- return true;
+ const int max_width = 1280, max_height = 720;
+ float ar = (float)width/(float)height;
+ // bigger than maximum, so need to clamp
+ if (width > max_width || height > max_height) {
+ // wider than max, so clamp width first
+ if (ar > (float)max_width/(float)max_height)
+ {
+ width = max_width;
+ height = (float)max_width / ar + 0.5f;
+ // taller than max, so clamp height first
+ } else {
+ height = max_height;
+ width = (float)max_height * ar + 0.5f;
+ }
+ return true;
+ }
+ return false;
}
bool CWinEGLPlatformRaspberryPI::ProbeDisplayResolutions(std::vector<RESOLUTION_INFO> &resolutions)
View
6 xbmc/windowing/egl/WinSystemGLES.cpp
@@ -317,4 +317,10 @@ bool CWinSystemGLES::Support3D(int width, int height, uint32_t mode) const
return bFound;
}
+bool CWinSystemGLES::ClampToGUIDisplayLimits(int &width, int &height)
+{
+ return m_eglplatform->ClampToGUIDisplayLimits(width, height);
+}
+
+
#endif
View
1  xbmc/windowing/egl/WinSystemGLES.h
@@ -56,6 +56,7 @@ class CWinSystemGLES : public CWinSystemBase, public CRenderSystemGLES
EGLDisplay GetEGLDisplay();
EGLContext GetEGLContext();
virtual bool Support3D(int width, int height, uint32_t mode) const;
+ virtual bool ClampToGUIDisplayLimits(int &width, int &height);
protected:
virtual bool PresentRenderImpl(const CDirtyRegionList &dirty);
Something went wrong with that request. Please try again.