Skip to content

Commit a059f5a

Browse files
committed
[Android] [webOS] Add Dolby Vision setting to set zero L5 metadata
1 parent ec8a823 commit a059f5a

File tree

6 files changed

+39
-1
lines changed

6 files changed

+39
-1
lines changed

addons/resource.language.en_gb/resources/strings.po

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24358,7 +24358,19 @@ msgctxt "#39208"
2435824358
msgid "Starfish is the hardware video decoder for LG's webOS. Disable it for troubleshooting or testing."
2435924359
msgstr ""
2436024360

24361-
#empty strings from id 39209 to 39999
24361+
#. Title of Dolby Vision level 5 metadata zero override setting
24362+
#: system/settings/settings.xml
24363+
msgctxt "#39209"
24364+
msgid "Dolby Vision: Override level 5 metadata to zero"
24365+
msgstr ""
24366+
24367+
#. Help text for setting "Dolby Vision: Override level 5 metadata to zero" of label #39209
24368+
#: system/settings/settings.xml
24369+
msgctxt "#39210"
24370+
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."
24371+
msgstr ""
24372+
24373+
#empty strings from id 39211 to 39999
2436224374

2436324375
# 40000 to 40800 are reserved for Video Versions feature
2436424376

system/settings/settings.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,25 @@
241241
<hidevalue>false</hidevalue>
242242
</control>
243243
</setting>
244+
<setting id="videoplayer.dovizerolevel5" type="boolean" label="39209" help="39210">
245+
<requirement><!-- Android and webOS use CBitstreamConverter -->
246+
<or>
247+
<condition>HAS_MEDIACODEC</condition>
248+
<condition>HAVE_WEBOS</condition>
249+
</or>
250+
</requirement>
251+
<dependencies>
252+
<dependency type="visible">
253+
<or>
254+
<condition on="property" name="supportsdolbyvision" />
255+
<condition>HAVE_WEBOS</condition>
256+
</or>
257+
</dependency>
258+
</dependencies>
259+
<level>2</level>
260+
<default>false</default>
261+
<control type="toggle" />
262+
</setting>
244263
</group>
245264
<group id="4" label="14232">
246265
<setting id="videoplayer.stereoscopicplaybackmode" type="integer" label="36520" help="36537">

xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,10 +500,12 @@ bool CDVDVideoCodecAndroidMediaCodec::Open(CDVDStreamInfo &hints, CDVDCodecOptio
500500
bool convertDovi{false};
501501
bool removeDovi{false};
502502
bool removeHdr10Plus{false};
503+
bool doviZeroLevel5{false};
503504

504505
if (settings)
505506
{
506507
convertDovi = settings->GetBool(CSettings::SETTING_VIDEOPLAYER_CONVERTDOVI);
508+
doviZeroLevel5 = settings->GetBool(CSettings::SETTING_VIDEOPLAYER_DOVIZEROLEVEL5);
507509

508510
const std::shared_ptr<CSettingList> allowedHdrFormatsSetting(
509511
std::dynamic_pointer_cast<CSettingList>(
@@ -600,6 +602,7 @@ bool CDVDVideoCodecAndroidMediaCodec::Open(CDVDStreamInfo &hints, CDVDCodecOptio
600602
{
601603
m_bitstream->SetRemoveDovi(removeDovi);
602604
m_bitstream->SetRemoveHdr10Plus(removeHdr10Plus);
605+
m_bitstream->SetDoviZeroLevel5(doviZeroLevel5);
603606

604607
// Only set for profile 7, container hint allows to skip parsing unnecessarily
605608
if (m_hints.dovi.dv_profile == 7)

xbmc/cores/VideoPlayer/MediaPipelineWebOS.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,7 @@ void CMediaPipelineWebOS::SetupBitstreamConverter(CDVDStreamInfo& hint)
846846
const std::shared_ptr<CSettings> settings = CServiceBroker::GetSettingsComponent()->GetSettings();
847847
const bool convertDovi =
848848
hint.dovi.el_present_flag || settings->GetBool(CSettings::SETTING_VIDEOPLAYER_CONVERTDOVI);
849+
const bool doviZeroLevel5 = settings->GetBool(CSettings::SETTING_VIDEOPLAYER_DOVIZEROLEVEL5);
849850

850851
const std::shared_ptr allowedHdrFormatsSetting(std::dynamic_pointer_cast<CSettingList>(
851852
settings->GetSetting(CSettings::SETTING_VIDEOPLAYER_ALLOWEDHDRFORMATS)));
@@ -864,6 +865,7 @@ void CMediaPipelineWebOS::SetupBitstreamConverter(CDVDStreamInfo& hint)
864865
if (hint.codec == AV_CODEC_ID_HEVC)
865866
{
866867
m_bitstream->SetRemoveDovi(removeDovi);
868+
m_bitstream->SetDoviZeroLevel5(doviZeroLevel5);
867869

868870
// webOS doesn't support HDR10+ and it can cause issues
869871
m_bitstream->SetRemoveHdr10Plus(true);

xbmc/settings/Settings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ class CSettings : public CSettingsBase, public CSettingCreator, public CSettingC
137137
static constexpr auto SETTING_VIDEOPLAYER_SUPPORTMVC = "videoplayer.supportmvc";
138138
static constexpr auto SETTING_VIDEOPLAYER_CONVERTDOVI = "videoplayer.convertdovi";
139139
static constexpr auto SETTING_VIDEOPLAYER_ALLOWEDHDRFORMATS = "videoplayer.allowedhdrformats";
140+
static constexpr auto SETTING_VIDEOPLAYER_DOVIZEROLEVEL5 = "videoplayer.dovizerolevel5";
140141
static constexpr auto SETTING_VIDEOPLAYER_QUEUETIMESIZE = "videoplayer.queuetimesize";
141142
static constexpr auto SETTING_VIDEOPLAYER_QUEUEDATASIZE = "videoplayer.queuedatasize";
142143
static constexpr auto SETTING_MYVIDEOS_SELECTACTION = "myvideos.selectaction";

xbmc/utils/BitstreamConverter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ class CBitstreamConverter
106106
void SetConvertDovi(bool value) { m_convert_dovi = value; }
107107
void SetRemoveDovi(bool value) { m_removeDovi = value; }
108108
void SetRemoveHdr10Plus(bool value) { m_removeHdr10Plus = value; }
109+
void SetDoviZeroLevel5(bool value) { m_setDoviZeroLevel5 = value; }
109110

110111
static bool mpeg2_sequence_header(const uint8_t *data, const uint32_t size, mpeg2_sequence *sequence);
111112

0 commit comments

Comments
 (0)