mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-12-15 13:52:28 +00:00
Only enable slicing when CPU decoding
This commit is contained in:
parent
160684f23e
commit
8b9b96f422
3 changed files with 12 additions and 8 deletions
|
@ -282,7 +282,7 @@ bool Session::populateDecoderProperties(SDL_Window* window)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_VideoCallbacks.capabilities |= decoder->getDecoderCapabilities();
|
m_VideoCallbacks.capabilities = decoder->getDecoderCapabilities();
|
||||||
|
|
||||||
m_StreamConfig.colorSpace = decoder->getDecoderColorspace();
|
m_StreamConfig.colorSpace = decoder->getDecoderColorspace();
|
||||||
|
|
||||||
|
@ -350,13 +350,6 @@ bool Session::initialize()
|
||||||
m_VideoCallbacks.setup = drSetup;
|
m_VideoCallbacks.setup = drSetup;
|
||||||
m_VideoCallbacks.submitDecodeUnit = drSubmitDecodeUnit;
|
m_VideoCallbacks.submitDecodeUnit = drSubmitDecodeUnit;
|
||||||
|
|
||||||
// Slice up to 4 times for parallel decode, once slice per core
|
|
||||||
int slices = qMin(MAX_SLICES, SDL_GetCPUCount());
|
|
||||||
m_VideoCallbacks.capabilities |= CAPABILITY_SLICES_PER_FRAME(slices);
|
|
||||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
|
||||||
"Encoder configured for %d slices per frame",
|
|
||||||
slices);
|
|
||||||
|
|
||||||
LiInitializeStreamConfiguration(&m_StreamConfig);
|
LiInitializeStreamConfiguration(&m_StreamConfig);
|
||||||
m_StreamConfig.width = m_Preferences->width;
|
m_StreamConfig.width = m_Preferences->width;
|
||||||
m_StreamConfig.height = m_Preferences->height;
|
m_StreamConfig.height = m_Preferences->height;
|
||||||
|
|
|
@ -127,6 +127,16 @@ bool SdlRenderer::isRenderThreadSupported()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int SdlRenderer::getDecoderCapabilities()
|
||||||
|
{
|
||||||
|
// Slice up to 4 times for parallel decode, once slice per core
|
||||||
|
int slices = qMin(MAX_SLICES, SDL_GetCPUCount());
|
||||||
|
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"Encoder configured for %d slices per frame",
|
||||||
|
slices);
|
||||||
|
return CAPABILITY_SLICES_PER_FRAME(slices);
|
||||||
|
}
|
||||||
|
|
||||||
bool SdlRenderer::initialize(PDECODER_PARAMETERS params)
|
bool SdlRenderer::initialize(PDECODER_PARAMETERS params)
|
||||||
{
|
{
|
||||||
Uint32 rendererFlags = SDL_RENDERER_ACCELERATED;
|
Uint32 rendererFlags = SDL_RENDERER_ACCELERATED;
|
||||||
|
|
|
@ -13,6 +13,7 @@ public:
|
||||||
virtual void renderFrame(AVFrame* frame) override;
|
virtual void renderFrame(AVFrame* frame) override;
|
||||||
virtual void notifyOverlayUpdated(Overlay::OverlayType) override;
|
virtual void notifyOverlayUpdated(Overlay::OverlayType) override;
|
||||||
virtual bool isRenderThreadSupported() override;
|
virtual bool isRenderThreadSupported() override;
|
||||||
|
virtual int getDecoderCapabilities() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void renderOverlay(Overlay::OverlayType type);
|
void renderOverlay(Overlay::OverlayType type);
|
||||||
|
|
Loading…
Reference in a new issue