vlc | branch: master | Steve Lhomme <[email protected]> | Sat Nov 18 14:29:22 2017 +0100| [5a6f415d17faf8036af2e6ed488fbdb47583bd5f] | committer: Jean-Baptiste Kempf
d3d11_fmt: add D3D11_Create and D3D11_Destroy Similar to the D3D9 API Signed-off-by: Jean-Baptiste Kempf <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5a6f415d17faf8036af2e6ed488fbdb47583bd5f --- 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); _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
