diff options
author | Stephan Sundermann <stephansundermann@gmail.com> | 2024-03-24 11:28:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-24 11:28:01 +0100 |
commit | 302b601717c18f0bfefbcebd95e13c492935cf9b (patch) | |
tree | f226c86be4a8a98d6f339f54d03f54e1245e05e6 | |
parent | 4a78706ce16a77b087c6566ba5979262830138fb (diff) | |
parent | 4289f33de0be22596ec1a8b6d8618a01e72590e7 (diff) |
Merge pull request #24859 from quietvoid/webos_dovi_compat_mode
[webOS] Add support for Dolby Vision compatibility mode
-rw-r--r-- | cmake/platform/linux/webos.cmake | 2 | ||||
-rwxr-xr-x | system/settings/settings.xml | 12 | ||||
-rw-r--r-- | tools/depends/native/Makefile | 4 | ||||
-rw-r--r-- | tools/depends/native/rustup/Makefile | 12 | ||||
-rw-r--r-- | tools/depends/target/Makefile | 2 | ||||
-rw-r--r-- | tools/depends/target/libdovi/Makefile | 8 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecStarfish.cpp | 21 |
7 files changed, 53 insertions, 8 deletions
diff --git a/cmake/platform/linux/webos.cmake b/cmake/platform/linux/webos.cmake index b028c663cf..0ac0396116 100644 --- a/cmake/platform/linux/webos.cmake +++ b/cmake/platform/linux/webos.cmake @@ -5,7 +5,9 @@ include(${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/wayland.cmake) list(APPEND CORE_PLATFORM_NAME_LC wayland) list(APPEND PLATFORM_REQUIRED_DEPS WaylandProtocolsWebOS PlayerAPIs>=1.0.0 PlayerFactory>=1.0.0 WebOSHelpers>=2.0.0 AcbAPI) +list(APPEND PLATFORM_OPTIONAL_DEPS LibDovi) list(APPEND ARCH_DEFINES -DTARGET_WEBOS) + set(PLATFORM_OPTIONAL_DEPS_EXCLUDE CEC) set(ENABLE_PULSEAUDIO OFF CACHE BOOL "" FORCE) set(TARGET_WEBOS TRUE) diff --git a/system/settings/settings.xml b/system/settings/settings.xml index 7952a982ad..e48fcf1c08 100755 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -180,10 +180,18 @@ <control type="toggle" /> </setting> <setting id="videoplayer.convertdovi" type="boolean" label="39196" help="39197"> - <requirement>HAS_MEDIACODEC</requirement> + <requirement><!-- Android and webOS use CBitstreamConverter --> + <or> + <condition>HAS_MEDIACODEC</condition> + <condition>HAVE_WEBOS</condition> + </or> + </requirement> <dependencies> <dependency type="visible"> - <condition on="property" name="supportsdolbyvision" /> + <or> + <condition on="property" name="supportsdolbyvision" /> + <condition>HAVE_WEBOS</condition> + </or> </dependency> </dependencies> <level>2</level> diff --git a/tools/depends/native/Makefile b/tools/depends/native/Makefile index bd20cce746..8fcb0a83a5 100644 --- a/tools/depends/native/Makefile +++ b/tools/depends/native/Makefile @@ -48,6 +48,10 @@ ifeq ($(OS),linux) ifeq ($(RENDER_SYSTEM),gles) NATIVE += MarkupSafe Mako endif + + ifeq ($(TARGET_PLATFORM),webos) + NATIVE += rustup cargo-c + endif endif ifeq ($(OS),android) diff --git a/tools/depends/native/rustup/Makefile b/tools/depends/native/rustup/Makefile index 6930764eb4..c9f1c07570 100644 --- a/tools/depends/native/rustup/Makefile +++ b/tools/depends/native/rustup/Makefile @@ -4,6 +4,14 @@ DEPS = ../../Makefile.include Makefile RUSTUP-VERSION ../../download-files.inclu PREFIX=$(NATIVEPREFIX) PLATFORM=$(NATIVEPLATFORM) +ifeq ($(CROSS_COMPILING),yes) + ifeq ($(TARGET_PLATFORM),webos) + RUST_TARGET = armv7-unknown-linux-gnueabi + else + RUST_TARGET = $(HOST) + endif +endif + APP=$(PLATFORM)/bin/$(APPNAME) export RUSTUP_HOME=$(PREFIX)/.rustup @@ -36,8 +44,8 @@ $(APP): $(PLATFORM) $(RUSTUP) default $(RUST_TOOLCHAIN_VERSION) -ifeq ($(CROSS_COMPILING),yes) - $(RUSTUP) target add $(HOST) +ifdef RUST_TARGET + $(RUSTUP) target add $(RUST_TARGET) endif touch $@ diff --git a/tools/depends/target/Makefile b/tools/depends/target/Makefile index 8c9ba97195..a498d373e4 100644 --- a/tools/depends/target/Makefile +++ b/tools/depends/target/Makefile @@ -126,7 +126,7 @@ ifeq ($(OS),linux) endif ifeq ($(TARGET_PLATFORM),webos) - DEPENDS += wayland waylandpp wayland-protocols webos-wayland-extensions webos-userland + DEPENDS += libdovi wayland waylandpp wayland-protocols webos-wayland-extensions webos-userland EXCLUDED_DEPENDS += dbus linux-system-x11-libs pipewire mesa endif diff --git a/tools/depends/target/libdovi/Makefile b/tools/depends/target/libdovi/Makefile index 2d868d2fde..202a894f57 100644 --- a/tools/depends/target/libdovi/Makefile +++ b/tools/depends/target/libdovi/Makefile @@ -9,7 +9,13 @@ CARGO = $(CARGO_ENV_VARS) $(NATIVEPREFIX)/bin/cargo CARGO_BASE_OPTS = --manifest-path $(PLATFORM)/dolby_vision/Cargo.toml ifeq ($(CROSS_COMPILING),yes) - CARGO_BASE_OPTS += --target $(HOST) + ifeq ($(TARGET_PLATFORM),webos) + RUST_TARGET = armv7-unknown-linux-gnueabi + else + RUST_TARGET = $(HOST) + endif + + CARGO_BASE_OPTS += --target $(RUST_TARGET) endif CARGO_BUILD_OPTS = --offline \ diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecStarfish.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecStarfish.cpp index b30864fca6..7e9988de84 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecStarfish.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecStarfish.cpp @@ -155,10 +155,13 @@ bool CDVDVideoCodecStarfish::OpenInternal(CDVDStreamInfo& hints, CDVDCodecOption case AV_CODEC_ID_HEVC: { const auto settings = CServiceBroker::GetSettingsComponent()->GetSettings(); + bool convertDovi{false}; bool removeDovi{false}; if (settings) { + convertDovi = settings->GetBool(CSettings::SETTING_VIDEOPLAYER_CONVERTDOVI); + const std::shared_ptr<CSettingList> allowedHdrFormatsSetting( std::dynamic_pointer_cast<CSettingList>( settings->GetSetting(CSettings::SETTING_VIDEOPLAYER_ALLOWEDHDRFORMATS))); @@ -169,6 +172,9 @@ bool CDVDVideoCodecStarfish::OpenInternal(CDVDStreamInfo& hints, CDVDCodecOption bool isDvhe = (m_hints.codec_tag == MKTAG('d', 'v', 'h', 'e')); bool isDvh1 = (m_hints.codec_tag == MKTAG('d', 'v', 'h', '1')); + bool payloadDoviProfile = m_hints.dovi.dv_profile; + bool payloadElPresentFlag = m_hints.dovi.el_present_flag; + // some files don't have dvhe or dvh1 tag set up but have Dolby Vision side data if (!isDvhe && !isDvh1 && m_hints.hdrType == StreamHdrType::HDR_TYPE_DOLBYVISION) { @@ -179,6 +185,13 @@ bool CDVDVideoCodecStarfish::OpenInternal(CDVDStreamInfo& hints, CDVDCodecOption isDvhe = true; } + // set profile 8 and single layer when converting + if (!removeDovi && convertDovi && m_hints.dovi.dv_profile == 7) + { + payloadDoviProfile = 8; + payloadElPresentFlag = false; + } + if (!removeDovi && (isDvhe || isDvh1)) { m_formatname = isDvhe ? "starfish-dvhe" : "starfish-dvh1"; @@ -186,9 +199,9 @@ bool CDVDVideoCodecStarfish::OpenInternal(CDVDStreamInfo& hints, CDVDCodecOption payloadArg["option"]["externalStreamingInfo"]["contents"]["DolbyHdrInfo"] ["encryptionType"] = "clear"; //"clear", "bl", "el", "all" payloadArg["option"]["externalStreamingInfo"]["contents"]["DolbyHdrInfo"]["profileId"] = - m_hints.dovi.dv_profile; // profile 0-9 + payloadDoviProfile; // profile 0-9 payloadArg["option"]["externalStreamingInfo"]["contents"]["DolbyHdrInfo"]["trackType"] = - m_hints.dovi.el_present_flag ? "dual" : "single"; // "single" / "dual" + payloadElPresentFlag ? "dual" : "single"; // "single" / "dual" } // check for hevc-hvcC and convert to h265-annex-b @@ -207,6 +220,10 @@ bool CDVDVideoCodecStarfish::OpenInternal(CDVDStreamInfo& hints, CDVDCodecOption // webOS doesn't support HDR10+ and it can cause issues m_bitstream->SetRemoveHdr10Plus(true); + + // Only set for profile 7, container hint allows to skip parsing unnecessarily + if (m_hints.dovi.dv_profile == 7) + m_bitstream->SetConvertDovi(convertDovi); } } |