mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
RK: rebase DI patches
This commit is contained in:
parent
85e07b5c32
commit
b83c1d31ac
@ -1,15 +1,13 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From 6789405cbea23dd0d53ba5a6833dc2266f166ad9 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Sun, 20 Oct 2019 17:10:07 +0000
|
||||
Subject: [PATCH] WIP: DVDVideoCodecDRMPRIME: add support for filters
|
||||
Subject: [PATCH 1/2] WIP: DVDVideoCodecDRMPRIME: add support for filters
|
||||
|
||||
---
|
||||
.../DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp | 68 ++++++++++++++++---
|
||||
.../DVDCodecs/Video/DVDVideoCodecDRMPRIME.h | 10 +++
|
||||
2 files changed, 69 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
|
||||
index 8024c20816..7507c12e9a 100644
|
||||
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
|
||||
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
|
||||
@@ -27,6 +27,8 @@
|
||||
@ -21,7 +19,7 @@ index 8024c20816..7507c12e9a 100644
|
||||
#include <libavutil/error.h>
|
||||
#include <libavutil/imgutils.h>
|
||||
#include <libavutil/opt.h>
|
||||
@@ -525,18 +527,30 @@ void CDVDVideoCodecDRMPRIME::SetPictureParams(VideoPicture* pVideoPicture)
|
||||
@@ -559,18 +561,30 @@ void CDVDVideoCodecDRMPRIME::SetPictureP
|
||||
pVideoPicture->dts = DVD_NOPTS_VALUE;
|
||||
}
|
||||
|
||||
@ -59,7 +57,7 @@ index 8024c20816..7507c12e9a 100644
|
||||
if (ret == AVERROR(EAGAIN))
|
||||
return VC_BUFFER;
|
||||
else if (ret == AVERROR_EOF)
|
||||
@@ -553,11 +567,47 @@ CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::GetPicture(VideoPicture* pVideo
|
||||
@@ -587,11 +601,47 @@ CDVDVideoCodec::VCReturn CDVDVideoCodecD
|
||||
{
|
||||
char err[AV_ERROR_MAX_STRING_SIZE] = {};
|
||||
av_strerror(ret, err, AV_ERROR_MAX_STRING_SIZE);
|
||||
@ -109,8 +107,6 @@ index 8024c20816..7507c12e9a 100644
|
||||
SetPictureParams(pVideoPicture);
|
||||
|
||||
if (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 77d066c3d9..7112d1b48a 100644
|
||||
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.h
|
||||
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.h
|
||||
@@ -14,6 +14,11 @@
|
||||
@ -134,8 +130,8 @@ index 77d066c3d9..7112d1b48a 100644
|
||||
static enum AVPixelFormat GetFormat(struct AVCodecContext* avctx, const enum AVPixelFormat* fmt);
|
||||
static int GetBuffer(struct AVCodecContext* avctx, AVFrame* frame, int flags);
|
||||
|
||||
@@ -43,5 +50,8 @@ protected:
|
||||
CDVDStreamInfo m_hints;
|
||||
@@ -44,5 +51,8 @@ protected:
|
||||
double m_DAR = 1.0;
|
||||
AVCodecContext* m_pCodecContext = nullptr;
|
||||
AVFrame* m_pFrame = nullptr;
|
||||
+ AVFilterGraph* m_pFilterGraph = nullptr;
|
||||
|
@ -8,11 +8,9 @@ Subject: [PATCH 2/2] WIP: DRMPRIME deinterlace filter
|
||||
.../DVDCodecs/Video/DVDVideoCodecDRMPRIME.h | 9 +-
|
||||
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 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)
|
||||
@@ -79,12 +79,15 @@ CDVDVideoCodecDRMPRIME::CDVDVideoCodecDR
|
||||
: CDVDVideoCodec(processInfo)
|
||||
{
|
||||
m_pFrame = av_frame_alloc();
|
||||
@ -28,7 +26,7 @@ index 2b334c95d47a..1e5624e7af50 100644
|
||||
avcodec_free_context(&m_pCodecContext);
|
||||
}
|
||||
|
||||
@@ -330,8 +333,19 @@ bool CDVDVideoCodecDRMPRIME::Open(CDVDStreamInfo& hints, CDVDCodecOptions& optio
|
||||
@@ -341,8 +344,19 @@ bool CDVDVideoCodecDRMPRIME::Open(CDVDSt
|
||||
}
|
||||
|
||||
UpdateProcessInfo(m_pCodecContext, m_pCodecContext->pix_fmt);
|
||||
@ -49,7 +47,7 @@ index 2b334c95d47a..1e5624e7af50 100644
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -394,6 +408,8 @@ void CDVDVideoCodecDRMPRIME::Reset()
|
||||
@@ -418,6 +432,8 @@ void CDVDVideoCodecDRMPRIME::Reset()
|
||||
return;
|
||||
|
||||
Drain();
|
||||
@ -58,8 +56,8 @@ index 2b334c95d47a..1e5624e7af50 100644
|
||||
|
||||
do
|
||||
{
|
||||
@@ -432,7 +448,7 @@ void CDVDVideoCodecDRMPRIME::Drain()
|
||||
}
|
||||
@@ -465,7 +481,7 @@ void CDVDVideoCodecDRMPRIME::Drain()
|
||||
av_packet_free(&avpkt);
|
||||
}
|
||||
|
||||
-void CDVDVideoCodecDRMPRIME::SetPictureParams(VideoPicture* pVideoPicture)
|
||||
@ -67,7 +65,7 @@ index 2b334c95d47a..1e5624e7af50 100644
|
||||
{
|
||||
pVideoPicture->iWidth = m_pFrame->width;
|
||||
pVideoPicture->iHeight = m_pFrame->height;
|
||||
@@ -514,13 +530,232 @@ void CDVDVideoCodecDRMPRIME::SetPictureParams(VideoPicture* pVideoPicture)
|
||||
@@ -559,13 +575,232 @@ void CDVDVideoCodecDRMPRIME::SetPictureP
|
||||
? DVD_NOPTS_VALUE
|
||||
: static_cast<double>(pts) * DVD_TIME_BASE / AV_TIME_BASE;
|
||||
pVideoPicture->dts = DVD_NOPTS_VALUE;
|
||||
@ -101,8 +99,9 @@ index 2b334c95d47a..1e5624e7af50 100644
|
||||
+ }
|
||||
+
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
}
|
||||
|
||||
-CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::ProcessFilterIn()
|
||||
+void CDVDVideoCodecDRMPRIME::FilterTest()
|
||||
+{
|
||||
+ const AVFilter* filter;
|
||||
@ -133,7 +132,9 @@ index 2b334c95d47a..1e5624e7af50 100644
|
||||
+}
|
||||
+
|
||||
+bool CDVDVideoCodecDRMPRIME::FilterOpen(const std::string& filters, bool test)
|
||||
+{
|
||||
{
|
||||
- if (!m_pFilterIn)
|
||||
- return VC_PICTURE;
|
||||
+ int result;
|
||||
+
|
||||
+ if (m_pFilterGraph)
|
||||
@ -147,7 +148,7 @@ index 2b334c95d47a..1e5624e7af50 100644
|
||||
+ CLog::Log(LOGERROR, "CDVDVideoCodecDRMPRIME::FilterOpen - unable to alloc filter graph");
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
|
||||
+ const AVFilter* srcFilter = avfilter_get_by_name("buffer");
|
||||
+ const AVFilter* outFilter = avfilter_get_by_name("buffersink");
|
||||
+ enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_DRM_PRIME, AV_PIX_FMT_NONE };
|
||||
@ -293,17 +294,14 @@ index 2b334c95d47a..1e5624e7af50 100644
|
||||
+ m_pFilterIn = nullptr;
|
||||
+ m_pFilterOut = nullptr;
|
||||
+ }
|
||||
}
|
||||
|
||||
CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::ProcessFilterIn()
|
||||
{
|
||||
- if (!m_pFilterIn)
|
||||
- return VC_PICTURE;
|
||||
-
|
||||
+}
|
||||
+
|
||||
+CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::ProcessFilterIn()
|
||||
+{
|
||||
int ret = av_buffersrc_add_frame(m_pFilterIn, m_pFrame);
|
||||
if (ret < 0)
|
||||
{
|
||||
@@ -536,21 +771,14 @@ CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::ProcessFilterIn()
|
||||
@@ -581,21 +816,14 @@ CDVDVideoCodec::VCReturn CDVDVideoCodecD
|
||||
|
||||
CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::ProcessFilterOut()
|
||||
{
|
||||
@ -329,7 +327,7 @@ index 2b334c95d47a..1e5624e7af50 100644
|
||||
}
|
||||
else if (ret)
|
||||
{
|
||||
@@ -561,9 +789,27 @@ CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::ProcessFilterOut()
|
||||
@@ -606,9 +834,27 @@ CDVDVideoCodec::VCReturn CDVDVideoCodecD
|
||||
return VC_ERROR;
|
||||
}
|
||||
|
||||
@ -357,7 +355,7 @@ index 2b334c95d47a..1e5624e7af50 100644
|
||||
CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::GetPicture(VideoPicture* pVideoPicture)
|
||||
{
|
||||
if (m_codecControlFlags & DVD_CODEC_CTRL_DRAIN)
|
||||
@@ -575,57 +821,71 @@ CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::GetPicture(VideoPicture* pVideo
|
||||
@@ -620,57 +866,71 @@ CDVDVideoCodec::VCReturn CDVDVideoCodecD
|
||||
pVideoPicture->videoBuffer = nullptr;
|
||||
}
|
||||
|
||||
@ -467,11 +465,9 @@ index 2b334c95d47a..1e5624e7af50 100644
|
||||
|
||||
return VC_PICTURE;
|
||||
}
|
||||
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.h
|
||||
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:
|
||||
@@ -38,19 +38,26 @@ public:
|
||||
|
||||
protected:
|
||||
void Drain();
|
||||
@ -492,12 +488,10 @@ index 7112d1b48afb..13bec9513579 100644
|
||||
+ std::string m_filters;
|
||||
int m_codecControlFlags = 0;
|
||||
CDVDStreamInfo m_hints;
|
||||
double m_DAR = 1.0;
|
||||
AVCodecContext* m_pCodecContext = nullptr;
|
||||
AVFrame* m_pFrame = nullptr;
|
||||
+ AVFrame* m_pFilterFrame = nullptr;
|
||||
AVFilterGraph* m_pFilterGraph = nullptr;
|
||||
AVFilterContext* m_pFilterIn = nullptr;
|
||||
AVFilterContext* m_pFilterOut = nullptr;
|
||||
--
|
||||
2.29.2
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user