Skip to content

Commit

Permalink
RPi: update kodi patches
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Reichl <hias@horus.com>
  • Loading branch information
HiassofT committed Dec 18, 2024
1 parent 2fa9b16 commit 442673d
Show file tree
Hide file tree
Showing 12 changed files with 107 additions and 82 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 89a7f05ee85fca27f1140a035fec804d84959dbe Mon Sep 17 00:00:00 2001
From 2875c98a194df2251715a6b48118cc1734b8d663 Mon Sep 17 00:00:00 2001
From: Dom Cobley <popcornmix@gmail.com>
Date: Fri, 3 Dec 2021 16:00:50 +0000
Subject: [PATCH 01/12] gbm: Set max bpc for high bit depth videos
Expand All @@ -8,7 +8,7 @@ Subject: [PATCH 01/12] gbm: Set max bpc for high bit depth videos
1 file changed, 15 insertions(+)

diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp
index 233e6310bb..9b36758c00 100644
index 34d1ab623559..f1e73ee36474 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp
@@ -34,6 +34,14 @@ void CVideoLayerBridgeDRMPRIME::Disable()
Expand Down Expand Up @@ -41,5 +41,5 @@ index 233e6310bb..9b36758c00 100644

void CVideoLayerBridgeDRMPRIME::SetVideoPlane(CVideoBufferDRMPRIME* buffer, const CRect& destRect)
--
2.39.2
2.39.5

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 7d18280622c8ac12dbf1f6d4d5ca9589e1a61b02 Mon Sep 17 00:00:00 2001
From b7c319601e58efaf840360dfa2452d7621748528 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Sat, 11 Sep 2021 14:03:05 +0100
Subject: [PATCH 02/12] CDVDVideoCodecDRMPRIME: Also support YUV420 buffers
Expand All @@ -11,10 +11,10 @@ Need to call SetDimensions earlier and store the drm descriptor in expected plac
1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
index f5e26b203c..90f1fb07a9 100644
index 3a5154dca4b4..2fc8232e8672 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
@@ -622,7 +622,7 @@ bool CDVDVideoCodecDRMPRIME::SetPictureParams(VideoPicture* pVideoPicture)
@@ -623,7 +623,7 @@ bool CDVDVideoCodecDRMPRIME::SetPictureParams(VideoPicture* pVideoPicture)
pVideoPicture->videoBuffer = nullptr;
}

