mirror of
https://github.com/mpv-player/mpv
synced 2025-02-16 20:27:23 +00:00
vo_opengl: remove dxva2 dummy hwdec backend
This was a hack to let libmpv API users pass a d3d device to mpv. It's not needed anymore for 2 reasons: 1. ANGLE does not have this problem 2. Even native GL via nVidia (where this failed) seems to not require this anymore
This commit is contained in:
parent
4f74b93546
commit
6e2d3d9919
@ -19,6 +19,9 @@ Interface changes
|
||||
|
||||
::
|
||||
|
||||
--- mpv 0.25.0 ---
|
||||
- remove opengl-cb dxva2 dummy hwdec interop
|
||||
(see git "vo_opengl: remove dxva2 dummy hwdec backend")
|
||||
--- mpv 0.24.0 ---
|
||||
- deprecate --hwdec-api and replace it with --opengl-hwdec-interop.
|
||||
The new option accepts both --hwdec values, as well as named backends.
|
||||
|
@ -174,26 +174,9 @@ extern "C" {
|
||||
* Windowing system interop on MS win32
|
||||
* ------------------------------------
|
||||
*
|
||||
* Warning: the following is only required if native OpenGL instead of ANGLE
|
||||
* is used. ANGLE is recommended, because it also allows direct
|
||||
* hardware decoding interop without further setup by the libmpv
|
||||
* API user, while the same with native OpenGL is either very hard
|
||||
* to do (via GL/DX interop with D3D9), or not implemented.
|
||||
*
|
||||
* If OpenGL switches to fullscreen, most players give it access GPU access,
|
||||
* which means DXVA2 hardware decoding in mpv won't work. This can be worked
|
||||
* around by giving mpv access to Direct3D device, which it will then use to
|
||||
* create a decoder. The device can be either the real device used for display,
|
||||
* or a "blank" device created before switching to fullscreen.
|
||||
*
|
||||
* You can provide glMPGetNativeDisplay as described in the previous section.
|
||||
* If it is called with name set to "IDirect3DDevice9", it should return a
|
||||
* IDirect3DDevice9 pointer (or NULL if not available). libmpv will release
|
||||
* this interface when it is done with it.
|
||||
*
|
||||
* In previous libmpv releases, this used "GL_MP_D3D_interfaces" and
|
||||
* "glMPGetD3DInterface". This is deprecated; use glMPGetNativeDisplay instead
|
||||
* (the semantics are 100% compatible).
|
||||
* You should use ANGLE, and make sure your application and libmpv are linked
|
||||
* to the same ANGLE DLLs. libmpv will pick the device context (needed for
|
||||
* hardware decoding) from the current ANGLE EGL context.
|
||||
*
|
||||
* Windowing system interop on RPI
|
||||
* -------------------------------
|
||||
|
@ -59,7 +59,6 @@ static const struct gl_hwdec_driver *const mpgl_hwdec_drivers[] = {
|
||||
#if HAVE_GL_DXINTEROP
|
||||
&gl_hwdec_dxva2gldx,
|
||||
#endif
|
||||
&gl_hwdec_dxva2,
|
||||
#endif
|
||||
#if HAVE_CUDA_HWACCEL
|
||||
&gl_hwdec_cuda,
|
||||
|
@ -1,68 +0,0 @@
|
||||
#include <d3d9.h>
|
||||
|
||||
#include "common/common.h"
|
||||
|
||||
#include "hwdec.h"
|
||||
#include "utils.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_hwdec_ctx hwctx;
|
||||
};
|
||||
|
||||
static void destroy(struct gl_hwdec *hw)
|
||||
{
|
||||
struct priv *p = hw->priv;
|
||||
hwdec_devices_remove(hw->devs, &p->hwctx);
|
||||
if (p->hwctx.ctx)
|
||||
IDirect3DDevice9_Release((IDirect3DDevice9 *)p->hwctx.ctx);
|
||||
}
|
||||
|
||||
static int create(struct gl_hwdec *hw)
|
||||
{
|
||||
GL *gl = hw->gl;
|
||||
if (!gl->MPGetNativeDisplay)
|
||||
return -1;
|
||||
|
||||
struct priv *p = talloc_zero(hw, struct priv);
|
||||
hw->priv = p;
|
||||
|
||||
IDirect3DDevice9 *d3d = gl->MPGetNativeDisplay("IDirect3DDevice9");
|
||||
if (!d3d)
|
||||
return -1;
|
||||
|
||||
MP_VERBOSE(hw, "Using libmpv supplied device %p.\n", d3d);
|
||||
|
||||
p->hwctx = (struct mp_hwdec_ctx){
|
||||
.type = HWDEC_DXVA2_COPY,
|
||||
.driver_name = hw->driver->name,
|
||||
.ctx = d3d,
|
||||
};
|
||||
hwdec_devices_add(hw->devs, &p->hwctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int reinit(struct gl_hwdec *hw, struct mp_image_params *params)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int map_frame(struct gl_hwdec *hw, struct mp_image *hw_image,
|
||||
struct gl_hwdec_frame *out_frame)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
const struct gl_hwdec_driver gl_hwdec_dxva2 = {
|
||||
.name = "dxva2-dummy",
|
||||
.api = HWDEC_DXVA2_COPY,
|
||||
.imgfmt = -1,
|
||||
.create = create,
|
||||
.reinit = reinit,
|
||||
.map_frame = map_frame,
|
||||
.destroy = destroy,
|
||||
};
|
@ -366,7 +366,6 @@ def build(ctx):
|
||||
( "video/out/opengl/hwdec_cuda.c", "cuda-hwaccel" ),
|
||||
( "video/out/opengl/hwdec_d3d11egl.c", "egl-angle" ),
|
||||
( "video/out/opengl/hwdec_d3d11eglrgb.c","egl-angle" ),
|
||||
( "video/out/opengl/hwdec_dxva2.c", "gl-win32" ),
|
||||
( "video/out/opengl/hwdec_dxva2gldx.c", "gl-dxinterop" ),
|
||||
( "video/out/opengl/hwdec_dxva2egl.c", "egl-angle" ),
|
||||
( "video/out/opengl/hwdec_osx.c", "videotoolbox-gl" ),
|
||||
|
Loading…
Reference in New Issue
Block a user