diff options
-rwxr-xr-x | system/settings/settings.xml | 7 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecStarfish.cpp | 26 | ||||
-rw-r--r-- | xbmc/settings/SettingConditions.cpp | 4 |
3 files changed, 34 insertions, 3 deletions
diff --git a/system/settings/settings.xml b/system/settings/settings.xml index 45ee68e299..9e09dc3578 100755 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -191,7 +191,12 @@ <control type="toggle" /> </setting> <setting id="videoplayer.allowedhdrformats" type="list[integer]" label="39198" help="39199"> - <requirement>HAS_MEDIACODEC</requirement> + <requirement><!-- Android and webOS use CBitstreamConverter --> + <or> + <condition>HAS_MEDIACODEC</condition> + <condition>HAVE_WEBOS</condition> + </or> + </requirement> <level>2</level> <default>0,1</default> <!-- Allow all HDR formats --> <constraints> diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecStarfish.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecStarfish.cpp index f919443451..b30864fca6 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecStarfish.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecStarfish.cpp @@ -17,8 +17,10 @@ #include "cores/VideoPlayer/VideoRenderers/RenderManager.h" #include "media/decoderfilter/DecoderFilterManager.h" #include "messaging/ApplicationMessenger.h" +#include "settings/SettingUtils.h" #include "settings/Settings.h" #include "settings/SettingsComponent.h" +#include "settings/lib/Setting.h" #include "utils/BitstreamConverter.h" #include "utils/CPUInfo.h" #include "utils/JSONVariantWriter.h" @@ -152,6 +154,18 @@ bool CDVDVideoCodecStarfish::OpenInternal(CDVDStreamInfo& hints, CDVDCodecOption break; case AV_CODEC_ID_HEVC: { + const auto settings = CServiceBroker::GetSettingsComponent()->GetSettings(); + bool removeDovi{false}; + + if (settings) + { + const std::shared_ptr<CSettingList> allowedHdrFormatsSetting( + std::dynamic_pointer_cast<CSettingList>( + settings->GetSetting(CSettings::SETTING_VIDEOPLAYER_ALLOWEDHDRFORMATS))); + removeDovi = !CSettingUtils::FindIntInList( + allowedHdrFormatsSetting, CSettings::VIDEOPLAYER_ALLOWED_HDR_TYPE_DOLBY_VISION); + } + bool isDvhe = (m_hints.codec_tag == MKTAG('d', 'v', 'h', 'e')); bool isDvh1 = (m_hints.codec_tag == MKTAG('d', 'v', 'h', '1')); @@ -165,7 +179,7 @@ bool CDVDVideoCodecStarfish::OpenInternal(CDVDStreamInfo& hints, CDVDCodecOption isDvhe = true; } - if (isDvhe || isDvh1) + if (!removeDovi && (isDvhe || isDvh1)) { m_formatname = isDvhe ? "starfish-dvhe" : "starfish-dvh1"; @@ -186,6 +200,14 @@ bool CDVDVideoCodecStarfish::OpenInternal(CDVDStreamInfo& hints, CDVDCodecOption { m_bitstream.reset(); } + + if (m_bitstream) + { + m_bitstream->SetRemoveDovi(removeDovi); + + // webOS doesn't support HDR10+ and it can cause issues + m_bitstream->SetRemoveHdr10Plus(true); + } } break; @@ -614,4 +636,4 @@ void CDVDVideoCodecStarfish::AcbCallback( CLog::LogF(LOGDEBUG, "ACB callback: acbId={}, taskId={}, eventType={}, appState={}, playState={}, reply={}", acbId, taskId, eventType, appState, playState, reply); -}
\ No newline at end of file +} diff --git a/xbmc/settings/SettingConditions.cpp b/xbmc/settings/SettingConditions.cpp index 45997a36a4..1f11a4995e 100644 --- a/xbmc/settings/SettingConditions.cpp +++ b/xbmc/settings/SettingConditions.cpp @@ -433,6 +433,10 @@ void CSettingConditions::Initialize() m_simpleConditions.emplace("has_dx"); m_simpleConditions.emplace("hasdxva2"); #endif +#if defined(TARGET_WEBOS) + m_simpleConditions.emplace("have_webos"); +#endif + #ifdef HAVE_LCMS2 m_simpleConditions.emplace("have_lcms2"); #endif |