Expand All @@ -23,7 +23,7 @@ index f5e26b203c..90f1fb07a9 100644
{
CVideoBufferDRMPRIMEFFmpeg* buffer =
dynamic_cast<CVideoBufferDRMPRIMEFFmpeg*>(m_videoBufferPool->Get());
@@ -700,7 +700,7 @@ bool CDVDVideoCodecDRMPRIME::FilterOpen(const std::string& filters, bool test)
@@ -701,7 +701,7 @@ bool CDVDVideoCodecDRMPRIME::FilterOpen(const std::string& filters, bool test)

const AVFilter* srcFilter = avfilter_get_by_name("buffer");
const AVFilter* outFilter = avfilter_get_by_name("buffersink");
Expand All @@ -32,7 +32,7 @@ index f5e26b203c..90f1fb07a9 100644

std::string args = StringUtils::Format("video_size={}x{}:pix_fmt={}:time_base={}/{}:"
"pixel_aspect={}/{}",
@@ -848,6 +848,16 @@ void CDVDVideoCodecDRMPRIME::FilterClose()
@@ -849,6 +849,16 @@ void CDVDVideoCodecDRMPRIME::FilterClose()

CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::ProcessFilterIn()
{
Expand All @@ -50,5 +50,5 @@ index f5e26b203c..90f1fb07a9 100644
if (ret < 0)
{
--
2.39.2
2.39.5

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From e36845fd7e48b364f68a43bd8c66e06a570a6f4c Mon Sep 17 00:00:00 2001
From 158bd0c5d0feafd6ea38f618075de1be74dfe52c Mon Sep 17 00:00:00 2001
From: Dom Cobley <popcornmix@gmail.com>
Date: Wed, 18 Jan 2023 16:41:00 +0000
Subject: [PATCH 03/12] CDVDVideoCodecDRMPRIME: Adjust av formats to match
Expand All @@ -9,7 +9,7 @@ Subject: [PATCH 03/12] CDVDVideoCodecDRMPRIME: Adjust av formats to match
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
index 90f1fb07a9..169e8544de 100644
index 2fc8232e8672..088f43834731 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
@@ -355,6 +355,7 @@ bool CDVDVideoCodecDRMPRIME::Open(CDVDStreamInfo& hints, CDVDCodecOptions& optio
Expand All @@ -20,7 +20,7 @@ index 90f1fb07a9..169e8544de 100644
m_pCodecContext->thread_count = CServiceBroker::GetCPUInfo()->GetCPUCount();

if (hints.extradata)
@@ -700,13 +701,13 @@ bool CDVDVideoCodecDRMPRIME::FilterOpen(const std::string& filters, bool test)
@@ -701,13 +702,13 @@ bool CDVDVideoCodecDRMPRIME::FilterOpen(const std::string& filters, bool test)

const AVFilter* srcFilter = avfilter_get_by_name("buffer");
const AVFilter* outFilter = avfilter_get_by_name("buffersink");
Expand All @@ -36,7 +36,7 @@ index 90f1fb07a9..169e8544de 100644
m_pCodecContext->time_base.num ?
m_pCodecContext->time_base.num : 1,
m_pCodecContext->time_base.num ?
@@ -858,6 +859,7 @@ CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::ProcessFilterIn()
@@ -859,6 +860,7 @@ CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::ProcessFilterIn()
m_pFrame->data[0] = reinterpret_cast<uint8_t*>(descriptor);
}

Expand All @@ -45,5 +45,5 @@ index 90f1fb07a9..169e8544de 100644
if (ret < 0)
{
--
2.39.2
2.39.5

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 092ae2d56a5b8ed1558e82c2beae6e4223df57ff Mon Sep 17 00:00:00 2001
From 2af0398b5aec2318c6b2c1418fc0f303047863d8 Mon Sep 17 00:00:00 2001
From: Dom Cobley <popcornmix@gmail.com>
Date: Mon, 6 Feb 2023 15:19:51 +0000
Subject: [PATCH 04/12] DVDVideoCodecDRMPRIME: Add support for arbitrary output
Expand All @@ -20,7 +20,7 @@ And it happens automatically without requiring user video settings
2 files changed, 77 insertions(+), 50 deletions(-)

diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
index 169e8544de..28bd0a9bc7 100644
index 088f43834731..a8edd55c92c5 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
@@ -219,7 +219,7 @@ enum AVPixelFormat CDVDVideoCodecDRMPRIME::GetFormat(struct AVCodecContext* avct
Expand Down Expand Up @@ -67,7 +67,7 @@ index 169e8544de..28bd0a9bc7 100644

buffer->Export(frame, width, height);
buffer->SyncStart();
@@ -631,9 +631,9 @@ bool CDVDVideoCodecDRMPRIME::SetPictureParams(VideoPicture* pVideoPicture)
@@ -632,9 +632,9 @@ bool CDVDVideoCodecDRMPRIME::SetPictureParams(VideoPicture* pVideoPicture)
buffer->SetRef(m_pFrame);
pVideoPicture->videoBuffer = buffer;
}
Expand All @@ -79,7 +79,7 @@ index 169e8544de..28bd0a9bc7 100644
buffer->SetPictureParams(*pVideoPicture);
buffer->Acquire();
buffer->SyncEnd();
@@ -667,13 +667,13 @@ void CDVDVideoCodecDRMPRIME::FilterTest()
@@ -668,13 +668,13 @@ void CDVDVideoCodecDRMPRIME::FilterTest()

if (name.find("deinterlace") != std::string::npos)
{
Expand All @@ -96,7 +96,7 @@ index 169e8544de..28bd0a9bc7 100644
return;
}
}
@@ -683,14 +683,31 @@ void CDVDVideoCodecDRMPRIME::FilterTest()
@@ -684,14 +684,31 @@ void CDVDVideoCodecDRMPRIME::FilterTest()
__FUNCTION__);
}

Expand Down Expand Up @@ -130,7 +130,7 @@ index 169e8544de..28bd0a9bc7 100644
return true;

if (!(m_pFilterGraph = avfilter_graph_alloc()))
@@ -701,13 +718,13 @@ bool CDVDVideoCodecDRMPRIME::FilterOpen(const std::string& filters, bool test)
@@ -702,13 +719,13 @@ bool CDVDVideoCodecDRMPRIME::FilterOpen(const std::string& filters, bool test)

const AVFilter* srcFilter = avfilter_get_by_name("buffer");
const AVFilter* outFilter = avfilter_get_by_name("buffersink");
Expand All @@ -146,39 +146,39 @@ index 169e8544de..28bd0a9bc7 100644
m_pCodecContext->time_base.num ?
m_pCodecContext->time_base.num : 1,
m_pCodecContext->time_base.num ?
@@ -726,7 +743,6 @@ bool CDVDVideoCodecDRMPRIME::FilterOpen(const std::string& filters, bool test)
@@ -727,7 +744,6 @@ bool CDVDVideoCodecDRMPRIME::FilterOpen(const std::string& filters, bool test)
CLog::Log(LOGERROR,
"CDVDVideoCodecDRMPRIME::FilterOpen - avfilter_graph_create_filter: src: {} ({})",
err, result);
- FilterClose();
return false;
}

@@ -734,7 +750,6 @@ bool CDVDVideoCodecDRMPRIME::FilterOpen(const std::string& filters, bool test)
@@ -735,7 +751,6 @@ bool CDVDVideoCodecDRMPRIME::FilterOpen(const std::string& filters, bool test)
if (!par)
{
CLog::Log(LOGERROR, "CDVDVideoCodecDRMPRIME::FilterOpen - unable to alloc buffersrc");
- FilterClose();
return false;
}

@@ -750,7 +765,6 @@ bool CDVDVideoCodecDRMPRIME::FilterOpen(const std::string& filters, bool test)
@@ -751,7 +766,6 @@ bool CDVDVideoCodecDRMPRIME::FilterOpen(const std::string& filters, bool test)
CLog::Log(LOGERROR,
"CDVDVideoCodecDRMPRIME::FilterOpen - av_buffersrc_parameters_set: {} ({})",
err, result);
- FilterClose();
return false;
}
av_freep(&par);
@@ -764,7 +778,6 @@ bool CDVDVideoCodecDRMPRIME::FilterOpen(const std::string& filters, bool test)
@@ -765,7 +779,6 @@ bool CDVDVideoCodecDRMPRIME::FilterOpen(const std::string& filters, bool test)
CLog::Log(LOGERROR,
"CDVDVideoCodecDRMPRIME::FilterOpen - avfilter_graph_create_filter: out: {} ({})",
err, result);
- FilterClose();
return false;
}

