Skip to content

Commit

Permalink
DVDVideoCodecDRMPRIME: Request v4l2 buffers be allocated through cache
Browse files Browse the repository at this point in the history
This is an optional request, but will improve performance of sw deinterlace
if supported.
  • Loading branch information
popcornmix committed Feb 21, 2024
1 parent 29a1a59 commit 4bb8228
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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__);
Expand Down

0 comments on commit 4bb8228

Please sign in to comment.