mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-18 06:30:55 +00:00
Use ComPtr for lifetime management in D3D11VA
This commit is contained in:
@@ -9,6 +9,8 @@ extern "C" {
|
||||
#include <libavutil/hwcontext_d3d11va.h>
|
||||
}
|
||||
|
||||
#include <wrl/client.h>
|
||||
|
||||
class D3D11VARenderer : public IFFmpegRenderer
|
||||
{
|
||||
public:
|
||||
@@ -51,11 +53,11 @@ private:
|
||||
int m_DevicesWithFL11Support;
|
||||
int m_DevicesWithCodecSupport;
|
||||
|
||||
IDXGIFactory5* m_Factory;
|
||||
ID3D11Device* m_Device;
|
||||
IDXGISwapChain4* m_SwapChain;
|
||||
ID3D11DeviceContext* m_DeviceContext;
|
||||
ID3D11RenderTargetView* m_RenderTargetView;
|
||||
Microsoft::WRL::ComPtr<IDXGIFactory5> m_Factory;
|
||||
Microsoft::WRL::ComPtr<ID3D11Device> m_Device;
|
||||
Microsoft::WRL::ComPtr<IDXGISwapChain4> m_SwapChain;
|
||||
Microsoft::WRL::ComPtr<ID3D11DeviceContext> m_DeviceContext;
|
||||
Microsoft::WRL::ComPtr<ID3D11RenderTargetView> m_RenderTargetView;
|
||||
SDL_mutex* m_ContextLock;
|
||||
bool m_BindDecoderOutputTextures;
|
||||
|
||||
@@ -70,21 +72,21 @@ private:
|
||||
|
||||
bool m_AllowTearing;
|
||||
|
||||
std::array<ID3D11PixelShader*, PixelShaders::_COUNT> m_VideoPixelShaders;
|
||||
ID3D11Buffer* m_VideoVertexBuffer;
|
||||
std::array<Microsoft::WRL::ComPtr<ID3D11PixelShader>, PixelShaders::_COUNT> m_VideoPixelShaders;
|
||||
Microsoft::WRL::ComPtr<ID3D11Buffer> m_VideoVertexBuffer;
|
||||
|
||||
// Only valid if !m_BindDecoderOutputTextures
|
||||
ID3D11Texture2D* m_VideoTexture;
|
||||
Microsoft::WRL::ComPtr<ID3D11Texture2D> m_VideoTexture;
|
||||
|
||||
// Only index 0 is valid if !m_BindDecoderOutputTextures
|
||||
#define DECODER_BUFFER_POOL_SIZE 17
|
||||
ID3D11ShaderResourceView* m_VideoTextureResourceViews[DECODER_BUFFER_POOL_SIZE][2];
|
||||
std::array<std::array<Microsoft::WRL::ComPtr<ID3D11ShaderResourceView>, 2>, DECODER_BUFFER_POOL_SIZE> m_VideoTextureResourceViews;
|
||||
|
||||
SDL_SpinLock m_OverlayLock;
|
||||
ID3D11Buffer* m_OverlayVertexBuffers[Overlay::OverlayMax];
|
||||
ID3D11Texture2D* m_OverlayTextures[Overlay::OverlayMax];
|
||||
ID3D11ShaderResourceView* m_OverlayTextureResourceViews[Overlay::OverlayMax];
|
||||
ID3D11PixelShader* m_OverlayPixelShader;
|
||||
std::array<Microsoft::WRL::ComPtr<ID3D11Buffer>, Overlay::OverlayMax> m_OverlayVertexBuffers;
|
||||
std::array<Microsoft::WRL::ComPtr<ID3D11Texture2D>, Overlay::OverlayMax> m_OverlayTextures;
|
||||
std::array<Microsoft::WRL::ComPtr<ID3D11ShaderResourceView>, Overlay::OverlayMax> m_OverlayTextureResourceViews;
|
||||
Microsoft::WRL::ComPtr<ID3D11PixelShader> m_OverlayPixelShader;
|
||||
|
||||
AVBufferRef* m_HwDeviceContext;
|
||||
AVBufferRef* m_HwFramesContext;
|
||||
|
||||
Reference in New Issue
Block a user