mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-11-14 15:37:09 +00:00
Fix DXVA2 rendering with the wrong colorspace on AMD GPUs
This commit is contained in:
parent
5e5470ae12
commit
d4c2350d63
2 changed files with 15 additions and 0 deletions
|
@ -776,6 +776,20 @@ void DXVA2Renderer::notifyOverlayUpdated(Overlay::OverlayType type)
|
|||
}
|
||||
}
|
||||
|
||||
int DXVA2Renderer::getDecoderColorspace()
|
||||
{
|
||||
if (isDXVideoProcessorAPIBlacklisted()) {
|
||||
// StretchRect() assumes Rec 601 on Intel GPUs
|
||||
return COLORSPACE_REC_601;
|
||||
}
|
||||
else {
|
||||
// VideoProcessBlt() *should* properly handle whatever, since
|
||||
// we provide colorspace information. However, AMD GPUs seem to
|
||||
// always assume Rec 709, so we'll use that as our default.
|
||||
return COLORSPACE_REC_709;
|
||||
}
|
||||
}
|
||||
|
||||
void DXVA2Renderer::renderFrame(AVFrame *frame)
|
||||
{
|
||||
IDirect3DSurface9* surface = reinterpret_cast<IDirect3DSurface9*>(frame->data[3]);
|
||||
|
|
|
@ -20,6 +20,7 @@ public:
|
|||
virtual bool prepareDecoderContext(AVCodecContext* context) override;
|
||||
virtual void renderFrame(AVFrame* frame) override;
|
||||
virtual void notifyOverlayUpdated(Overlay::OverlayType) override;
|
||||
virtual int getDecoderColorspace() override;
|
||||
|
||||
private:
|
||||
bool initializeDecoder();
|
||||
|
|
Loading…
Reference in a new issue