summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/hwdec_d3d11egl.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/opengl/hwdec_d3d11egl.c')
-rw-r--r--video/out/opengl/hwdec_d3d11egl.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/video/out/opengl/hwdec_d3d11egl.c b/video/out/opengl/hwdec_d3d11egl.c
index 762050359b..c3120914ea 100644
--- a/video/out/opengl/hwdec_d3d11egl.c
+++ b/video/out/opengl/hwdec_d3d11egl.c
@@ -86,7 +86,7 @@ static int init(struct ra_hwdec *hw)
struct priv_owner *p = hw->priv;
HRESULT hr;
- if (!ra_is_gl(hw->ra))
+ if (!ra_is_gl(hw->ra_ctx->ra))
return -1;
if (!angle_load())
return -1;
@@ -98,14 +98,14 @@ static int init(struct ra_hwdec *hw)
if (!eglGetCurrentContext())
return -1;
- GL *gl = ra_gl_get(hw->ra);
+ GL *gl = ra_gl_get(hw->ra_ctx->ra);
const char *exts = eglQueryString(egl_display, EGL_EXTENSIONS);
- if (!exts || !strstr(exts, "EGL_ANGLE_d3d_share_handle_client_buffer") ||
+ if (!gl_check_extension(exts, "EGL_ANGLE_d3d_share_handle_client_buffer") ||
!gl_check_extension(exts, "EGL_ANGLE_stream_producer_d3d_texture") ||
- !(strstr(gl->extensions, "GL_OES_EGL_image_external_essl3") ||
+ !(gl_check_extension(gl->extensions, "GL_OES_EGL_image_external_essl3") ||
gl->es == 200) ||
- !strstr(exts, "EGL_EXT_device_query") ||
+ !gl_check_extension(exts, "EGL_EXT_device_query") ||
!(gl->mpgl_caps & MPGL_CAP_TEX_RG))
return -1;
@@ -185,6 +185,12 @@ static int init(struct ra_hwdec *hw)
.supported_formats = subfmts,
.hw_imgfmt = IMGFMT_D3D11,
};
+
+ if (!p->hwctx.av_device_ref) {
+ MP_VERBOSE(hw, "Failed to create hwdevice_ctx\n");
+ return -1;
+ }
+
hwdec_devices_add(hw->devs, &p->hwctx);
return 0;