diff options
14 files changed, 113 insertions, 134 deletions
diff --git a/cmake/modules/FindPulseAudio.cmake b/cmake/modules/FindPulseAudio.cmake index c35a405a79..8a96588f39 100644 --- a/cmake/modules/FindPulseAudio.cmake +++ b/cmake/modules/FindPulseAudio.cmake @@ -62,7 +62,7 @@ if(NOT TARGET PulseAudio::PulseAudio) set_target_properties(PulseAudio::PulseAudio PROPERTIES IMPORTED_LOCATION "${PULSEAUDIO_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES "${PULSEAUDIO_INCLUDE_DIR}" - INTERFACE_COMPILE_DEFINITIONS HAVE_LIBPULSE=1 + INTERFACE_COMPILE_DEFINITIONS HAS_PULSEAUDIO=1 INTERFACE_LINK_LIBRARIES "PulseAudio::PulseAudioMainloop;PulseAudio::PulseAudioSimple") set_property(GLOBAL APPEND PROPERTY INTERNAL_DEPS_PROP PulseAudio::PulseAudio) diff --git a/system/keymaps/keyboard.xml b/system/keymaps/keyboard.xml index 1a192160c9..ac0033d7f8 100644 --- a/system/keymaps/keyboard.xml +++ b/system/keymaps/keyboard.xml @@ -672,15 +672,6 @@ <blue>Blue</blue> </keyboard> </Teletext> - <Favourites> - <keyboard> - <backspace>Close</backspace> - <browser_back>Close</browser_back> - <u>MoveItemUp</u> - <d>MoveItemDown</d> - <backspace mod="longpress">ActivateWindow(Home)</backspace> - </keyboard> - </Favourites> <FavouritesBrowser> <keyboard> <u>MoveItemUp</u> diff --git a/system/keymaps/remote.xml b/system/keymaps/remote.xml index c122b99188..5c0baf7e9d 100644 --- a/system/keymaps/remote.xml +++ b/system/keymaps/remote.xml @@ -564,11 +564,6 @@ <teletext>Back</teletext> </remote> </Teletext> - <Favourites> - <remote> - <back>Close</back> - </remote> - </Favourites> <FullscreenLiveTV> <remote> <left>StepBack</left> diff --git a/tools/depends/target/ffmpeg/Makefile b/tools/depends/target/ffmpeg/Makefile index 82f86ef008..0a00827ba2 100644 --- a/tools/depends/target/ffmpeg/Makefile +++ b/tools/depends/target/ffmpeg/Makefile @@ -35,12 +35,6 @@ else BASE_URL := http://mirrors.kodi.tv/build-deps/sources endif -ifeq ($(OS), android) - ifeq ($(findstring arm64, $(CPU)), arm64) - CMAKE_ARGS+= -DENABLE_NEON=YES - endif -endif - include ../../download-files.include all: .installed-$(PLATFORM) diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/CMakeLists.txt b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/CMakeLists.txt index 76f18f0f20..5bb02199e7 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/CMakeLists.txt +++ b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/CMakeLists.txt @@ -6,15 +6,19 @@ set(HEADERS ConvolutionKernels.h if(CORE_SYSTEM_NAME STREQUAL windows OR CORE_SYSTEM_NAME STREQUAL windowsstore) list(APPEND SOURCES ConversionMatrix.cpp + ToneMappers.cpp WinVideoFilter.cpp) list(APPEND HEADERS ConversionMatrix.h + ToneMappers.h WinVideoFilter.h) endif() if(TARGET OpenGL::GL OR TARGET OpenGL::GLES) - list(APPEND SOURCES ConversionMatrix.cpp) - list(APPEND HEADERS ConversionMatrix.h) + list(APPEND SOURCES ConversionMatrix.cpp + ToneMappers.cpp) + list(APPEND HEADERS ConversionMatrix.h + ToneMappers.h) endif() if(TARGET OpenGL::GL) diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/ToneMappers.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/ToneMappers.cpp new file mode 100644 index 0000000000..f98cd71c01 --- /dev/null +++ b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/ToneMappers.cpp @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2023 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: LGPL-2.1-or-later + * See LICENSES/README.md for more information. + */ + +#include "ToneMappers.h" + +float CToneMappers::GetLuminanceValue(bool hasDisplayMetadata, + const AVMasteringDisplayMetadata& displayMetadata, + bool hasLightMetadata, + const AVContentLightMetadata& lightMetadata) +{ + // default for bad quality HDR-PQ sources (missing or invalid metadata) + const float defaultLuminance = 400.0f; + float lum1 = defaultLuminance; + + unsigned int maxLuminance = static_cast<unsigned int>(defaultLuminance); + + if (hasDisplayMetadata && displayMetadata.has_luminance && displayMetadata.max_luminance.den) + { + const uint16_t lum = displayMetadata.max_luminance.num / displayMetadata.max_luminance.den; + + if (lum > 0) + maxLuminance = lum; + } + + if (hasLightMetadata) + { + float lum2; + + if (lightMetadata.MaxCLL >= maxLuminance) + { + lum1 = static_cast<float>(maxLuminance); + lum2 = static_cast<float>(lightMetadata.MaxCLL); + } + else + { + lum1 = static_cast<float>(lightMetadata.MaxCLL); + lum2 = static_cast<float>(maxLuminance); + } + const float lum3 = static_cast<float>(lightMetadata.MaxFALL); + + lum1 = (lum1 * 0.5f) + (lum2 * 0.2f) + (lum3 * 0.3f); + } + else if (hasDisplayMetadata && displayMetadata.has_luminance) + { + lum1 = static_cast<float>(maxLuminance); + } + + return lum1; +} diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/ToneMappers.h b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/ToneMappers.h new file mode 100644 index 0000000000..0d668838cb --- /dev/null +++ b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/ToneMappers.h @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2023 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: LGPL-2.1-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +extern "C" +{ +#include <libavutil/mastering_display_metadata.h> +} + +class CToneMappers +{ +public: + static float GetLuminanceValue(bool hasDisplayMetadata, + const AVMasteringDisplayMetadata& displayMetadata, + bool hasLightMetadata, + const AVContentLightMetadata& lightMetadata); +}; diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/WinVideoFilter.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/WinVideoFilter.cpp index 83f146b248..e68976ca9c 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/WinVideoFilter.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/WinVideoFilter.cpp @@ -9,6 +9,7 @@ #include "WinVideoFilter.h" #include "ConvolutionKernels.h" +#include "ToneMappers.h" #include "Util.h" #include "VideoRenderers/windows/RendererBase.h" #include "cores/VideoPlayer/VideoRenderers/VideoShaders/dither.h" @@ -206,53 +207,24 @@ void COutputShader::ApplyEffectParameters(CD3DEffect &effect, unsigned sourceWid } else if (m_toneMapping && m_toneMappingMethod == VS_TONEMAPMETHOD_ACES) { - float lumin = GetLuminanceValue(); + const float lumin = CToneMappers::GetLuminanceValue(m_hasDisplayMetadata, m_displayMetadata, + m_hasLightMetadata, m_lightMetadata); effect.SetScalar("g_luminance", lumin); effect.SetScalar("g_toneP1", m_toneMappingParam); m_toneMappingDebug = lumin; } else if (m_toneMapping && m_toneMappingMethod == VS_TONEMAPMETHOD_HABLE) { - float lumin = GetLuminanceValue(); - float lumin_factor = (10000.0f / lumin) * (2.0f / m_toneMappingParam); - float lumin_div100 = lumin / (100.0f * m_toneMappingParam); + const float lumin = CToneMappers::GetLuminanceValue(m_hasDisplayMetadata, m_displayMetadata, + m_hasLightMetadata, m_lightMetadata); + const float lumin_factor = (10000.0f / lumin) * (2.0f / m_toneMappingParam); + const float lumin_div100 = lumin / (100.0f * m_toneMappingParam); effect.SetScalar("g_toneP1", lumin_factor); effect.SetScalar("g_toneP2", lumin_div100); m_toneMappingDebug = lumin; } } -float COutputShader::GetLuminanceValue() const -{ - float lum1 = 400.0f; // default for bad quality HDR-PQ sources (with no metadata) - float lum2 = lum1; - float lum3 = lum1; - - if (m_hasLightMetadata) - { - uint16_t lum = m_displayMetadata.max_luminance.num / m_displayMetadata.max_luminance.den; - if (m_lightMetadata.MaxCLL >= lum) - { - lum1 = static_cast<float>(lum); - lum2 = static_cast<float>(m_lightMetadata.MaxCLL); - } - else - { - lum1 = static_cast<float>(m_lightMetadata.MaxCLL); - lum2 = static_cast<float>(lum); - } - lum3 = static_cast<float>(m_lightMetadata.MaxFALL); - lum1 = (lum1 * 0.5f) + (lum2 * 0.2f) + (lum3 * 0.3f); - } - else if (m_hasDisplayMetadata && m_displayMetadata.has_luminance) - { - uint16_t lum = m_displayMetadata.max_luminance.num / m_displayMetadata.max_luminance.den; - lum1 = static_cast<float>(lum); - } - - return lum1; -} - void COutputShader::GetDefines(DefinesMap& map) const { if (m_useLut) diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/WinVideoFilter.h b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/WinVideoFilter.h index de901afcc1..d559dda519 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/WinVideoFilter.h +++ b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/WinVideoFilter.h @@ -91,7 +91,6 @@ private: void PrepareParameters(unsigned sourceWidth, unsigned sourceHeight, CRect sourceRect, const CPoint points[4]); void SetShaderParameters(CD3DTexture &sourceTexture, unsigned range, float contrast, float brightness); void CreateDitherView(); - float GetLuminanceValue() const; bool m_useLut = false; bool m_useDithering = false; diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShaderGL.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShaderGL.cpp index 4491ad2464..e9ff471f3d 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShaderGL.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShaderGL.cpp @@ -12,6 +12,7 @@ #include "../RenderFlags.h" #include "ConvolutionKernels.h" #include "ServiceBroker.h" +#include "ToneMappers.h" #include "settings/AdvancedSettings.h" #include "settings/SettingsComponent.h" #include "utils/GLUtils.h" @@ -192,13 +193,16 @@ bool BaseYUV2RGBGLSLShader::OnEnabled() } else if (m_toneMappingMethod == VS_TONEMAPMETHOD_ACES) { - glUniform1f(m_hLuminance, GetLuminanceValue()); + const float lumin = CToneMappers::GetLuminanceValue(m_hasDisplayMetadata, m_displayMetadata, + m_hasLightMetadata, m_lightMetadata); + glUniform1f(m_hLuminance, lumin); glUniform1f(m_hToneP1, m_toneMappingParam); } else if (m_toneMappingMethod == VS_TONEMAPMETHOD_HABLE) { - float lumin = GetLuminanceValue(); - float param = (10000.0f / lumin) * (2.0f / m_toneMappingParam); + const float lumin = CToneMappers::GetLuminanceValue(m_hasDisplayMetadata, m_displayMetadata, + m_hasLightMetadata, m_lightMetadata); + const float param = (10000.0f / lumin) * (2.0f / m_toneMappingParam); glUniform1f(m_hLuminance, lumin); glUniform1f(m_hToneP1, param); } @@ -256,38 +260,6 @@ void BaseYUV2RGBGLSLShader::SetToneMapParam(ETONEMAPMETHOD method, float param) m_toneMappingParam = param; } -float BaseYUV2RGBGLSLShader::GetLuminanceValue() const //Maybe move this to linuxrenderer?! same as in baserenderer -{ - float lum1 = 400.0f; // default for bad quality HDR-PQ sources (with no metadata) - float lum2 = lum1; - float lum3 = lum1; - - if (m_hasLightMetadata) - { - uint16_t lum = m_displayMetadata.max_luminance.num / m_displayMetadata.max_luminance.den; - if (m_lightMetadata.MaxCLL >= lum) - { - lum1 = static_cast<float>(lum); - lum2 = static_cast<float>(m_lightMetadata.MaxCLL); - } - else - { - lum1 = static_cast<float>(m_lightMetadata.MaxCLL); - lum2 = static_cast<float>(lum); - } - lum3 = static_cast<float>(m_lightMetadata.MaxFALL); - lum1 = (lum1 * 0.5f) + (lum2 * 0.2f) + (lum3 * 0.3f); - } - else if (m_hasDisplayMetadata && m_displayMetadata.has_luminance && - m_displayMetadata.max_luminance.num) - { - uint16_t lum = m_displayMetadata.max_luminance.num / m_displayMetadata.max_luminance.den; - lum1 = static_cast<float>(lum); - } - - return lum1; -} - ////////////////////////////////////////////////////////////////////// // YUV2RGBProgressiveShader - YUV2RGB with no deinterlacing // Use for weave deinterlacing / progressive diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShaderGL.h b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShaderGL.h index 18e10faf91..6604291049 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShaderGL.h +++ b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShaderGL.h @@ -54,7 +54,6 @@ public: bool hasLightMetadata, AVContentLightMetadata lightMetadata); void SetToneMapParam(ETONEMAPMETHOD method, float param); - float GetLuminanceValue() const; void SetConvertFullColorRange(bool convertFullRange) { m_convertFullRange = convertFullRange; } diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShaderGLES.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShaderGLES.cpp index 4682a3db1a..63e4d304a4 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShaderGLES.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShaderGLES.cpp @@ -10,6 +10,7 @@ #include "YUV2RGBShaderGLES.h" #include "../RenderFlags.h" +#include "ToneMappers.h" #include "settings/AdvancedSettings.h" #include "utils/GLUtils.h" #include "utils/log.h" @@ -158,13 +159,16 @@ bool BaseYUV2RGBGLSLShader::OnEnabled() } else if (m_toneMappingMethod == VS_TONEMAPMETHOD_ACES) { - glUniform1f(m_hLuminance, GetLuminanceValue()); + const float lumin = CToneMappers::GetLuminanceValue(m_hasDisplayMetadata, m_displayMetadata, + m_hasLightMetadata, m_lightMetadata); + glUniform1f(m_hLuminance, lumin); glUniform1f(m_hToneP1, m_toneMappingParam); } else if (m_toneMappingMethod == VS_TONEMAPMETHOD_HABLE) { - float lumin = GetLuminanceValue(); - float param = (10000.0f / lumin) * (2.0f / m_toneMappingParam); + const float lumin = CToneMappers::GetLuminanceValue(m_hasDisplayMetadata, m_displayMetadata, + m_hasLightMetadata, m_lightMetadata); + const float param = (10000.0f / lumin) * (2.0f / m_toneMappingParam); glUniform1f(m_hLuminance, lumin); glUniform1f(m_hToneP1, param); } @@ -211,38 +215,6 @@ void BaseYUV2RGBGLSLShader::SetDisplayMetadata(bool hasDisplayMetadata, m_lightMetadata = lightMetadata; } -float BaseYUV2RGBGLSLShader::GetLuminanceValue() const -{ - float lum1 = 400.0f; // default for bad quality HDR-PQ sources (with no metadata) - float lum2 = lum1; - float lum3 = lum1; - - if (m_hasLightMetadata) - { - uint16_t lum = m_displayMetadata.max_luminance.num / m_displayMetadata.max_luminance.den; - if (m_lightMetadata.MaxCLL >= lum) - { - lum1 = static_cast<float>(lum); - lum2 = static_cast<float>(m_lightMetadata.MaxCLL); - } - else - { - lum1 = static_cast<float>(m_lightMetadata.MaxCLL); - lum2 = static_cast<float>(lum); - } - lum3 = static_cast<float>(m_lightMetadata.MaxFALL); - lum1 = (lum1 * 0.5f) + (lum2 * 0.2f) + (lum3 * 0.3f); - } - else if (m_hasDisplayMetadata && m_displayMetadata.has_luminance && - m_displayMetadata.max_luminance.num > 0) - { - uint16_t lum = m_displayMetadata.max_luminance.num / m_displayMetadata.max_luminance.den; - lum1 = static_cast<float>(lum); - } - - return lum1; -} - ////////////////////////////////////////////////////////////////////// // YUV2RGBProgressiveShader - YUV2RGB with no deinterlacing // Use for weave deinterlacing / progressive diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShaderGLES.h b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShaderGLES.h index df369f518f..44b1a8221a 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShaderGLES.h +++ b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/YUV2RGBShaderGLES.h @@ -45,7 +45,6 @@ class BaseYUV2RGBGLSLShader : public CGLSLShaderProgram bool hasLightMetadata, AVContentLightMetadata lightMetadata); void SetToneMapParam(float param) { m_toneMappingParam = param; } - float GetLuminanceValue() const; GLint GetVertexLoc() { return m_hVertex; } GLint GetYcoordLoc() { return m_hYcoord; } diff --git a/xbmc/video/VideoInfoScanner.cpp b/xbmc/video/VideoInfoScanner.cpp index 835d9e8618..8f6b18849d 100644 --- a/xbmc/video/VideoInfoScanner.cpp +++ b/xbmc/video/VideoInfoScanner.cpp @@ -501,11 +501,16 @@ namespace VIDEO auto eventLog = CServiceBroker::GetEventLog(); if (eventLog) + { + const std::string itemlogpath = (info2->Content() == CONTENT_TVSHOWS) + ? CURL::GetRedacted(pItem->GetPath()) + : URIUtils::GetFileName(pItem->GetPath()); + eventLog->Add(EventPtr(new CMediaLibraryEvent( mediaType, pItem->GetPath(), 24145, - StringUtils::Format(g_localizeStrings.Get(24147), mediaType, - URIUtils::GetFileName(pItem->GetPath())), - pItem->GetArt("thumb"), CURL::GetRedacted(pItem->GetPath()), EventLevel::Warning))); + StringUtils::Format(g_localizeStrings.Get(24147), mediaType, itemlogpath), + EventLevel::Warning))); + } } pURL = NULL; |