mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-04-07 16:26:09 +00:00
Rewrite FFmpeg decoder to use pull model
This allows us to keep asynchronous decoders like MMAL and V4L2M2M fed while we're waiting for output frames. Behavior for synchronous decoders should be identical. Continuing to feed new data while waiting for output frames is crucial for acceptable performance on 1080p video on the Raspberry Pi using V4L2M2M, since it allows the decode and copy operations to be pipelined.
This commit is contained in:
@@ -357,6 +357,13 @@ bool Session::populateDecoderProperties(SDL_Window* window)
|
||||
}
|
||||
|
||||
m_VideoCallbacks.capabilities = decoder->getDecoderCapabilities();
|
||||
if (m_VideoCallbacks.capabilities & CAPABILITY_PULL_RENDERER) {
|
||||
// It is an error to pass a push callback when in pull mode
|
||||
m_VideoCallbacks.submitDecodeUnit = nullptr;
|
||||
}
|
||||
else {
|
||||
m_VideoCallbacks.submitDecodeUnit = drSubmitDecodeUnit;
|
||||
}
|
||||
|
||||
m_StreamConfig.colorSpace = decoder->getDecoderColorspace();
|
||||
|
||||
@@ -439,7 +446,6 @@ bool Session::initialize()
|
||||
|
||||
LiInitializeVideoCallbacks(&m_VideoCallbacks);
|
||||
m_VideoCallbacks.setup = drSetup;
|
||||
m_VideoCallbacks.submitDecodeUnit = drSubmitDecodeUnit;
|
||||
|
||||
LiInitializeStreamConfiguration(&m_StreamConfig);
|
||||
m_StreamConfig.width = m_Preferences->width;
|
||||
|
||||
Reference in New Issue
Block a user