@@ -773,32 +786,46 @@ bool CDVDVideoCodecDRMPRIME::FilterOpen(const std::string& filters, bool test)
@@ -774,32 +787,46 @@ bool CDVDVideoCodecDRMPRIME::FilterOpen(const std::string& filters, bool test)
if (result < 0)
{
CLog::Log(LOGERROR, "CDVDVideoCodecDRMPRIME::FilterOpen - failed settings pix formats");
Expand Down Expand Up @@ -243,7 +243,7 @@ index 169e8544de..28bd0a9bc7 100644
}

if ((result = avfilter_graph_config(m_pFilterGraph, nullptr)) < 0)
@@ -807,15 +834,11 @@ bool CDVDVideoCodecDRMPRIME::FilterOpen(const std::string& filters, bool test)
@@ -808,15 +835,11 @@ bool CDVDVideoCodecDRMPRIME::FilterOpen(const std::string& filters, bool test)
av_strerror(result, err, AV_ERROR_MAX_STRING_SIZE);
CLog::Log(LOGERROR, "CDVDVideoCodecDRMPRIME::FilterOpen - avfilter_graph_config: {} ({})",
err, result);
Expand All @@ -259,7 +259,7 @@ index 169e8544de..28bd0a9bc7 100644

m_processInfo.SetVideoDeintMethod(filters);

