forked from LibreELEC/LibreELEC.tv
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generic: new device BT2020 with patches from HDR on x86 Hardware thread
- Loading branch information
Showing
4 changed files
with
123 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../gbm/options |
96 changes: 96 additions & 0 deletions
96
...s/Generic-BT2020/patches/kodi/0001-CWinSystemGbm-add-colourspace-connector-property.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
From c51dc4b07dbcbbe49ae0cf24b4fba2079ca63425 Mon Sep 17 00:00:00 2001 | ||
From: Lukas Rusak <lorusak@gmail.com> | ||
Date: Thu, 16 Sep 2021 16:39:36 -0700 | ||
Subject: [PATCH] CWinSystemGbm: add colourspace connector property | ||
|
||
--- | ||
.../Buffers/VideoBufferDRMPRIME.cpp | 12 ++++++++ | ||
.../VideoPlayer/Buffers/VideoBufferDRMPRIME.h | 1 + | ||
xbmc/windowing/gbm/WinSystemGbm.cpp | 30 +++++++++++++++++-- | ||
3 files changed, 41 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/xbmc/cores/VideoPlayer/Buffers/VideoBufferDRMPRIME.cpp b/xbmc/cores/VideoPlayer/Buffers/VideoBufferDRMPRIME.cpp | ||
index b1c23ffc3dc55..a5fb7ddf44d72 100644 | ||
--- a/xbmc/cores/VideoPlayer/Buffers/VideoBufferDRMPRIME.cpp | ||
+++ b/xbmc/cores/VideoPlayer/Buffers/VideoBufferDRMPRIME.cpp | ||
@@ -20,6 +20,18 @@ extern "C" | ||
namespace DRMPRIME | ||
{ | ||
|
||
+std::string GetColorimetry(const VideoPicture& picture) | ||
+{ | ||
+ switch (picture.color_space) | ||
+ { | ||
+ case AVCOL_SPC_BT2020_CL: | ||
+ case AVCOL_SPC_BT2020_NCL: | ||
+ return "BT2020_RGB"; | ||
+ } | ||
+ | ||
+ return "Default"; | ||
+} | ||
+ | ||
std::string GetColorEncoding(const VideoPicture& picture) | ||
{ | ||
switch (picture.color_space) | ||
diff --git a/xbmc/cores/VideoPlayer/Buffers/VideoBufferDRMPRIME.h b/xbmc/cores/VideoPlayer/Buffers/VideoBufferDRMPRIME.h | ||
index e77f75b58bff4..4de9732308caa 100644 | ||
--- a/xbmc/cores/VideoPlayer/Buffers/VideoBufferDRMPRIME.h | ||
+++ b/xbmc/cores/VideoPlayer/Buffers/VideoBufferDRMPRIME.h | ||
@@ -34,6 +34,7 @@ enum hdmi_eotf | ||
HDMI_EOTF_BT_2100_HLG, | ||
}; | ||
|
||
+std::string GetColorimetry(const VideoPicture& picture); | ||
std::string GetColorEncoding(const VideoPicture& picture); | ||
std::string GetColorRange(const VideoPicture& picture); | ||
uint8_t GetEOTF(const VideoPicture& picture); | ||
diff --git a/xbmc/windowing/gbm/WinSystemGbm.cpp b/xbmc/windowing/gbm/WinSystemGbm.cpp | ||
index 4fd2da4ca8d57..3fc778ed4b77c 100644 | ||
--- a/xbmc/windowing/gbm/WinSystemGbm.cpp | ||
+++ b/xbmc/windowing/gbm/WinSystemGbm.cpp | ||
@@ -330,9 +330,23 @@ bool CWinSystemGbm::SetHDR(const VideoPicture* videoPicture) | ||
if (!drm) | ||
return false; | ||
|
||
+ auto connector = drm->GetConnector(); | ||
+ if (!connector) | ||
+ return false; | ||
+ | ||
if (!videoPicture) | ||
{ | ||
- auto connector = drm->GetConnector(); | ||
+ if (connector->SupportsProperty("Colorspace")) | ||
+ { | ||
+ auto [result, value] = connector->GetPropertyValue("Colorspace", "Default"); | ||
+ if (result) | ||
+ { | ||
+ CLog::Log(LOGDEBUG, "CWinSystemGbm::{} - setting connector colorspace to Default", | ||
+ __FUNCTION__); | ||
+ drm->AddProperty(connector, "Colorspace", value); | ||
+ } | ||
+ } | ||
+ | ||
if (connector->SupportsProperty("HDR_OUTPUT_METADATA")) | ||
{ | ||
drm->AddProperty(connector, "HDR_OUTPUT_METADATA", 0); | ||
@@ -346,7 +360,19 @@ bool CWinSystemGbm::SetHDR(const VideoPicture* videoPicture) | ||
return true; | ||
} | ||
|
||
- auto connector = drm->GetConnector(); | ||
+ if (connector->SupportsProperty("Colorspace")) | ||
+ { | ||
+ auto [result, value] = | ||
+ connector->GetPropertyValue("Colorspace", DRMPRIME::GetColorimetry(*videoPicture)); | ||
+ if (result) | ||
+ { | ||
+ CLog::Log(LOGDEBUG, "CWinSystemGbm::{} - setting connector colorspace to {}", __FUNCTION__, | ||
+ DRMPRIME::GetColorimetry(*videoPicture)); | ||
+ drm->AddProperty(connector, "Colorspace", value); | ||
+ drm->SetActive(true); | ||
+ } | ||
+ } | ||
+ | ||
if (connector->SupportsProperty("HDR_OUTPUT_METADATA")) | ||
{ | ||
hdr_output_metadata hdr_metadata = {}; |
25 changes: 25 additions & 0 deletions
25
projects/Generic/devices/Generic-BT2020/patches/kodi/0002-kodi-200.01-video_clear.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From 3ac2b8d4ff6741d29bb73a7874f1fda6a0c660b5 Mon Sep 17 00:00:00 2001 | ||
From: sarbes <sarbes@kodi.tv> | ||
Date: Sun, 12 Mar 2023 13:48:45 +0100 | ||
Subject: [PATCH] Force screen clear when playing a video on GLES | ||
|
||
--- | ||
xbmc/video/windows/GUIWindowFullScreen.cpp | 2 ++ | ||
1 file changed, 2 insertions(+) | ||
|
||
diff --git a/xbmc/video/windows/GUIWindowFullScreen.cpp b/xbmc/video/windows/GUIWindowFullScreen.cpp | ||
index 7cebc5fa07..7e139fd22b 100644 | ||
--- a/xbmc/video/windows/GUIWindowFullScreen.cpp | ||
+++ b/xbmc/video/windows/GUIWindowFullScreen.cpp | ||
@@ -180,6 +180,8 @@ void CGUIWindowFullScreen::ClearBackground() | ||
const auto appPlayer = components.GetComponent<CApplicationPlayer>(); | ||
if (appPlayer->IsRenderingVideoLayer()) | ||
CServiceBroker::GetWinSystem()->GetGfxContext().Clear(0); | ||
+ else | ||
+ CServiceBroker::GetWinSystem()->GetGfxContext().Clear(0xff000000); | ||
} | ||
|
||
void CGUIWindowFullScreen::OnWindowLoaded() | ||
-- | ||
2.39.2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters