diff options
author | wm4 <wm4@nowhere> | 2015-07-03 15:58:19 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-07-03 16:04:42 +0200 |
commit | b85321d0573ba581694d2e6be1effafee74c11d1 (patch) | |
tree | aabed80d8c8ec801ff358150da9b1ca0b6f615d4 /video/decode | |
parent | b6dc11810b78953d95a75d745d7327a796f0b462 (diff) | |
download | mpv-b85321d0573ba581694d2e6be1effafee74c11d1.tar.bz2 mpv-b85321d0573ba581694d2e6be1effafee74c11d1.tar.xz |
vo_direct3d, dxva2: use the same D3D device
Since we still read-back (and don't have hard plans on changing this),
this doesn't have much of an advantage.
Diffstat (limited to 'video/decode')
-rw-r--r-- | video/decode/dxva2.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/video/decode/dxva2.c b/video/decode/dxva2.c index 852319611d..62b27671ef 100644 --- a/video/decode/dxva2.c +++ b/video/decode/dxva2.c @@ -36,6 +36,7 @@ #include "video/fmt-conversion.h" #include "video/mp_image_pool.h" #include "video/hwdec.h" +#include "video/d3d.h" #include "gpu_memcpy_sse4.h" // A minor evil. @@ -341,6 +342,15 @@ static int create_device(struct lavc_ctx *s) D3DDISPLAYMODE d3ddm; UINT adapter = D3DADAPTER_DEFAULT; + if (s->hwdec_info && s->hwdec_info->hwctx && s->hwdec_info->hwctx->d3d_ctx) { + ctx->d3d9device = s->hwdec_info->hwctx->d3d_ctx->d3d9_device; + if (ctx->d3d9device) { + IDirect3D9_AddRef(ctx->d3d9device); + MP_VERBOSE(ctx, "Using VO-supplied device %p.\n", ctx->d3d9device); + return 0; + } + } + ctx->d3dlib = LoadLibrary(L"d3d9.dll"); if (!ctx->d3dlib) { MP_ERR(ctx, "Failed to load D3D9 library\n"); |