mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-04-13 19:26:02 +00:00
Avoid slicing for hardware decoders that use SDL as the renderer
This commit is contained in:
@@ -127,16 +127,6 @@ bool SdlRenderer::isRenderThreadSupported()
|
||||
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)
|
||||
{
|
||||
Uint32 rendererFlags = SDL_RENDERER_ACCELERATED;
|
||||
|
||||
@@ -13,7 +13,6 @@ public:
|
||||
virtual void renderFrame(AVFrame* frame) override;
|
||||
virtual void notifyOverlayUpdated(Overlay::OverlayType) override;
|
||||
virtual bool isRenderThreadSupported() override;
|
||||
virtual int getDecoderCapabilities() override;
|
||||
|
||||
private:
|
||||
void renderOverlay(Overlay::OverlayType type);
|
||||
|
||||
@@ -47,7 +47,18 @@ bool FFmpegVideoDecoder::isHardwareAccelerated()
|
||||
|
||||
int FFmpegVideoDecoder::getDecoderCapabilities()
|
||||
{
|
||||
return m_BackendRenderer->getDecoderCapabilities();
|
||||
int capabilities = m_BackendRenderer->getDecoderCapabilities();
|
||||
|
||||
if (!isHardwareAccelerated()) {
|
||||
// Slice up to 4 times for parallel CPU decoding, 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);
|
||||
capabilities |= CAPABILITY_SLICES_PER_FRAME(slices);
|
||||
}
|
||||
|
||||
return capabilities;
|
||||
}
|
||||
|
||||
int FFmpegVideoDecoder::getDecoderColorspace()
|
||||
|
||||
Reference in New Issue
Block a user