Wait for the VDPAU output surface to be idle in waitToRender()

This commit is contained in:
Cameron Gutman
2022-04-07 22:16:52 -05:00
parent 9790c218dc
commit 81d5e7f014
2 changed files with 13 additions and 1 deletions

View File

@@ -474,6 +474,15 @@ void VDPAURenderer::renderOverlay(VdpOutputSurface destination, Overlay::Overlay
}
}
void VDPAURenderer::waitToRender()
{
VdpOutputSurface chosenSurface = m_OutputSurface[m_NextSurfaceIndex];
// Wait for the next render target surface to be idle before proceeding
VdpTime pts;
m_VdpPresentationQueueBlockUntilSurfaceIdle(m_PresentationQueue, chosenSurface, &pts);
}
void VDPAURenderer::renderFrame(AVFrame* frame)
{
VdpStatus status;
@@ -524,7 +533,9 @@ void VDPAURenderer::renderFrame(AVFrame* frame)
}
}
// Wait for this frame to be off the screen
// Wait for this frame to be off the screen. This will usually be a no-op
// since it already happened in waitToRender(). However, that won't be the
// case is when frame pacing is enabled.
VdpTime pts;
m_VdpPresentationQueueBlockUntilSurfaceIdle(m_PresentationQueue, chosenSurface, &pts);