[vlc-devel] [PATCH 08/14] d3d11_fmt: add D3D11_Create and D3D11_Destroy
Steve Lhomme
robux4 at videolabs.io
Sat Nov 18 14:29:22 CET 2017
Similar to the D3D9 API
---
modules/video_chroma/d3d11_fmt.c | 22 ++++++++++++++++++++++
modules/video_chroma/d3d11_fmt.h | 5 +++++
2 files changed, 27 insertions(+)
diff --git a/modules/video_chroma/d3d11_fmt.c b/modules/video_chroma/d3d11_fmt.c
index 377bccb658..1c99ed4a84 100644
--- a/modules/video_chroma/d3d11_fmt.c
+++ b/modules/video_chroma/d3d11_fmt.c
@@ -413,3 +413,25 @@ error:
ID3D11Texture2D_Release(slicedTexture);
return VLC_EGENERIC;
}
+
+#undef D3D11_Create
+int D3D11_Create(vlc_object_t *obj, d3d11_handle_t *hd3d)
+{
+#if !VLC_WINSTORE_APP
+ hd3d->hdll = LoadLibrary(TEXT("D3D11.DLL"));
+ if (!hd3d->hdll)
+ {
+ msg_Warn(obj, "cannot load d3d11.dll, aborting");
+ return VLC_EGENERIC;
+ }
+#endif
+ return VLC_SUCCESS;
+}
+
+void D3D11_Destroy(d3d11_handle_t *hd3d)
+{
+#if !VLC_WINSTORE_APP
+ if (hd3d->hdll)
+ FreeLibrary(hd3d->hdll);
+#endif
+}
diff --git a/modules/video_chroma/d3d11_fmt.h b/modules/video_chroma/d3d11_fmt.h
index fc15439b80..d5e0848eaf 100644
--- a/modules/video_chroma/d3d11_fmt.h
+++ b/modules/video_chroma/d3d11_fmt.h
@@ -88,6 +88,11 @@ HRESULT D3D11_CreateDevice(vlc_object_t *obj, d3d11_handle_t *,
void D3D11_ReleaseDevice(d3d11_device_t *);
+int D3D11_Create(vlc_object_t *, d3d11_handle_t *);
+#define D3D11_Create(a,b) D3D11_Create( VLC_OBJECT(a), b )
+
+void D3D11_Destroy(d3d11_handle_t *);
+
bool isXboxHardware(ID3D11Device *d3ddev);
bool isNvidiaHardware(ID3D11Device *d3ddev);
IDXGIAdapter *D3D11DeviceAdapter(ID3D11Device *d3ddev);
--
2.14.2
More information about the vlc-devel
mailing list