From 4bb82288a530ac6b56158ceb50e08fd3e34c876c Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Tue, 20 Jun 2023 15:14:02 +0100 Subject: [PATCH] DVDVideoCodecDRMPRIME: Request v4l2 buffers be allocated through cache This is an optional request, but will improve performance of sw deinterlace if supported. --- .../VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp index 326d33e8a0c38..8c0d37bf59938 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp @@ -367,6 +367,10 @@ bool CDVDVideoCodecDRMPRIME::Open(CDVDStreamInfo& hints, CDVDCodecOptions& optio for (auto&& option : options.m_keys) av_opt_set(m_pCodecContext, option.m_name.c_str(), option.m_value.c_str(), 0); + // this requests v4l2 buffers are allocated through cache. It will work if this is not supported, + // but subsequent operations like deinterlace may be less efficient + av_opt_set(m_pCodecContext->priv_data, "dmabuf_alloc", "cma", 0); + if (avcodec_open2(m_pCodecContext, pCodec, nullptr) < 0) { CLog::Log(LOGINFO, "CDVDVideoCodecDRMPRIME::{} - unable to open codec", __FUNCTION__);