aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorquietvoid <39477805+quietvoid@users.noreply.github.com>2024-01-28 15:22:10 -0500
committerquietvoid <39477805+quietvoid@users.noreply.github.com>2024-01-29 12:54:47 -0500
commit032cbfeb20f7ec6ca54f98b76efdd3a8a80aac21 (patch)
tree1a30bc49f7740af311e62153e2dfa9ce135ff1ef
parent33e546ed8a1ac1e13fb30f1a3e8d392328219106 (diff)
[webOS] Add setting to select allowed HDR dynamic metadata formats
It uses CBitstreamConverter and supports Dolby Vision. Therefore the setting can be useful. There are also TV models that have compatibility issues with videos containing both Dolby Vision and HDR10+ metadata in the bitstream. So by default, HDR10+ is always disabled as no TVs support it anyway. Fixes #24390.
-rwxr-xr-xsystem/settings/settings.xml7
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecStarfish.cpp26
-rw-r--r--xbmc/settings/SettingConditions.cpp4
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