From ae75e2b3f4e2bee58b40303cb7f4be5e62e375f2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 14 Mar 2015 12:38:08 +0000 Subject: [PATCH] [rbp] Switch to using transform flags for 3d modes --- .../HwDecRender/MMALRenderer.cpp | 100 +++++++----------- xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 83 ++++----------- xbmc/cores/omxplayer/OMXVideo.cpp | 36 +++---- xbmc/cores/omxplayer/OMXVideo.h | 2 +- .../egl/EGLNativeTypeRaspberryPI.cpp | 11 +- 5 files changed, 79 insertions(+), 153 deletions(-) diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp index 5fb82226f6fde..cbcb84d250697 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp @@ -442,11 +442,7 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) return; } - if (g_graphicsContext.GetStereoMode()) - g_graphicsContext.SetStereoView(RENDER_STEREO_VIEW_LEFT); ManageDisplay(); - if (g_graphicsContext.GetStereoMode()) - g_graphicsContext.SetStereoView(RENDER_STEREO_VIEW_OFF); if (m_format == RENDER_FMT_BYPASS) { @@ -669,10 +665,8 @@ EINTERLACEMETHOD CMMALRenderer::AutoInterlaceMethod() void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect) { - // we get called twice a frame for left/right. Can ignore the rights. - if (g_graphicsContext.GetStereoView() == RENDER_STEREO_VIEW_RIGHT) - return; CSingleLock lock(m_sharedSection); + assert(g_graphicsContext.GetStereoView() != RENDER_STEREO_VIEW_RIGHT); if (!m_vout_input) return; @@ -683,6 +677,10 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect bool stereo_invert = (m_iFlags & CONF_FLAGS_STEREO_CADANCE_RIGHT_LEFT) ? true : false; RENDER_STEREO_MODE display_stereo_mode = g_graphicsContext.GetStereoMode(); + // ignore video stereo mode when 3D display mode is disabled + if (display_stereo_mode == RENDER_STEREO_MODE_OFF) + video_stereo_mode = RENDER_STEREO_MODE_OFF; + // fix up transposed video if (m_renderOrientation == 90 || m_renderOrientation == 270) { @@ -714,40 +712,17 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect CRect gui(0, 0, CDisplaySettings::GetInstance().GetResolutionInfo(res).iWidth, CDisplaySettings::GetInstance().GetResolutionInfo(res).iHeight); CRect display(0, 0, CDisplaySettings::GetInstance().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::GetInstance().GetResolutionInfo(res).iScreenHeight); - if (display_stereo_mode != RENDER_STEREO_MODE_OFF && display_stereo_mode != RENDER_STEREO_MODE_MONO) - switch (video_stereo_mode) + if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) { - case RENDER_STEREO_MODE_SPLIT_VERTICAL: - // optimisation - use simpler display mode in common case of unscaled 3d with same display mode - if (video_stereo_mode == display_stereo_mode && DestRect.x1 == 0.0f && DestRect.x2 * 2.0f == gui.Width() && !stereo_invert) - { - SrcRect.x2 *= 2.0f; - DestRect.x2 *= 2.0f; - video_stereo_mode = RENDER_STEREO_MODE_OFF; - display_stereo_mode = RENDER_STEREO_MODE_OFF; - } - else if (display_stereo_mode == RENDER_STEREO_MODE_ANAGLYPH_RED_CYAN || display_stereo_mode == RENDER_STEREO_MODE_ANAGLYPH_GREEN_MAGENTA || display_stereo_mode == RENDER_STEREO_MODE_ANAGLYPH_YELLOW_BLUE) - { - SrcRect.x2 *= 2.0f; - } - break; - - case RENDER_STEREO_MODE_SPLIT_HORIZONTAL: - // optimisation - use simpler display mode in common case of unscaled 3d with same display mode - if (video_stereo_mode == display_stereo_mode && DestRect.y1 == 0.0f && DestRect.y2 * 2.0f == gui.Height() && !stereo_invert) - { - SrcRect.y2 *= 2.0f; - DestRect.y2 *= 2.0f; - video_stereo_mode = RENDER_STEREO_MODE_OFF; - display_stereo_mode = RENDER_STEREO_MODE_OFF; - } - else if (display_stereo_mode == RENDER_STEREO_MODE_ANAGLYPH_RED_CYAN || display_stereo_mode == RENDER_STEREO_MODE_ANAGLYPH_GREEN_MAGENTA || display_stereo_mode == RENDER_STEREO_MODE_ANAGLYPH_YELLOW_BLUE) - { - SrcRect.y2 *= 2.0f; - } - break; - - default: break; + float width = DestRect.x2 - DestRect.x1; + DestRect.x1 *= 2.0f; + DestRect.x2 = DestRect.x1 + 2.0f * width; + } + else if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) + { + float height = DestRect.y2 - DestRect.y1; + DestRect.y1 *= 2.0f; + DestRect.y2 = DestRect.y1 + 2.0f * height; } if (gui != display) @@ -763,7 +738,7 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect MMAL_DISPLAYREGION_T region; memset(®ion, 0, sizeof region); - region.set = MMAL_DISPLAY_SET_DEST_RECT|MMAL_DISPLAY_SET_SRC_RECT|MMAL_DISPLAY_SET_FULLSCREEN|MMAL_DISPLAY_SET_NOASPECT|MMAL_DISPLAY_SET_MODE; + region.set = MMAL_DISPLAY_SET_DEST_RECT|MMAL_DISPLAY_SET_SRC_RECT|MMAL_DISPLAY_SET_FULLSCREEN|MMAL_DISPLAY_SET_NOASPECT|MMAL_DISPLAY_SET_MODE|MMAL_DISPLAY_SET_TRANSFORM; region.dest_rect.x = lrintf(DestRect.x1); region.dest_rect.y = lrintf(DestRect.y1); region.dest_rect.width = lrintf(DestRect.Width()); @@ -776,35 +751,32 @@ void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect region.fullscreen = MMAL_FALSE; region.noaspect = MMAL_TRUE; + region.mode = MMAL_DISPLAY_MODE_LETTERBOX; + + if (m_renderOrientation == 90) + region.transform = MMAL_DISPLAY_ROT90; + else if (m_renderOrientation == 180) + region.transform = MMAL_DISPLAY_ROT180; + else if (m_renderOrientation == 270) + region.transform = MMAL_DISPLAY_ROT270; + else + region.transform = MMAL_DISPLAY_ROT0; - if (m_renderOrientation) - { - region.set |= MMAL_DISPLAY_SET_TRANSFORM; - if (m_renderOrientation == 90) - region.transform = MMAL_DISPLAY_ROT90; - else if (m_renderOrientation == 180) - region.transform = MMAL_DISPLAY_ROT180; - else if (m_renderOrientation == 270) - region.transform = MMAL_DISPLAY_ROT270; - else assert(0); - } - - if (video_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL && display_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) - region.mode = MMAL_DISPLAY_MODE_STEREO_TOP_TO_TOP; - else if (video_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL && display_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) - region.mode = MMAL_DISPLAY_MODE_STEREO_TOP_TO_LEFT; - else if (video_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL && display_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) - region.mode = MMAL_DISPLAY_MODE_STEREO_LEFT_TO_TOP; - else if (video_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL && display_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) - region.mode = MMAL_DISPLAY_MODE_STEREO_LEFT_TO_LEFT; + if (m_video_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) + region.transform = (MMAL_DISPLAYTRANSFORM_T)(region.transform | DISPMANX_STEREOSCOPIC_TB); + else if (m_video_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) + region.transform = (MMAL_DISPLAYTRANSFORM_T)(region.transform | DISPMANX_STEREOSCOPIC_SBS); else - region.mode = MMAL_DISPLAY_MODE_LETTERBOX; + region.transform = (MMAL_DISPLAYTRANSFORM_T)(region.transform | DISPMANX_STEREOSCOPIC_MONO); + + if (m_StereoInvert) + region.transform = (MMAL_DISPLAYTRANSFORM_T)(region.transform | DISPMANX_STEREOSCOPIC_INVERT); MMAL_STATUS_T status = mmal_util_set_display_region(m_vout_input, ®ion); if (status != MMAL_SUCCESS) CLog::Log(LOGERROR, "%s::%s Failed to set display region (status=%x %s)", CLASSNAME, __func__, status, mmal_status_to_string(status)); - CLog::Log(LOGDEBUG, "%s::%s %d,%d,%d,%d -> %d,%d,%d,%d mode:%d", CLASSNAME, __func__, + CLog::Log(LOGDEBUG, "%s::%s %d,%d,%d,%d -> %d,%d,%d,%d t:%x", CLASSNAME, __func__, region.src_rect.x, region.src_rect.y, region.src_rect.width, region.src_rect.height, - region.dest_rect.x, region.dest_rect.y, region.dest_rect.width, region.dest_rect.height, region.mode); + region.dest_rect.x, region.dest_rect.y, region.dest_rect.width, region.dest_rect.height, region.transform); } diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp index 6d333612aaf76..08f44162b20af 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -645,10 +645,6 @@ int OMXPlayerVideo::GetFreeSpace() void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRect) { - // we get called twice a frame for left/right. Can ignore the rights. - if (g_graphicsContext.GetStereoView() == RENDER_STEREO_VIEW_RIGHT) - return; - CRect SrcRect = InSrcRect, DestRect = InDestRect; unsigned flags = GetStereoModeFlags(GetStereoMode()); RENDER_STEREO_MODE video_stereo_mode = (flags & CONF_FLAGS_STEREO_MODE_SBS) ? RENDER_STEREO_MODE_SPLIT_VERTICAL : @@ -656,6 +652,10 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec bool stereo_invert = (flags & CONF_FLAGS_STEREO_CADANCE_RIGHT_LEFT) ? true : false; RENDER_STEREO_MODE display_stereo_mode = g_graphicsContext.GetStereoMode(); + // ignore video stereo mode when 3D display mode is disabled + if (display_stereo_mode == RENDER_STEREO_MODE_OFF) + video_stereo_mode = RENDER_STEREO_MODE_OFF; + // fix up transposed video if (m_hints.orientation == 90 || m_hints.orientation == 270) { @@ -687,41 +687,17 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec CRect gui(0, 0, CDisplaySettings::GetInstance().GetResolutionInfo(res).iWidth, CDisplaySettings::GetInstance().GetResolutionInfo(res).iHeight); CRect display(0, 0, CDisplaySettings::GetInstance().GetResolutionInfo(res).iScreenWidth, CDisplaySettings::GetInstance().GetResolutionInfo(res).iScreenHeight); - switch (video_stereo_mode) + if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) { - case RENDER_STEREO_MODE_SPLIT_VERTICAL: - // optimisation - use simpler display mode in common case of unscaled 3d with same display mode - if (video_stereo_mode == display_stereo_mode && DestRect.x1 == 0.0f && DestRect.x2 * 2.0f == gui.Width() && !stereo_invert) - { - SrcRect.x2 *= 2.0f; - DestRect.x2 *= 2.0f; - video_stereo_mode = RENDER_STEREO_MODE_OFF; - display_stereo_mode = RENDER_STEREO_MODE_OFF; - } - else if (stereo_invert) - { - SrcRect.x1 += m_hints.width / 2; - SrcRect.x2 += m_hints.width / 2; - } - break; - - case RENDER_STEREO_MODE_SPLIT_HORIZONTAL: - // optimisation - use simpler display mode in common case of unscaled 3d with same display mode - if (video_stereo_mode == display_stereo_mode && DestRect.y1 == 0.0f && DestRect.y2 * 2.0f == gui.Height() && !stereo_invert) - { - SrcRect.y2 *= 2.0f; - DestRect.y2 *= 2.0f; - video_stereo_mode = RENDER_STEREO_MODE_OFF; - display_stereo_mode = RENDER_STEREO_MODE_OFF; - } - else if (stereo_invert) - { - SrcRect.y1 += m_hints.height / 2; - SrcRect.y2 += m_hints.height / 2; - } - break; - - default: break; + float width = DestRect.x2 - DestRect.x1; + DestRect.x1 *= 2.0f; + DestRect.x2 = DestRect.x1 + 2.0f * width; + } + else if (display_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) + { + float height = DestRect.y2 - DestRect.y1; + DestRect.y1 *= 2.0f; + DestRect.y2 = DestRect.y1 + 2.0f * height; } if (gui != display) @@ -733,7 +709,7 @@ void OMXPlayerVideo::SetVideoRect(const CRect &InSrcRect, const CRect &InDestRec DestRect.y1 *= yscale; DestRect.y2 *= yscale; } - m_omxVideo.SetVideoRect(SrcRect, DestRect, video_stereo_mode, display_stereo_mode); + m_omxVideo.SetVideoRect(SrcRect, DestRect, m_video_stereo_mode, m_display_stereo_mode, m_StereoInvert); } void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, float framerate, float display_aspect) @@ -742,40 +718,17 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f uint32_t video_width = CDisplaySettings::GetInstance().GetResolutionInfo(res).iScreenWidth; uint32_t video_height = CDisplaySettings::GetInstance().GetResolutionInfo(res).iScreenHeight; - unsigned flags = 0; ERenderFormat format = RENDER_FMT_BYPASS; + /* figure out steremode expected based on user settings and hints */ + unsigned flags = GetStereoModeFlags(GetStereoMode()); + if(m_bAllowFullscreen) { flags |= CONF_FLAGS_FULLSCREEN; m_bAllowFullscreen = false; // only allow on first configure } - flags |= GetStereoModeFlags(GetStereoMode()); - - if(flags & CONF_FLAGS_STEREO_MODE_SBS) - { - if(g_Windowing.Support3D(video_width, video_height, D3DPRESENTFLAG_MODE3DSBS)) - CLog::Log(LOGNOTICE, "3DSBS movie found"); - else - { - flags &= ~CONF_FLAGS_STEREO_MODE_MASK(~0); - CLog::Log(LOGNOTICE, "3DSBS movie found but not supported"); - } - } - else if(flags & CONF_FLAGS_STEREO_MODE_TAB) - { - if(g_Windowing.Support3D(video_width, video_height, D3DPRESENTFLAG_MODE3DTB)) - CLog::Log(LOGNOTICE, "3DTB movie found"); - else - { - flags &= ~CONF_FLAGS_STEREO_MODE_MASK(~0); - CLog::Log(LOGNOTICE, "3DTB movie found but not supported"); - } - } - else - CLog::Log(LOGNOTICE, "not a 3D movie"); - unsigned int iDisplayWidth = width; unsigned int iDisplayHeight = height; diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp index 822b427f2a7f2..eba51eee896fe 100644 --- a/xbmc/cores/omxplayer/OMXVideo.cpp +++ b/xbmc/cores/omxplayer/OMXVideo.cpp @@ -218,15 +218,6 @@ bool COMXVideo::PortSettingsChanged(ResolutionUpdateInfo &resinfo) OMX_INIT_STRUCTURE(configDisplay); configDisplay.nPortIndex = m_omx_render.GetInputPort(); - configDisplay.set = OMX_DISPLAY_SET_TRANSFORM; - configDisplay.transform = m_transform; - omx_err = m_omx_render.SetConfig(OMX_IndexConfigDisplayRegion, &configDisplay); - if(omx_err != OMX_ErrorNone) - { - CLog::Log(LOGWARNING, "%s::%s - could not set transform : %d", CLASSNAME, __func__, m_transform); - return false; - } - if(m_hdmi_clock_sync) { OMX_CONFIG_LATENCYTARGETTYPE latencyTarget; @@ -849,7 +840,7 @@ void COMXVideo::Reset(void) } /////////////////////////////////////////////////////////////////////////////////////////// -void COMXVideo::SetVideoRect(const CRect& SrcRect, const CRect& DestRect, RENDER_STEREO_MODE video_mode, RENDER_STEREO_MODE display_mode) +void COMXVideo::SetVideoRect(const CRect& SrcRect, const CRect& DestRect, RENDER_STEREO_MODE video_mode, RENDER_STEREO_MODE display_mode, bool stereo_invert) { CSingleLock lock (m_critSection); if(!m_is_open) @@ -859,7 +850,7 @@ void COMXVideo::SetVideoRect(const CRect& SrcRect, const CRect& DestRect, RENDER OMX_INIT_STRUCTURE(configDisplay); configDisplay.nPortIndex = m_omx_render.GetInputPort(); - configDisplay.set = (OMX_DISPLAYSETTYPE)(OMX_DISPLAY_SET_DEST_RECT|OMX_DISPLAY_SET_SRC_RECT|OMX_DISPLAY_SET_FULLSCREEN|OMX_DISPLAY_SET_NOASPECT|OMX_DISPLAY_SET_MODE); + configDisplay.set = (OMX_DISPLAYSETTYPE)(OMX_DISPLAY_SET_DEST_RECT|OMX_DISPLAY_SET_SRC_RECT|OMX_DISPLAY_SET_FULLSCREEN|OMX_DISPLAY_SET_NOASPECT|OMX_DISPLAY_SET_MODE|OMX_DISPLAY_SET_TRANSFORM); configDisplay.dest_rect.x_offset = lrintf(DestRect.x1); configDisplay.dest_rect.y_offset = lrintf(DestRect.y1); configDisplay.dest_rect.width = lrintf(DestRect.Width()); @@ -872,23 +863,24 @@ void COMXVideo::SetVideoRect(const CRect& SrcRect, const CRect& DestRect, RENDER configDisplay.fullscreen = OMX_FALSE; configDisplay.noaspect = OMX_TRUE; + configDisplay.mode = OMX_DISPLAY_MODE_LETTERBOX; + configDisplay.transform = m_transform; - if (video_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL && display_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) - configDisplay.mode = OMX_DISPLAY_MODE_STEREO_TOP_TO_TOP; - else if (video_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL && display_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) - configDisplay.mode = OMX_DISPLAY_MODE_STEREO_TOP_TO_LEFT; - else if (video_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL && display_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) - configDisplay.mode = OMX_DISPLAY_MODE_STEREO_LEFT_TO_TOP; - else if (video_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL && display_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) - configDisplay.mode = OMX_DISPLAY_MODE_STEREO_LEFT_TO_LEFT; + if (video_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) + configDisplay.transform = (OMX_DISPLAYTRANSFORMTYPE)(configDisplay.transform | DISPMANX_STEREOSCOPIC_TB); + else if (video_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) + configDisplay.transform = (OMX_DISPLAYTRANSFORMTYPE)(configDisplay.transform | DISPMANX_STEREOSCOPIC_SBS); else - configDisplay.mode = OMX_DISPLAY_MODE_LETTERBOX; + configDisplay.transform = (OMX_DISPLAYTRANSFORMTYPE)(configDisplay.transform | DISPMANX_STEREOSCOPIC_MONO); + + if (stereo_invert) + configDisplay.transform = (OMX_DISPLAYTRANSFORMTYPE)(configDisplay.transform | DISPMANX_STEREOSCOPIC_INVERT); m_omx_render.SetConfig(OMX_IndexConfigDisplayRegion, &configDisplay); - CLog::Log(LOGDEBUG, "%s::%s %d,%d,%d,%d -> %d,%d,%d,%d mode:%d", CLASSNAME, __func__, + CLog::Log(LOGDEBUG, "%s::%s %d,%d,%d,%d -> %d,%d,%d,%d t:%x", CLASSNAME, __func__, configDisplay.src_rect.x_offset, configDisplay.src_rect.y_offset, configDisplay.src_rect.width, configDisplay.src_rect.height, - configDisplay.dest_rect.x_offset, configDisplay.dest_rect.y_offset, configDisplay.dest_rect.width, configDisplay.dest_rect.height, configDisplay.mode); + configDisplay.dest_rect.x_offset, configDisplay.dest_rect.y_offset, configDisplay.dest_rect.width, configDisplay.dest_rect.height, configDisplay.transform); } int COMXVideo::GetInputBufferSize() diff --git a/xbmc/cores/omxplayer/OMXVideo.h b/xbmc/cores/omxplayer/OMXVideo.h index e4751553cbbbc..46e79cbbceb86 100644 --- a/xbmc/cores/omxplayer/OMXVideo.h +++ b/xbmc/cores/omxplayer/OMXVideo.h @@ -68,7 +68,7 @@ class COMXVideo void Reset(void); void SetDropState(bool bDrop); std::string GetDecoderName() { return m_video_codec_name; }; - void SetVideoRect(const CRect& SrcRect, const CRect& DestRect, RENDER_STEREO_MODE video_mode, RENDER_STEREO_MODE display_mode); + void SetVideoRect(const CRect& SrcRect, const CRect& DestRect, RENDER_STEREO_MODE video_mode, RENDER_STEREO_MODE display_mode, bool stereo_invert); int GetInputBufferSize(); bool GetPlayerInfo(double &match, double &phase, double &pll); void SubmitEOS(); diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp index 5d5b74b8be230..443d037906cd2 100644 --- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp @@ -234,7 +234,9 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) /* inform TV of any 3D settings. Note this property just applies to next hdmi mode change, so no need to call for 2D modes */ HDMI_PROPERTY_PARAM_T property; property.property = HDMI_PROPERTY_3D_STRUCTURE; - if (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) + if (CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOSCREEN_FRAMEPACKING) && CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_SUPPORTMVC) && res.fRefreshRate <= 30.0f) + property.param1 = HDMI_3D_FORMAT_FRAME_PACKING; + else if (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) property.param1 = HDMI_3D_FORMAT_SBS_HALF; else if (res.dwFlags & D3DPRESENTFLAG_MODE3DTB) property.param1 = HDMI_3D_FORMAT_TB_HALF; @@ -334,6 +336,13 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) DISPMANX_TRANSFORM_T transform = DISPMANX_NO_ROTATE; DISPMANX_UPDATE_HANDLE_T dispman_update = m_DllBcmHost->vc_dispmanx_update_start(0); + if (res.dwFlags & D3DPRESENTFLAG_MODE3DSBS) + transform = DISPMANX_STEREOSCOPIC_SBS; + else if (res.dwFlags & D3DPRESENTFLAG_MODE3DTB) + transform = DISPMANX_STEREOSCOPIC_TB; + else + transform = DISPMANX_STEREOSCOPIC_MONO; + CLog::Log(LOGDEBUG, "EGL set resolution %dx%d -> %dx%d @ %.2f fps (%d,%d) flags:%x aspect:%.2f\n", m_width, m_height, dst_rect.width, dst_rect.height, res.fRefreshRate, GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), (int)res.dwFlags, res.fPixelRatio);