Permalink
Browse files

Changed SDTV resolutions to be treated similarly to HDMI resolutions …

…in SetNativeResolution. This means that the SDTV interface is powered up and set to the right mode.
  • Loading branch information...
macrule authored and popcornmix committed Apr 11, 2013
1 parent 18ca889 commit 5090943cbda0185ce5a301e1393e11c3093b054e
Showing with 29 additions and 8 deletions.
  1. +29 −7 xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp
  2. +0 −1 xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h
@@ -274,7 +274,7 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res)
DestroyDispmaxWindow();
if(!m_fixedMode && GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags))
if(GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags))
{
sem_init(&m_tv_synced, 0, 0);
m_DllBcmHost->vc_tv_register_callback(CallbackTvServiceCallback, this);
@@ -330,6 +330,33 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res)
m_desktopRes = res;
}
else if(!GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags))
{
sem_init(&m_tv_synced, 0, 0);
m_DllBcmHost->vc_tv_register_callback(CallbackTvServiceCallback, this);
SDTV_OPTIONS_T options;
options.aspect = get_sdtv_aspect_from_display_aspect((float)res.iScreenWidth / (float)res.iScreenHeight);
int success = m_DllBcmHost->vc_tv_sdtv_power_on((SDTV_MODE_T)GETFLAGS_MODE(res.dwFlags), &options);
if (success == 0)
{
CLog::Log(LOGDEBUG, "EGL set SDTV mode (%d,%d)=%d\n",
GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), success);
sem_wait(&m_tv_synced);
}
else
{
CLog::Log(LOGERROR, "EGL failed to set SDTV mode (%d,%d)=%d\n",
GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), success);
}
m_DllBcmHost->vc_tv_unregister_callback(CallbackTvServiceCallback);
sem_destroy(&m_tv_synced);
m_desktopRes = res;
}
m_dispman_display = g_RBP.OpenDisplay(0);
@@ -502,8 +529,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector<RESOLUTION_INFO> &r
if(!m_DllBcmHost)
return false;
m_fixedMode = false;
/* read initial desktop resolution before probe resolutions.
* probing will replace the desktop resolution when it finds the same one.
* we raplace it because probing will generate more detailed
@@ -552,7 +577,7 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector<RESOLUTION_INFO> &r
m_desktopRes.iHeight = tv_state.display.sdtv.height;
m_desktopRes.iScreenWidth = tv_state.display.sdtv.width;
m_desktopRes.iScreenHeight= tv_state.display.sdtv.height;
m_desktopRes.dwFlags = D3DPRESENTFLAG_INTERLACED;
m_desktopRes.dwFlags = MAKEFLAGS(HDMI_RES_GROUP_INVALID, tv_state.display.sdtv.mode, 1);
m_desktopRes.fRefreshRate = (float)tv_state.display.sdtv.frame_rate;
m_desktopRes.fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((SDTV_ASPECT_T)tv_state.display.sdtv.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight);
}
@@ -575,9 +600,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector<RESOLUTION_INFO> &r
CLog::Log(LOGDEBUG, "EGL probe resolution %s:%x\n", m_desktopRes.strMode.c_str(), m_desktopRes.dwFlags);
}
if(resolutions.size() < 2)
m_fixedMode = true;
DLOG("CEGLNativeTypeRaspberryPI::ProbeResolutions\n");
return true;
#else
@@ -59,7 +59,6 @@ class CEGLNativeTypeRaspberryPI : public CEGLNativeType
DISPMANX_ELEMENT_HANDLE_T m_dispman_element;
TV_GET_STATE_RESP_T m_tv_state;
sem_t m_tv_synced;
bool m_fixedMode;
RESOLUTION_INFO m_desktopRes;
int m_width;
int m_height;

0 comments on commit 5090943

Please sign in to comment.