diff --git a/packages/mediacenter/xbmc/config/advancedsettings.xml b/packages/mediacenter/xbmc/config/advancedsettings.xml index 81c059d66d..25d43d038b 100644 --- a/packages/mediacenter/xbmc/config/advancedsettings.xml +++ b/packages/mediacenter/xbmc/config/advancedsettings.xml @@ -13,6 +13,7 @@ 175 + true 30 diff --git a/packages/mediacenter/xbmc/patches/xbmc-f70eb43-601-add_multithread_support_for_hi10p-0.1.patch b/packages/mediacenter/xbmc/patches/xbmc-f70eb43-601-add_multithread_support_for_hi10p-0.1.patch new file mode 100644 index 0000000000..0e7c7f73cc --- /dev/null +++ b/packages/mediacenter/xbmc/patches/xbmc-f70eb43-601-add_multithread_support_for_hi10p-0.1.patch @@ -0,0 +1,105 @@ +From 29d0061ac7887ed8681847915d5d5bcd3af3fa9b Mon Sep 17 00:00:00 2001 +From: fritsch +Date: Sat, 12 Jan 2013 13:03:50 +0100 +Subject: [PATCH] dvdplayer: Allow multithread decoding for hi10p content + +This allows decoding of some hi10p material on e.g. AMD Fusion with +both cores at the max. This introduces a new advancedsetting to get hi10p +decoded multithreaded. +--- + .../dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 17 +++++++++++++++-- + .../dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h | 1 + + xbmc/settings/AdvancedSettings.cpp | 2 ++ + xbmc/settings/AdvancedSettings.h | 1 + + 4 files changed, 19 insertions(+), 2 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +index 8f81637..8164457 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +@@ -138,6 +138,7 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx + m_iScreenHeight = 0; + m_iOrientation = 0; + m_bSoftware = false; ++ m_isHi10p = false; + m_pHardware = NULL; + m_iLastKeyframe = 0; + m_dts = DVD_NOPTS_VALUE; +@@ -187,7 +188,10 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options + case FF_PROFILE_H264_HIGH_444_PREDICTIVE: + case FF_PROFILE_H264_HIGH_444_INTRA: + case FF_PROFILE_H264_CAVLC_444: ++ // this is needed to not open the decoders + m_bSoftware = true; ++ // this we need to enable multithreading for hi10p via advancedsettings ++ m_isHi10p = true; + break; + } + } +@@ -247,8 +251,17 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options + m_pCodecContext->codec_tag = hints.codec_tag; + /* Only allow slice threading, since frame threading is more + * sensitive to changes in frame sizes, and it causes crashes +- * during HW accell */ +- m_pCodecContext->thread_type = FF_THREAD_SLICE; ++ * during HW accell - so we unset it in this case. ++ * ++ * When user forces it and codec is hi10p - we enable it again. ++ * */ ++ if(m_isHi10p && g_advancedSettings.m_videoAllowHi10pMultithreading) ++ { ++ m_pCodecContext->thread_type = FF_THREAD_FRAME; ++ CLog::Log(LOGDEBUG,"CDVDVideoCodecFFmpeg::Open() Enabled Hi10p Multithreading"); ++ } ++ else ++ m_pCodecContext->thread_type = FF_THREAD_SLICE; + + #if defined(TARGET_DARWIN_IOS) + // ffmpeg with enabled neon will crash and burn if this is enabled +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h +index 61d0305..827b2d9 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h +@@ -114,6 +114,7 @@ class CDVDVideoCodecFFmpeg : public CDVDVideoCodec + + std::string m_name; + bool m_bSoftware; ++ bool m_isHi10p; + IHardwareDecoder *m_pHardware; + int m_iLastKeyframe; + double m_dts; +diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp +index 16800b7..50d6462 100644 +--- a/xbmc/settings/AdvancedSettings.cpp ++++ b/xbmc/settings/AdvancedSettings.cpp +@@ -112,6 +112,7 @@ void CAdvancedSettings::Initialize() + m_DXVANoDeintProcForProgressive = false; + m_videoFpsDetect = 1; + m_videoDefaultLatency = 0.0; ++ m_videoAllowHi10pMultithreading = false; + + m_musicUseTimeSeeking = true; + m_musicTimeSeekForward = 10; +@@ -498,6 +499,7 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) + XMLUtils::GetBoolean(pElement,"enablehighqualityhwscalers", m_videoEnableHighQualityHwScalers); + XMLUtils::GetFloat(pElement,"autoscalemaxfps",m_videoAutoScaleMaxFps, 0.0f, 1000.0f); + XMLUtils::GetBoolean(pElement,"allowmpeg4vdpau",m_videoAllowMpeg4VDPAU); ++ XMLUtils::GetBoolean(pElement,"allowhi10pmultithreading",m_videoAllowHi10pMultithreading); + XMLUtils::GetBoolean(pElement,"allowmpeg4vaapi",m_videoAllowMpeg4VAAPI); + XMLUtils::GetBoolean(pElement, "disablebackgrounddeinterlace", m_videoDisableBackgroundDeinterlace); + XMLUtils::GetInt(pElement, "useocclusionquery", m_videoCaptureUseOcclusionQuery, -1, 1); +diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h +index 27887d4..37723f7 100644 +--- a/xbmc/settings/AdvancedSettings.h ++++ b/xbmc/settings/AdvancedSettings.h +@@ -164,6 +164,7 @@ class CAdvancedSettings + bool m_DXVAForceProcessorRenderer; + bool m_DXVANoDeintProcForProgressive; + int m_videoFpsDetect; ++ bool m_videoAllowHi10pMultithreading; + + CStdString m_videoDefaultPlayer; + CStdString m_videoDefaultDVDPlayer; +-- +1.7.10 + diff --git a/projects/ATV/xbmc/advancedsettings.xml b/projects/ATV/xbmc/advancedsettings.xml index c8fb2f902f..fba7726d3a 100644 --- a/projects/ATV/xbmc/advancedsettings.xml +++ b/projects/ATV/xbmc/advancedsettings.xml @@ -13,6 +13,7 @@ 175 + true 30 diff --git a/projects/RPi/xbmc/advancedsettings.xml b/projects/RPi/xbmc/advancedsettings.xml index 80b7e6c1c6..29f1bcf136 100644 --- a/projects/RPi/xbmc/advancedsettings.xml +++ b/projects/RPi/xbmc/advancedsettings.xml @@ -15,6 +15,7 @@