Hoist the logic to keep an AVFrame reference up to Pacer

This commit is contained in:
Cameron Gutman
2026-01-07 17:50:43 -06:00
parent ed98f256e8
commit 9ffe5218d5
6 changed files with 42 additions and 57 deletions
+3 -4
View File
@@ -1396,7 +1396,7 @@ void DrmRenderer::notifyOverlayUpdated(Overlay::OverlayType type)
// Queue the plane flip with the new FB
//
// NB: This takes ownership of the FB and dumb buffer, even on failure
m_PropSetter.flipPlane(m_OverlayPlanes[type], fbId, dumbBuffer, nullptr);
m_PropSetter.flipPlane(m_OverlayPlanes[type], fbId, dumbBuffer);
SDL_FreeSurface(newSurface);
}
@@ -1657,11 +1657,10 @@ void DrmRenderer::renderFrame(AVFrame* frame)
//
// NB: This takes ownership of fbId, even on failure
//
// NB2: We reference the AVFrame (which also references the AVBuffers backing the frame itself
// NB2: Pacer references the AVFrame (which also references the AVBuffers backing the frame
// and the opaque_ref which may store our DRM-PRIME mapping) for frames backed by DMA-BUFs in
// order to keep those from being reused by the decoder while they're still being scanned out.
m_PropSetter.flipPlane(m_VideoPlane, fbId, 0,
(m_DrmPrimeBackend || frame->format == AV_PIX_FMT_DRM_PRIME) ? frame : nullptr);
m_PropSetter.flipPlane(m_VideoPlane, fbId, 0);
// Apply pending atomic transaction (if in atomic mode)
m_PropSetter.apply();