Permalink
Browse files

Added private utility function to map a float display aspect, to the …

…respective SDTV_ASPECT_* enum value.
  • Loading branch information...
macrule authored and popcornmix committed Apr 11, 2013
1 parent 1d95389 commit 18ca889bd1ca21c5b9e4f5406a7a87bd2a7df90b
Showing with 22 additions and 0 deletions.
  1. +22 −0 xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp
@@ -60,7 +60,10 @@
# define DLOG(fmt, args...)
#endif
#if defined(TARGET_RASPBERRY_PI)
static void SetResolutionString(RESOLUTION_INFO &res);
static SDTV_ASPECT_T get_sdtv_aspect_from_display_aspect(float display_aspect);
#endif
CEGLNativeTypeRaspberryPI::CEGLNativeTypeRaspberryPI()
{
@@ -470,6 +473,25 @@ static void SetResolutionString(RESOLUTION_INFO &res)
res.dwFlags & D3DPRESENTFLAG_MODE3DTB ? " 3DTB" : "",
res.dwFlags & D3DPRESENTFLAG_MODE3DSBS ? " 3DSBS" : "");
}
static SDTV_ASPECT_T get_sdtv_aspect_from_display_aspect(float display_aspect)
{
SDTV_ASPECT_T aspect;
const float delta = 1e-3;
if(fabs(get_display_aspect_ratio(SDTV_ASPECT_16_9) - display_aspect) < delta)
{
aspect = SDTV_ASPECT_16_9;
}
else if(fabs(get_display_aspect_ratio(SDTV_ASPECT_14_9) - display_aspect) < delta)
{
aspect = SDTV_ASPECT_14_9;
}
else
{
aspect = SDTV_ASPECT_4_3;
}
return aspect;
}
#endif
bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector<RESOLUTION_INFO> &resolutions)

0 comments on commit 18ca889

Please sign in to comment.