[Android] [webOS] Add Dolby Vision setting to set zero L5 metadata

This commit is contained in:
quietvoid 2025-11-04 06:35:26 -05:00
parent ec8a8236aa
commit a059f5a757
No known key found for this signature in database
GPG Key ID: DEF88C28C3F9DEC7
6 changed files with 39 additions and 1 deletions

View File

@ -24358,7 +24358,19 @@ msgctxt "#39208"
msgid "Starfish is the hardware video decoder for LG's webOS. Disable it for troubleshooting or testing." msgid "Starfish is the hardware video decoder for LG's webOS. Disable it for troubleshooting or testing."
msgstr "" msgstr ""
#empty strings from id 39209 to 39999 #. Title of Dolby Vision level 5 metadata zero override setting
#: system/settings/settings.xml
msgctxt "#39209"
msgid "Dolby Vision: Override level 5 metadata to zero"
msgstr ""
#. Help text for setting "Dolby Vision: Override level 5 metadata to zero" of label #39209
#: system/settings/settings.xml
msgctxt "#39210"
msgid "If enabled, Dolby Vision files will have level 5 (active area) metadata overridden to zero offsets. Enable if your display has issues with incorrectly cropped image in Dolby Vision playback."
msgstr ""
#empty strings from id 39211 to 39999
# 40000 to 40800 are reserved for Video Versions feature # 40000 to 40800 are reserved for Video Versions feature

View File

@ -241,6 +241,25 @@
<hidevalue>false</hidevalue> <hidevalue>false</hidevalue>
</control> </control>
</setting> </setting>
<setting id="videoplayer.dovizerolevel5" type="boolean" label="39209" help="39210">
<requirement><!-- Android and webOS use CBitstreamConverter -->
<or>
<condition>HAS_MEDIACODEC</condition>
<condition>HAVE_WEBOS</condition>
</or>
</requirement>
<dependencies>
<dependency type="visible">
<or>
<condition on="property" name="supportsdolbyvision" />
<condition>HAVE_WEBOS</condition>
</or>
</dependency>
</dependencies>
<level>2</level>
<default>false</default>
<control type="toggle" />
</setting>
</group> </group>
<group id="4" label="14232"> <group id="4" label="14232">
<setting id="videoplayer.stereoscopicplaybackmode" type="integer" label="36520" help="36537"> <setting id="videoplayer.stereoscopicplaybackmode" type="integer" label="36520" help="36537">

View File

