forked from libretro/Lakka-LibreELEC
55 lines
2.4 KiB
Diff
55 lines
2.4 KiB
Diff
From 97d39a46091b65e4355ce7e545bdec46ff2f87de Mon Sep 17 00:00:00 2001
|
|
From: popcornmix <popcornmix@gmail.com>
|
|
Date: Sat, 11 Sep 2021 14:03:05 +0100
|
|
Subject: [PATCH 1/7] CDVDVideoCodecDRMPRIME: Also support YUV420 buffers
|
|
|
|
CDVDVideoCodecDRMPRIME: Add support for deinterlace of sw decoded buffers
|
|
|
|
Need to call SetDimensions earlier and store the drm descriptor in expected place
|
|
---
|
|
.../DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp | 14 ++++++++++++--
|
|
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 20a5c24f53..a36107c515 100644
|
|
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
|
|
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
|
|
@@ -582,7 +582,7 @@ bool CDVDVideoCodecDRMPRIME::SetPictureParams(VideoPicture* pVideoPicture)
|
|
pVideoPicture->videoBuffer = nullptr;
|
|
}
|
|
|
|
- if (IsSupportedHwFormat(static_cast<AVPixelFormat>(m_pFrame->format)))
|
|
+ if (m_pFrame->format == AV_PIX_FMT_DRM_PRIME)
|
|
{
|
|
CVideoBufferDRMPRIMEFFmpeg* buffer =
|
|
dynamic_cast<CVideoBufferDRMPRIMEFFmpeg*>(m_videoBufferPool->Get());
|
|
@@ -660,7 +660,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");
|
|
- enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_DRM_PRIME, AV_PIX_FMT_NONE };
|
|
+ enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_DRM_PRIME, AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE };
|
|
|
|
std::string args = StringUtils::Format("video_size={}x{}:pix_fmt={}:time_base={}/{}:"
|
|
"pixel_aspect={}/{}",
|
|
@@ -808,6 +808,16 @@ void CDVDVideoCodecDRMPRIME::FilterClose()
|
|
|
|
CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::ProcessFilterIn()
|
|
{
|
|
+ // sw decoded buffers need cache flush and for descripter to be set
|
|
+ if (!IsSupportedHwFormat(static_cast<AVPixelFormat>(m_pFrame->format)) && m_pFrame->opaque != nullptr)
|
|
+ {
|
|
+ CVideoBufferDMA* buffer = static_cast<CVideoBufferDMA*>(m_pFrame->opaque);
|
|
+ buffer->SetDimensions(m_pFrame->width, m_pFrame->height);
|
|
+ buffer->SyncEnd();
|
|
+ auto descriptor = buffer->GetDescriptor();
|
|
+ m_pFrame->data[0] = reinterpret_cast<uint8_t*>(descriptor);
|
|
+ }
|
|
+
|
|
int ret = av_buffersrc_add_frame(m_pFilterIn, m_pFrame);
|
|
if (ret < 0)
|
|
{
|
|
--
|
|
2.39.2
|
|
|