mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-02 15:55:39 +00:00
Fix DXVA2 rendering with the wrong colorspace on AMD GPUs
This commit is contained in:
parent
5e5470ae12
commit
d4c2350d63
@ -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)
|
void DXVA2Renderer::renderFrame(AVFrame *frame)
|
||||||
{
|
{
|
||||||
IDirect3DSurface9* surface = reinterpret_cast<IDirect3DSurface9*>(frame->data[3]);
|
IDirect3DSurface9* surface = reinterpret_cast<IDirect3DSurface9*>(frame->data[3]);
|
||||||
|
@ -20,6 +20,7 @@ public:
|
|||||||
virtual bool prepareDecoderContext(AVCodecContext* context) override;
|
virtual bool prepareDecoderContext(AVCodecContext* context) override;
|
||||||
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 int getDecoderColorspace() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool initializeDecoder();
|
bool initializeDecoder();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user