18#ifndef D3DVIDEOWIDGET_H
19#define D3DVIDEOWIDGET_H
21#include "videowidget.h"
24#include <directxmath.h>
26class D3DVideoWidget :
public Mlt::VideoWidget
30 explicit D3DVideoWidget(QObject *parent =
nullptr);
31 virtual ~D3DVideoWidget();
34 virtual void initialize();
35 virtual void beforeRendering();
36 virtual void renderVideo();
43 void prepareShader(Stage stage);
44 QByteArray compileShader(Stage stage,
45 const QByteArray &source,
46 const QByteArray &entryPoint);
47 ID3D11ShaderResourceView *initTexture(
const void *p,
int width,
int height);
49 ID3D11Device *m_device =
nullptr;
50 ID3D11DeviceContext *m_context =
nullptr;
52 QByteArray m_vertEntryPoint;
54 QByteArray m_fragEntryPoint;
56 bool m_initialized =
false;
57 ID3D11Buffer *m_vbuf =
nullptr;
58 ID3D11Buffer *m_cbuf =
nullptr;
59 ID3D11VertexShader *m_vs =
nullptr;
60 ID3D11PixelShader *m_ps =
nullptr;
61 ID3D11InputLayout *m_inputLayout =
nullptr;
62 ID3D11RasterizerState *m_rastState =
nullptr;
63 ID3D11DepthStencilState *m_dsState =
nullptr;
64 ID3D11ShaderResourceView *m_texture[3] = {
nullptr,
nullptr,
nullptr};
66 struct ConstantBuffer {
70 ConstantBuffer m_constants;