@ -500,10 +500,12 @@ bool CDVDVideoCodecAndroidMediaCodec::Open(CDVDStreamInfo &hints, CDVDCodecOptio
bool convertDovi{false}; bool convertDovi{false};
bool removeDovi{false}; bool removeDovi{false};
bool removeHdr10Plus{false}; bool removeHdr10Plus{false};
bool doviZeroLevel5{false};
if (settings) if (settings)
{ {
convertDovi = settings->GetBool(CSettings::SETTING_VIDEOPLAYER_CONVERTDOVI); convertDovi = settings->GetBool(CSettings::SETTING_VIDEOPLAYER_CONVERTDOVI);
doviZeroLevel5 = settings->GetBool(CSettings::SETTING_VIDEOPLAYER_DOVIZEROLEVEL5);
const std::shared_ptr<CSettingList> allowedHdrFormatsSetting( const std::shared_ptr<CSettingList> allowedHdrFormatsSetting(
std::dynamic_pointer_cast<CSettingList>( std::dynamic_pointer_cast<CSettingList>(
@ -600,6 +602,7 @@ bool CDVDVideoCodecAndroidMediaCodec::Open(CDVDStreamInfo &hints, CDVDCodecOptio
{ {
m_bitstream->SetRemoveDovi(removeDovi); m_bitstream->SetRemoveDovi(removeDovi);
m_bitstream->SetRemoveHdr10Plus(removeHdr10Plus); m_bitstream->SetRemoveHdr10Plus(removeHdr10Plus);
m_bitstream->SetDoviZeroLevel5(doviZeroLevel5);
// Only set for profile 7, container hint allows to skip parsing unnecessarily // Only set for profile 7, container hint allows to skip parsing unnecessarily
if (m_hints.dovi.dv_profile == 7) if (m_hints.dovi.dv_profile == 7)

View File

@ -846,6 +846,7 @@ void CMediaPipelineWebOS::SetupBitstreamConverter(CDVDStreamInfo& hint)
const std::shared_ptr<CSettings> settings = CServiceBroker::GetSettingsComponent()->GetSettings(); const std::shared_ptr<CSettings> settings = CServiceBroker::GetSettingsComponent()->GetSettings();
const bool convertDovi = const bool convertDovi =
hint.dovi.el_present_flag || settings->GetBool(CSettings::SETTING_VIDEOPLAYER_CONVERTDOVI); hint.dovi.el_present_flag || settings->GetBool(CSettings::SETTING_VIDEOPLAYER_CONVERTDOVI);
const bool doviZeroLevel5 = settings->GetBool(CSettings::SETTING_VIDEOPLAYER_DOVIZEROLEVEL5);
const std::shared_ptr allowedHdrFormatsSetting(std::dynamic_pointer_cast<CSettingList>( const std::shared_ptr allowedHdrFormatsSetting(std::dynamic_pointer_cast<CSettingList>(
settings->GetSetting(CSettings::SETTING_VIDEOPLAYER_ALLOWEDHDRFORMATS))); settings->GetSetting(CSettings::SETTING_VIDEOPLAYER_ALLOWEDHDRFORMATS)));
@ -864,6 +865,7 @@ void CMediaPipelineWebOS::SetupBitstreamConverter(CDVDStreamInfo& hint)
if (hint.codec == AV_CODEC_ID_HEVC) if (hint.codec == AV_CODEC_ID_HEVC)
{ {
m_bitstream->SetRemoveDovi(removeDovi); m_bitstream->SetRemoveDovi(removeDovi);
m_bitstream->SetDoviZeroLevel5(doviZeroLevel5);
// webOS doesn't support HDR10+ and it can cause issues // webOS doesn't support HDR10+ and it can cause issues
m_bitstream->SetRemoveHdr10Plus(true); m_bitstream->SetRemoveHdr10Plus(true);

View File

@ -137,6 +137,7 @@ public:
static constexpr auto SETTING_VIDEOPLAYER_SUPPORTMVC = "videoplayer.supportmvc"; static constexpr auto SETTING_VIDEOPLAYER_SUPPORTMVC = "videoplayer.supportmvc";
static constexpr auto SETTING_VIDEOPLAYER_CONVERTDOVI = "videoplayer.convertdovi"; static constexpr auto SETTING_VIDEOPLAYER_CONVERTDOVI = "videoplayer.convertdovi";
static constexpr auto SETTING_VIDEOPLAYER_ALLOWEDHDRFORMATS = "videoplayer.allowedhdrformats"; static constexpr auto SETTING_VIDEOPLAYER_ALLOWEDHDRFORMATS = "videoplayer.allowedhdrformats";
static constexpr auto SETTING_VIDEOPLAYER_DOVIZEROLEVEL5 = "videoplayer.dovizerolevel5";
static constexpr auto SETTING_VIDEOPLAYER_QUEUETIMESIZE = "videoplayer.queuetimesize"; static constexpr auto SETTING_VIDEOPLAYER_QUEUETIMESIZE = "videoplayer.queuetimesize";
static constexpr auto SETTING_VIDEOPLAYER_QUEUEDATASIZE = "videoplayer.queuedatasize"; static constexpr auto SETTING_VIDEOPLAYER_QUEUEDATASIZE = "videoplayer.queuedatasize";
static constexpr auto SETTING_MYVIDEOS_SELECTACTION = "myvideos.selectaction"; static constexpr auto SETTING_MYVIDEOS_SELECTACTION = "myvideos.selectaction";

View File

@ -106,6 +106,7 @@ public:
void SetConvertDovi(bool value) { m_convert_dovi = value; } void SetConvertDovi(bool value) { m_convert_dovi = value; }
void SetRemoveDovi(bool value) { m_removeDovi = value; } void SetRemoveDovi(bool value) { m_removeDovi = value; }
void SetRemoveHdr10Plus(bool value) { m_removeHdr10Plus = value; } void SetRemoveHdr10Plus(bool value) { m_removeHdr10Plus = value; }
void SetDoviZeroLevel5(bool value) { m_setDoviZeroLevel5 = value; }
static bool mpeg2_sequence_header(const uint8_t *data, const uint32_t size, mpeg2_sequence *sequence); static bool mpeg2_sequence_header(const uint8_t *data, const uint32_t size, mpeg2_sequence *sequence);