mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-03 16:07:51 +00:00
Rockchip: kodi: Fix deinterlace filter patch
This commit is contained in:
parent
db018784c8
commit
4af12ebee6
@ -1,7 +1,7 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From 58f2acdc63d85eb9818d783a9a858b1ecc267fa7 Mon Sep 17 00:00:00 2001
|
||||
From: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||
Date: Thu, 26 Dec 2019 11:01:51 +0100
|
||||
Subject: [PATCH] WIP: DRMPRIME deinterlace filter
|
||||
Subject: [PATCH 2/2] WIP: DRMPRIME deinterlace filter
|
||||
|
||||
---
|
||||
.../DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp | 368 +++++++++++++++---
|
||||
@ -9,7 +9,7 @@ Subject: [PATCH] WIP: DRMPRIME deinterlace filter
|
||||
2 files changed, 322 insertions(+), 55 deletions(-)
|
||||
|
||||
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
|
||||
index 7507c12e9a..4759dde3f9 100644
|
||||
index 2b334c95d47a..1e5624e7af50 100644
|
||||
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
|
||||
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
|
||||
@@ -79,12 +79,15 @@ CDVDVideoCodecDRMPRIME::CDVDVideoCodecDRMPRIME(CProcessInfo& processInfo)
|
||||
@ -28,7 +28,7 @@ index 7507c12e9a..4759dde3f9 100644
|
||||
avcodec_free_context(&m_pCodecContext);
|
||||
}
|
||||
|
||||
@@ -341,8 +344,19 @@ bool CDVDVideoCodecDRMPRIME::Open(CDVDStreamInfo& hints, CDVDCodecOptions& optio
|
||||
@@ -330,8 +333,19 @@ bool CDVDVideoCodecDRMPRIME::Open(CDVDStreamInfo& hints, CDVDCodecOptions& optio
|
||||
}
|
||||
|
||||
UpdateProcessInfo(m_pCodecContext, m_pCodecContext->pix_fmt);
|
||||
@ -49,7 +49,7 @@ index 7507c12e9a..4759dde3f9 100644
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -405,6 +419,8 @@ void CDVDVideoCodecDRMPRIME::Reset()
|
||||
@@ -394,6 +408,8 @@ void CDVDVideoCodecDRMPRIME::Reset()
|
||||
return;
|
||||
|
||||
Drain();
|
||||
@ -58,7 +58,7 @@ index 7507c12e9a..4759dde3f9 100644
|
||||
|
||||
do
|
||||
{
|
||||
@@ -443,7 +459,7 @@ void CDVDVideoCodecDRMPRIME::Drain()
|
||||
@@ -432,7 +448,7 @@ void CDVDVideoCodecDRMPRIME::Drain()
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ index 7507c12e9a..4759dde3f9 100644
|
||||
{
|
||||
pVideoPicture->iWidth = m_pFrame->width;
|
||||
pVideoPicture->iHeight = m_pFrame->height;
|
||||
@@ -525,13 +541,232 @@ void CDVDVideoCodecDRMPRIME::SetPictureParams(VideoPicture* pVideoPicture)
|
||||
@@ -514,13 +530,232 @@ void CDVDVideoCodecDRMPRIME::SetPictureParams(VideoPicture* pVideoPicture)
|
||||
? DVD_NOPTS_VALUE
|
||||
: static_cast<double>(pts) * DVD_TIME_BASE / AV_TIME_BASE;
|
||||
pVideoPicture->dts = DVD_NOPTS_VALUE;
|
||||
@ -101,9 +101,8 @@ index 7507c12e9a..4759dde3f9 100644
|
||||
+ }
|
||||
+
|
||||
+ return true;
|
||||
}
|
||||
|
||||
-CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::ProcessFilterIn()
|
||||
+}
|
||||
+
|
||||
+void CDVDVideoCodecDRMPRIME::FilterTest()
|
||||
+{
|
||||
+ const AVFilter* filter;
|
||||
@ -153,8 +152,8 @@ index 7507c12e9a..4759dde3f9 100644
|
||||
+ const AVFilter* outFilter = avfilter_get_by_name("buffersink");
|
||||
+ enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_DRM_PRIME, AV_PIX_FMT_NONE };
|
||||
+
|
||||
+ std::string args = StringUtils::Format("video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:"
|
||||
+ "pixel_aspect=%d/%d:sws_param=flags=2",
|
||||
+ std::string args = StringUtils::Format("video_size={}x{}:pix_fmt={}:time_base={}/{}:"
|
||||
+ "pixel_aspect={}/{}",
|
||||
+ m_pCodecContext->width,
|
||||
+ m_pCodecContext->height,
|
||||
+ m_pCodecContext->pix_fmt,
|
||||
@ -249,7 +248,7 @@ index 7507c12e9a..4759dde3f9 100644
|
||||
+ {
|
||||
+ char err[AV_ERROR_MAX_STRING_SIZE] = {};
|
||||
+ av_strerror(result, err, AV_ERROR_MAX_STRING_SIZE);
|
||||
+ CLog::Log(LOGDEBUG, "CDVDVideoCodecDRMPRIME::FilterOpen - avfilter_graph_config: {} ({})",
|
||||
+ CLog::Log(LOGERROR, "CDVDVideoCodecDRMPRIME::FilterOpen - avfilter_graph_config: {} ({})",
|
||||
+ err, result);
|
||||
+ return false;
|
||||
+ }
|
||||
@ -274,7 +273,7 @@ index 7507c12e9a..4759dde3f9 100644
|
||||
+ char* graphDump = avfilter_graph_dump(m_pFilterGraph, nullptr);
|
||||
+ if (graphDump)
|
||||
+ {
|
||||
+ CLog::Log(LOGDEBUG, "CDVDVideoCodecDRMPRIME::FilterOpen - Final filter graph:\n%s",
|
||||
+ CLog::Log(LOGDEBUG, "CDVDVideoCodecDRMPRIME::FilterOpen - Final filter graph:\n{}",
|
||||
+ graphDump);
|
||||
+ av_freep(&graphDump);
|
||||
+ }
|
||||
@ -284,9 +283,7 @@ index 7507c12e9a..4759dde3f9 100644
|
||||
+}
|
||||
+
|
||||
+void CDVDVideoCodecDRMPRIME::FilterClose()
|
||||
{
|
||||
- if (!m_pFilterIn)
|
||||
- return VC_PICTURE;
|
||||
+{
|
||||
+ if (m_pFilterGraph)
|
||||
+ {
|
||||
+ CLog::Log(LOGDEBUG, LOGVIDEO, "CDVDVideoCodecDRMPRIME::FilterClose - Freeing filter graph");
|
||||
@ -296,14 +293,17 @@ index 7507c12e9a..4759dde3f9 100644
|
||||
+ m_pFilterIn = nullptr;
|
||||
+ m_pFilterOut = nullptr;
|
||||
+ }
|
||||
+}
|
||||
}
|
||||
|
||||
+CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::ProcessFilterIn()
|
||||
+{
|
||||
CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::ProcessFilterIn()
|
||||
{
|
||||
- if (!m_pFilterIn)
|
||||
- return VC_PICTURE;
|
||||
-
|
||||
int ret = av_buffersrc_add_frame(m_pFilterIn, m_pFrame);
|
||||
if (ret < 0)
|
||||
{
|
||||
@@ -547,21 +782,14 @@ CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::ProcessFilterIn()
|
||||
@@ -536,21 +771,14 @@ CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::ProcessFilterIn()
|
||||
|
||||
CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::ProcessFilterOut()
|
||||
{
|
||||
@ -329,7 +329,7 @@ index 7507c12e9a..4759dde3f9 100644
|
||||
}
|
||||
else if (ret)
|
||||
{
|
||||
@@ -572,9 +800,27 @@ CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::ProcessFilterOut()
|
||||
@@ -561,9 +789,27 @@ CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::ProcessFilterOut()
|
||||
return VC_ERROR;
|
||||
}
|
||||
|
||||
@ -357,7 +357,7 @@ index 7507c12e9a..4759dde3f9 100644
|
||||
CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::GetPicture(VideoPicture* pVideoPicture)
|
||||
{
|
||||
if (m_codecControlFlags & DVD_CODEC_CTRL_DRAIN)
|
||||
@@ -586,57 +832,71 @@ CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::GetPicture(VideoPicture* pVideo
|
||||
@@ -575,57 +821,71 @@ CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::GetPicture(VideoPicture* pVideo
|
||||
pVideoPicture->videoBuffer = nullptr;
|
||||
}
|
||||
|
||||
@ -468,7 +468,7 @@ index 7507c12e9a..4759dde3f9 100644
|
||||
return VC_PICTURE;
|
||||
}
|
||||
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.h
|
||||
index 7112d1b48a..13bec95135 100644
|
||||
index 7112d1b48afb..13bec9513579 100644
|
||||
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.h
|
||||
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.h
|
||||
@@ -38,18 +38,25 @@ public:
|
||||
@ -498,3 +498,6 @@ index 7112d1b48a..13bec95135 100644
|
||||
AVFilterGraph* m_pFilterGraph = nullptr;
|
||||
AVFilterContext* m_pFilterIn = nullptr;
|
||||
AVFilterContext* m_pFilterOut = nullptr;
|
||||
--
|
||||
2.29.2
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user