@@ -850,16 +873,16 @@ void CDVDVideoCodecDRMPRIME::FilterClose()
@@ -851,16 +874,16 @@ void CDVDVideoCodecDRMPRIME::FilterClose()
CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::ProcessFilterIn()
{
// sw decoded buffers need cache flush and for descripter to be set
Expand All @@ -279,17 +279,17 @@ index 169e8544de..28bd0a9bc7 100644
int ret = av_buffersrc_add_frame(m_pFilterIn, m_pFrame);
if (ret < 0)
{
@@ -960,25 +983,28 @@ CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::GetPicture(VideoPicture* pVideo
@@ -961,25 +984,28 @@ CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::GetPicture(VideoPicture* pVideo
return VC_ERROR;
}

+ // we need to scale if the buffer isn't in DRM_PRIME format
+ bool need_scale = !IsSupportedSwFormat(static_cast<AVPixelFormat>(m_pFrame->format)) && !IsSupportedHwFormat(static_cast<AVPixelFormat>(m_pFrame->format));
+
if (!m_processInfo.GetVideoInterlaced() && m_pFrame->interlaced_frame)
if (!m_processInfo.GetVideoInterlaced() && !!(m_pFrame->flags & AV_FRAME_FLAG_INTERLACED))
m_processInfo.SetVideoInterlaced(true);

std::string filterChain = GetFilterChain(m_pFrame->interlaced_frame);
std::string filterChain = GetFilterChain(!!(m_pFrame->flags & AV_FRAME_FLAG_INTERLACED));
- if (!filterChain.empty())
+ if (!filterChain.empty() || need_scale)
{
Expand All @@ -314,7 +314,7 @@ index 169e8544de..28bd0a9bc7 100644
}

diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.h
index fab3431d40..bb88fde1f9 100644
index fab3431d40d9..bb88fde1f924 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.h
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.h
@@ -44,7 +44,8 @@ protected:
Expand All @@ -328,5 +328,5 @@ index fab3431d40..bb88fde1f9 100644
void FilterTest();
std::string GetFilterChain(bool interlaced);
--
2.39.2
2.39.5

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 4a3cb2af8b0751807d212044ba424d07f2a7ba55 Mon Sep 17 00:00:00 2001
From 360f3a694cfeac822b5263f2d006e47d68801148 Mon Sep 17 00:00:00 2001
From: Dom Cobley <popcornmix@gmail.com>
Date: Fri, 14 Apr 2023 19:59:42 +0100
Subject: [PATCH 05/12] DVDVideoCodecDRMPRIME: Remove obsolete
Expand All @@ -9,7 +9,7 @@ Subject: [PATCH 05/12] DVDVideoCodecDRMPRIME: Remove obsolete
1 file changed, 1 deletion(-)

diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
index 28bd0a9bc7..670b5f22ce 100644
index a8edd55c92c5..f64e2ff8dfb2 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
@@ -355,7 +355,6 @@ bool CDVDVideoCodecDRMPRIME::Open(CDVDStreamInfo& hints, CDVDCodecOptions& optio
Expand All @@ -21,5 +21,5 @@ index 28bd0a9bc7..670b5f22ce 100644

if (hints.extradata)
--
2.39.2
2.39.5

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 018e080fb3fea185df01d2659d59231aef787759 Mon Sep 17 00:00:00 2001
From b551c28a08d24450c6b8afa4e29f61323f9ba934 Mon Sep 17 00:00:00 2001
From: Dom Cobley <popcornmix@gmail.com>
Date: Wed, 31 May 2023 19:40:37 +0100
Subject: [PATCH 06/12] DVDVideoCodecDRMPRIME: Clear m_pFilterGraph
Expand All @@ -8,10 +8,10 @@ Subject: [PATCH 06/12] DVDVideoCodecDRMPRIME: Clear m_pFilterGraph
1 file changed, 1 insertion(+)

diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
index 670b5f22ce..8568f162ae 100644
index f64e2ff8dfb2..31c28477cb58 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
@@ -866,6 +866,7 @@ void CDVDVideoCodecDRMPRIME::FilterClose()
@@ -867,6 +867,7 @@ void CDVDVideoCodecDRMPRIME::FilterClose()
// Disposed by above code
m_pFilterIn = nullptr;
m_pFilterOut = nullptr;
Expand All @@ -20,5 +20,5 @@ index 670b5f22ce..8568f162ae 100644
}

--
2.39.2
2.39.5

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From b62d5e56d76ce179e3a1169566aa2146da48b147 Mon Sep 17 00:00:00 2001
From 9bad0c6121a228501c3cef5dd753a43d4ccb9994 Mon Sep 17 00:00:00 2001
From: Dom Cobley <popcornmix@gmail.com>
Date: Fri, 2 Jun 2023 11:34:22 +0100
Subject: [PATCH 07/12] DVDVideoCodecDRMPRIME: Move FilterTest from open to
Expand All @@ -12,7 +12,7 @@ and it may (later) influence the choice of deinterlacers available.
2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
index 8568f162ae..f515c5d5f1 100644
index 31c28477cb58..a05ae3ff89e8 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
@@ -387,15 +387,7 @@ bool CDVDVideoCodecDRMPRIME::Open(CDVDStreamInfo& hints, CDVDCodecOptions& optio
Expand All @@ -32,7 +32,7 @@ index 8568f162ae..f515c5d5f1 100644

return true;
}
@@ -983,6 +975,20 @@ CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::GetPicture(VideoPicture* pVideo
@@ -984,6 +976,20 @@ CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::GetPicture(VideoPicture* pVideo
return VC_ERROR;
}

Expand All @@ -54,7 +54,7 @@ index 8568f162ae..f515c5d5f1 100644
bool need_scale = !IsSupportedSwFormat(static_cast<AVPixelFormat>(m_pFrame->format)) && !IsSupportedHwFormat(static_cast<AVPixelFormat>(m_pFrame->format));

diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.h
index bb88fde1f9..df17f89b96 100644
index bb88fde1f924..df17f89b964c 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.h
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.h
@@ -56,6 +56,7 @@ protected:
Expand All @@ -66,5 +66,5 @@ index bb88fde1f9..df17f89b96 100644
AVFrame* m_pFrame = nullptr;
AVFrame* m_pFilterFrame = nullptr;
--
2.39.2
2.39.5

Loading

0 comments on commit 442673d

Please sign in to comment.