summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-05-17 10:59:11 +0200
committerwm4 <wm4@nowhere>2016-05-17 10:59:11 +0200
commit9b56bbecdf56e65e6aa6f6b3e3bab521c888043c (patch)
tree3bd28ea8be81c3a9f6cdaec18e8bbe81859148ff
parentb18a5984442163a5fca33b88af5684251437d7b5 (diff)
downloadmpv-9b56bbecdf56e65e6aa6f6b3e3bab521c888043c.tar.bz2
mpv-9b56bbecdf56e65e6aa6f6b3e3bab521c888043c.tar.xz
vo_opengl: hwdec: remove build-dependency on dxva2
wscript builds hwdec_dxva2gldx.c if gl-dxinterop is enabled, while video/dxva2.c depends on d3d-hwaccel. If d3d-hwaccel is disabled, then hwdec_dxva2gldx.c will fail to link, because it uses d3d9_surface_in_mp_image(), defined in dxva2.c. Fix this by removing the use of this function. It has barely any value at this point anyway. Just use the libavcodec documented way to get the surface directly. Fixes #3150.
-rw-r--r--video/out/opengl/hwdec_dxva2egl.c3
-rw-r--r--video/out/opengl/hwdec_dxva2gldx.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/video/out/opengl/hwdec_dxva2egl.c b/video/out/opengl/hwdec_dxva2egl.c
index be4c4d78ea..d67a85bff5 100644
--- a/video/out/opengl/hwdec_dxva2egl.c
+++ b/video/out/opengl/hwdec_dxva2egl.c
@@ -28,7 +28,6 @@
#include "osdep/timer.h"
#include "osdep/windows_utils.h"
#include "hwdec.h"
-#include "video/dxva2.h"
#include "video/hwdec.h"
struct priv {
@@ -292,7 +291,7 @@ static int map_frame(struct gl_hwdec *hw, struct mp_image *hw_image,
HRESULT hr;
RECT rc = {0, 0, hw_image->w, hw_image->h};
- IDirect3DSurface9* hw_surface = d3d9_surface_in_mp_image(hw_image);
+ IDirect3DSurface9* hw_surface = (IDirect3DSurface9 *)hw_image->planes[3];
hr = IDirect3DDevice9Ex_StretchRect(p->device9ex,
hw_surface, &rc,
p->surface9, &rc,
diff --git a/video/out/opengl/hwdec_dxva2gldx.c b/video/out/opengl/hwdec_dxva2gldx.c
index cf65748474..4cd8c1c0b2 100644
--- a/video/out/opengl/hwdec_dxva2gldx.c
+++ b/video/out/opengl/hwdec_dxva2gldx.c
@@ -22,7 +22,6 @@
#include "osdep/windows_utils.h"
#include "hwdec.h"
#include "video/hwdec.h"
-#include "video/dxva2.h"
// for WGL_ACCESS_READ_ONLY_NV
#include <GL/wglext.h>
@@ -182,7 +181,7 @@ static int map_frame(struct gl_hwdec *hw, struct mp_image *hw_image,
return -1;
}
- IDirect3DSurface9* hw_surface = d3d9_surface_in_mp_image(hw_image);
+ IDirect3DSurface9* hw_surface = (IDirect3DSurface9 *)hw_image->planes[3];
RECT rc = {0, 0, hw_image->w, hw_image->h};
hr = IDirect3DDevice9Ex_StretchRect(p->device,
hw_surface, &rc,