Add a new prepareToRender() callback for renders to perform their initial window clears

This consolidates all the clearing that was strewn across the codebase.
This commit is contained in:
Cameron Gutman
2024-06-25 23:12:18 -05:00
parent 1d1fa0577b
commit e76780e105
11 changed files with 105 additions and 73 deletions

View File

@@ -600,6 +600,9 @@ bool FFmpegVideoDecoder::completeInitialization(const AVCodec* decoder, enum AVP
// Tell overlay manager to use this frontend renderer
Session::get()->getOverlayManager().setOverlayRenderer(m_FrontendRenderer);
// Allow the renderer to perform final preparations for rendering
m_FrontendRenderer->prepareToRender();
// Only create the decoder thread when instantiating the decoder for real. It will use APIs from
// moonlight-common-c that can only be legally called with an established connection.
m_DecoderThread = SDL_CreateThread(FFmpegVideoDecoder::decoderThreadProcThunk, "FFDecoder", (void*)this);