mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-18 06:30:55 +00:00
Implement D3D11VA video rendering
This commit is contained in:
@@ -17,6 +17,7 @@ public:
|
||||
virtual ~D3D11VARenderer() override;
|
||||
virtual bool initialize(PDECODER_PARAMETERS params) override;
|
||||
virtual bool prepareDecoderContext(AVCodecContext* context, AVDictionary**) override;
|
||||
virtual bool prepareDecoderContextInGetFormat(AVCodecContext* context, AVPixelFormat pixelFormat) override;
|
||||
virtual void renderFrame(AVFrame* frame) override;
|
||||
virtual void notifyOverlayUpdated(Overlay::OverlayType) override;
|
||||
virtual void setHdrMode(bool enabled) override;
|
||||
@@ -28,6 +29,8 @@ private:
|
||||
|
||||
bool setupRenderingResources();
|
||||
void renderOverlay(Overlay::OverlayType type);
|
||||
void updateColorConversionConstants(AVFrame* frame);
|
||||
void renderVideo(AVFrame* frame);
|
||||
bool checkDecoderSupport(IDXGIAdapter* adapter);
|
||||
|
||||
IDXGIFactory5* m_Factory;
|
||||
@@ -41,10 +44,15 @@ private:
|
||||
int m_DisplayWidth;
|
||||
int m_DisplayHeight;
|
||||
bool m_Windowed;
|
||||
AVColorSpace m_LastColorSpace;
|
||||
AVColorRange m_LastColorRange;
|
||||
|
||||
bool m_AllowTearing;
|
||||
HANDLE m_FrameWaitableObject;
|
||||
|
||||
ID3D11PixelShader* m_VideoPixelShader;
|
||||
ID3D11Buffer* m_VideoVertexBuffer;
|
||||
ID3D11Buffer* m_VideoConstantBuffer;
|
||||
|
||||
SDL_SpinLock m_OverlayLock;
|
||||
ID3D11Buffer* m_OverlayVertexBuffers[Overlay::OverlayMax];
|
||||
@@ -52,6 +60,7 @@ private:
|
||||
ID3D11ShaderResourceView* m_OverlayTextureResourceViews[Overlay::OverlayMax];
|
||||
ID3D11PixelShader* m_OverlayPixelShader;
|
||||
|
||||
AVBufferRef* m_HwContext;
|
||||
AVBufferRef* m_HwDeviceContext;
|
||||
AVBufferRef* m_HwFramesContext;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user