diff options
author | Niklas Haas <git@nand.wakku.to> | 2015-08-29 04:12:56 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-09-09 18:09:31 +0200 |
commit | 44eda2177d8facb1cd064c164b16e9027529d164 (patch) | |
tree | 7f3d77dd5aa4757fdd6e062cc6ff5613151afb3d /video/out/opengl/hwdec_dxva2.c | |
parent | deebc55014074fef121c1df6b117e9c0bf97d516 (diff) | |
download | mpv-44eda2177d8facb1cd064c164b16e9027529d164.tar.bz2 mpv-44eda2177d8facb1cd064c164b16e9027529d164.tar.xz |
vo_opengl: remove gl_ prefixes from files in video/out/opengl
This is a bit redundant with the name of the directory itself, and not
in line with existing naming conventions.
Diffstat (limited to 'video/out/opengl/hwdec_dxva2.c')
-rw-r--r-- | video/out/opengl/hwdec_dxva2.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/video/out/opengl/hwdec_dxva2.c b/video/out/opengl/hwdec_dxva2.c new file mode 100644 index 0000000000..f6b3ac0e74 --- /dev/null +++ b/video/out/opengl/hwdec_dxva2.c @@ -0,0 +1,64 @@ +#include "common/common.h" + +#include "hwdec.h" +#include "utils.h" +#include "video/d3d.h" +#include "video/hwdec.h" + +// This does not provide real (zero-copy) interop - it merely exists for +// making sure the same D3D device is used for decoding and display, which +// may help with OpenGL fullscreen mode. + +struct priv { + struct mp_d3d_ctx ctx; +}; + +static void destroy(struct gl_hwdec *hw) +{ + struct priv *p = hw->priv; + if (p->ctx.d3d9_device) + IDirect3DDevice9_Release(p->ctx.d3d9_device); +} + +static int create(struct gl_hwdec *hw) +{ + GL *gl = hw->gl; + if (hw->hwctx || !gl->MPGetD3DInterface) + return -1; + + struct priv *p = talloc_zero(hw, struct priv); + hw->priv = p; + + p->ctx.d3d9_device = gl->MPGetD3DInterface("IDirect3DDevice9"); + if (!p->ctx.d3d9_device) + return -1; + + p->ctx.hwctx.type = HWDEC_DXVA2_COPY; + p->ctx.hwctx.d3d_ctx = &p->ctx; + + MP_VERBOSE(hw, "Using libmpv supplied device %p.\n", p->ctx.d3d9_device); + + hw->hwctx = &p->ctx.hwctx; + hw->converted_imgfmt = 0; + return 0; +} + +static int reinit(struct gl_hwdec *hw, struct mp_image_params *params) +{ + return -1; +} + +static int map_image(struct gl_hwdec *hw, struct mp_image *hw_image, + GLuint *out_textures) +{ + return -1; +} + +const struct gl_hwdec_driver gl_hwdec_dxva2 = { + .api_name = "dxva2", + .imgfmt = -1, + .create = create, + .reinit = reinit, + .map_image = map_image, + .destroy = destroy, +}; |