diff options
-rw-r--r-- | xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp | 192 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.h | 6 | ||||
-rw-r--r-- | xbmc/rendering/gles/RenderSystemGLES.cpp | 10 | ||||
-rw-r--r-- | xbmc/utils/AMLUtils.cpp | 20 | ||||
-rw-r--r-- | xbmc/utils/AMLUtils.h | 1 | ||||
-rw-r--r-- | xbmc/utils/SystemInfo.cpp | 11 | ||||
-rw-r--r-- | xbmc/utils/SystemInfo.h | 1 |
7 files changed, 23 insertions, 218 deletions
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp index bc50cdd426..e681ba4c06 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp @@ -54,8 +54,7 @@ // amcodec include extern "C" { -#include <codec.h> -#include <amports/amstream.h> +#include <amcodec/codec.h> } // extern "C" CEvent g_aml_sync_event; @@ -345,44 +344,6 @@ typedef struct vframe_states int buf_avail_num; } vframe_states_t; -static int aml_ioctl_get(CODEC_HANDLE h, int subcmd, unsigned long paramter) -{ - struct am_ioctl_parm parm; - memset(&parm, 0, sizeof(parm)); - parm.cmd = subcmd; - parm.data_32 = *(unsigned int *)paramter; - if (ioctl(h, AMSTREAM_IOC_GET, (unsigned long)&parm) < 0) - { - CLog::Log(LOGERROR, "aml_ioctl_get failed: subcmd=%x, errno=%d", subcmd, errno); - return -1; - } - *(unsigned int *)paramter = parm.data_32; - return 0; -} - - -#ifndef AMSTREAM_IOC_MAGIC -#define AMSTREAM_IOC_MAGIC 'S' -#endif - -#ifndef AMSTREAM_IOC_VF_STATUS -#define AMSTREAM_IOC_VF_STATUS _IOR(AMSTREAM_IOC_MAGIC, 0x60, unsigned long) -#endif - -#ifndef AMSTREAM_IOC_GET_3D_TYPE -#define AMSTREAM_IOC_GET_3D_TYPE _IOW((AMSTREAM_IOC_MAGIC), 0x3d, unsigned int) -#endif - - -enum -{ - VPP_3D_MODE_NULL = 0, - VPP_3D_MODE_LR, - VPP_3D_MODE_TB, - VPP_3D_MODE_LA, - VPP_3D_MODE_FA -}; - /*************************************************************************/ /*************************************************************************/ void dumpfile_open(am_private_t *para) @@ -2267,65 +2228,6 @@ void CAMLCodec::SetVideoSaturation(const int saturation) SysfsUtils::SetInt("/sys/class/video/saturation", saturation); } -bool CAMLCodec::SetVideo3dMode(const int mode3d) -{ - bool result = true; - if (SysfsUtils::Has("/sys/class/ppmgr/ppmgr_3d_mode")) - { - CLog::Log(LOGDEBUG, "CAMLCodec::SetVideo3dMode:mode3d(0x%x)", mode3d); - SysfsUtils::SetInt("/sys/class/ppmgr/ppmgr_3d_mode", mode3d); - } - else - { - CLog::Log(LOGINFO, "CAMLCodec::SetVideo3dMode: ppmgr_3d support not found in kernel."); - result = false; - } - return result; -} - -std::string CAMLCodec::GetStereoMode() -{ - std::string stereoMode; - - //Get Decoder Stereo mode - int decoder_sm(VPP_3D_MODE_NULL); - aml_ioctl_get(am_private->vcodec.handle, AMSTREAM_IOC_GET_3D_TYPE, (unsigned long)&decoder_sm); - - switch (decoder_sm) - { - case VPP_3D_MODE_LR: - stereoMode = "left_right"; - break; - case VPP_3D_MODE_TB: - stereoMode = "top_bottom"; - break; - case VPP_3D_MODE_LA: - case VPP_3D_MODE_FA: - default: - switch(m_processInfo.GetVideoSettings().m_StereoMode) - { - case RENDER_STEREO_MODE_SPLIT_VERTICAL: - stereoMode = "left_right"; - break; - case RENDER_STEREO_MODE_SPLIT_HORIZONTAL: - stereoMode = "top_bottom"; - break; - default: - stereoMode = m_hints.stereo_mode; - break; - } - } - - if (m_processInfo.GetVideoSettings().m_StereoInvert) - { - if (stereoMode == "top_bottom") - stereoMode = "bottom_top"; - else if (stereoMode == "left_right") - stereoMode = "right_left"; - } - return stereoMode; -} - void CAMLCodec::SetVideoRect(const CRect &SrcRect, const CRect &DestRect) { // this routine gets called every video frame @@ -2362,20 +2264,20 @@ void CAMLCodec::SetVideoRect(const CRect &SrcRect, const CRect &DestRect) update = true; } - // video stereo mode/view. - RENDER_STEREO_MODE stereo_mode = g_graphicsContext.GetStereoMode(); - if (m_stereo_mode != stereo_mode) + // GUI stereo mode/view. + RENDER_STEREO_MODE guiStereoMode = g_graphicsContext.GetStereoMode(); + if (m_guiStereoMode != guiStereoMode) { - m_stereo_mode = stereo_mode; + m_guiStereoMode = guiStereoMode; update = true; } - RENDER_STEREO_VIEW stereo_view = g_graphicsContext.GetStereoView(); - if (m_stereo_view != stereo_view) + RENDER_STEREO_VIEW guiStereoView = g_graphicsContext.GetStereoView(); + if (m_guiStereoView != guiStereoView) { // left/right/top/bottom eye, // this might change every other frame. // we do not care but just track it. - m_stereo_view = stereo_view; + m_guiStereoView = guiStereoView; } // dest_rect @@ -2427,9 +2329,9 @@ void CAMLCodec::SetVideoRect(const CRect &SrcRect, const CRect &DestRect) { float xscale = display.Width() / gui.Width(); float yscale = display.Height() / gui.Height(); - if (m_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) + if (m_guiStereoMode == RENDER_STEREO_MODE_SPLIT_VERTICAL) xscale /= 2.0; - else if (m_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) + else if (m_guiStereoMode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) yscale /= 2.0; dst_rect.x1 *= xscale; dst_rect.x2 *= xscale; @@ -2437,75 +2339,21 @@ void CAMLCodec::SetVideoRect(const CRect &SrcRect, const CRect &DestRect) dst_rect.y2 *= yscale; } - if (m_stereo_mode == RENDER_STEREO_MODE_MONO) + if (m_guiStereoMode == RENDER_STEREO_MODE_MONO) { - std::string mode = GetStereoMode(); - if (mode == "left_right") - { - if (!SetVideo3dMode(MODE_3D_TO_2D_L)) - { - // fall back to software scaling if no hw support - // was found - dst_rect.x2 *= 2.0; - } - } - else if (mode == "right_left") - { - if (!SetVideo3dMode(MODE_3D_TO_2D_R)) - { - // fall back to software scaling if no hw support - // was found - dst_rect.x2 *= 2.0; - } - } - else if (mode == "top_bottom") - { - if (!SetVideo3dMode(MODE_3D_TO_2D_T)) - { - // fall back to software scaling if no hw support - // was found - dst_rect.y2 *= 2.0; - } - } - else if (mode == "bottom_top") - { - if (!SetVideo3dMode(MODE_3D_TO_2D_B)) - { - // fall back to software scaling if no hw support - // was found - dst_rect.y2 *= 2.0; - } - } - else - SetVideo3dMode(MODE_3D_DISABLE); + std::string videoStereoMode = m_processInfo.GetVideoStereoMode(); + if (videoStereoMode == "left_right" || videoStereoMode == "righ_left") + dst_rect.x2 *= 2.0; + else if (videoStereoMode == "top_bottom" || videoStereoMode == "bottom_top") + dst_rect.y2 *= 2.0; } - else if (m_stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) + else if (m_guiStereoMode == RENDER_STEREO_MODE_SPLIT_VERTICAL) { dst_rect.x2 *= 2.0; - SetVideo3dMode(MODE_3D_DISABLE); } - else if (m_stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) + else if (m_guiStereoMode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL) { dst_rect.y2 *= 2.0; - SetVideo3dMode(MODE_3D_DISABLE); - } - else if (m_stereo_mode == RENDER_STEREO_MODE_INTERLACED) - { - std::string mode = GetStereoMode(); - if (mode == "left_right") - SetVideo3dMode(MODE_3D_LR); - else if (mode == "right_left") - SetVideo3dMode(MODE_3D_LR_SWITCH); - else if (mode == "row_interleaved_lr") - SetVideo3dMode(MODE_3D_LR); - else if (mode == "row_interleaved_rl") - SetVideo3dMode(MODE_3D_LR_SWITCH); - else - SetVideo3dMode(MODE_3D_DISABLE); - } - else - { - SetVideo3dMode(MODE_3D_DISABLE); } #if 1 @@ -2525,8 +2373,8 @@ void CAMLCodec::SetVideoRect(const CRect &SrcRect, const CRect &DestRect) CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:gui(%s)", s_gui.c_str()); CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:m_dst_rect(%s)", s_m_dst_rect.c_str()); CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:dst_rect(%s)", s_dst_rect.c_str()); - CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:m_stereo_mode(%d)", m_stereo_mode); - CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:m_stereo_view(%d)", m_stereo_view); + CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:m_guiStereoMode(%d)", m_guiStereoMode); + CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoRect:m_guiStereoView(%d)", m_guiStereoView); #endif // goofy 0/1 based difference in aml axis coordinates. diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.h index 378c237c3b..7d119842a9 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.h +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.h @@ -71,8 +71,6 @@ private: void SetVideoContrast(const int contrast); void SetVideoBrightness(const int brightness); void SetVideoSaturation(const int saturation); - bool SetVideo3dMode(const int mode3d); - std::string GetStereoMode(); bool OpenAmlVideo(const CDVDStreamInfo &hints); void CloseAmlVideo(); std::string GetVfmMap(const std::string &name); @@ -96,8 +94,8 @@ private: CRect m_display_rect; int m_view_mode = -1; - RENDER_STEREO_MODE m_stereo_mode = RENDER_STEREO_MODE_OFF; - RENDER_STEREO_VIEW m_stereo_view = RENDER_STEREO_VIEW_OFF; + RENDER_STEREO_MODE m_guiStereoMode = RENDER_STEREO_MODE_OFF; + RENDER_STEREO_VIEW m_guiStereoView = RENDER_STEREO_VIEW_OFF; float m_zoom = -1.0f; int m_contrast = -1; int m_brightness = -1; diff --git a/xbmc/rendering/gles/RenderSystemGLES.cpp b/xbmc/rendering/gles/RenderSystemGLES.cpp index 3e44589e66..911ab5d3e1 100644 --- a/xbmc/rendering/gles/RenderSystemGLES.cpp +++ b/xbmc/rendering/gles/RenderSystemGLES.cpp @@ -667,15 +667,7 @@ GLint CRenderSystemGLES::GUIShaderGetBrightness() bool CRenderSystemGLES::SupportsStereo(RENDER_STEREO_MODE mode) const { - switch(mode) - { - case RENDER_STEREO_MODE_INTERLACED: - if (g_sysinfo.HasHW3DInterlaced()) - return true; - - default: - return CRenderSystemBase::SupportsStereo(mode); - } + return CRenderSystemBase::SupportsStereo(mode); } GLint CRenderSystemGLES::GUIShaderGetModel() diff --git a/xbmc/utils/AMLUtils.cpp b/xbmc/utils/AMLUtils.cpp index 5666236e93..9ba833838f 100644 --- a/xbmc/utils/AMLUtils.cpp +++ b/xbmc/utils/AMLUtils.cpp @@ -54,22 +54,6 @@ bool aml_present() return has_aml == 1; } -bool aml_hw3d_present() -{ - static int has_hw3d = -1; - if (has_hw3d == -1) - { - if (SysfsUtils::Has("/sys/class/ppmgr/ppmgr_3d_mode") || - SysfsUtils::Has("/sys/class/amhdmitx/amhdmitx0/config")) - has_hw3d = 1; - else - has_hw3d = 0; - if (has_hw3d) - CLog::Log(LOGNOTICE, "AML 3D support detected"); - } - return has_hw3d == 1; -} - bool aml_wired_present() { static int has_wired = -1; @@ -138,10 +122,6 @@ bool aml_permissions() { CLog::Log(LOGERROR, "AML: no rw on /sys/class/audiodsp/digital_raw"); } - if (!SysfsUtils::HasRW("/sys/class/ppmgr/ppmgr_3d_mode")) - { - CLog::Log(LOGERROR, "AML: no rw on /sys/class/ppmgr/ppmgr_3d_mode"); - } if (!SysfsUtils::HasRW("/sys/class/amhdmitx/amhdmitx0/config")) { CLog::Log(LOGERROR, "AML: no rw on /sys/class/amhdmitx/amhdmitx0/config"); diff --git a/xbmc/utils/AMLUtils.h b/xbmc/utils/AMLUtils.h index a012d1b0ae..1fc7dab3e3 100644 --- a/xbmc/utils/AMLUtils.h +++ b/xbmc/utils/AMLUtils.h @@ -54,7 +54,6 @@ enum AML_SUPPORT_H264_4K2K bool aml_present(); bool aml_permissions(); -bool aml_hw3d_present(); bool aml_wired_present(); bool aml_support_hevc(); bool aml_support_hevc_4k2k(); diff --git a/xbmc/utils/SystemInfo.cpp b/xbmc/utils/SystemInfo.cpp index 6633a73fa9..c4ff3198c0 100644 --- a/xbmc/utils/SystemInfo.cpp +++ b/xbmc/utils/SystemInfo.cpp @@ -828,17 +828,6 @@ bool CSysInfo::IsAeroDisabled() return false; } -bool CSysInfo::HasHW3DInterlaced() -{ -#if defined(TARGET_ANDROID) -#if defined(HAS_LIBAMCODEC) - if (aml_hw3d_present()) - return true; -#endif -#endif - return false; -} - CSysInfo::WindowsVersion CSysInfo::m_WinVer = WindowsVersionUnknown; bool CSysInfo::IsWindowsVersion(WindowsVersion ver) diff --git a/xbmc/utils/SystemInfo.h b/xbmc/utils/SystemInfo.h index b5b21199c0..25a93cd627 100644 --- a/xbmc/utils/SystemInfo.h +++ b/xbmc/utils/SystemInfo.h @@ -126,7 +126,6 @@ public: bool HasInternet(); bool HasVideoToolBoxDecoder(); bool IsAeroDisabled(); - bool HasHW3DInterlaced(); static bool IsWindowsVersion(WindowsVersion ver); static bool IsWindowsVersionAtLeast(WindowsVersion ver); static WindowsVersion GetWindowsVersion(); |