Use a separate callback to indicate EOS instead of renderFrame()

This commit is contained in:
Cameron Gutman 2022-04-07 21:30:20 -05:00
commit 474591c6a5
12 changed files with 18 additions and 50 deletions

View file

@ -814,16 +814,16 @@ bool EGLRenderer::specialize() {
return err == GL_NO_ERROR;
}
void EGLRenderer::cleanupRenderContext()
{
// Detach the context from the render thread so the destructor can attach it
SDL_GL_MakeCurrent(m_Window, nullptr);
}
void EGLRenderer::renderFrame(AVFrame* frame)
{
EGLImage imgs[EGL_MAX_PLANES];
if (frame == nullptr) {
// End of stream - unbind the GL context
SDL_GL_MakeCurrent(m_Window, nullptr);
return;
}
// Attach our GL context to the render thread
// NB: It should already be current, unless the SDL render event watcher
// performs a rendering operation (like a viewport update on resize) on