diff options
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/d3d11/hwdec_d3d11va.c | 5 | ||||
-rw-r--r-- | video/out/opengl/hwdec_d3d11egl.c | 5 | ||||
-rw-r--r-- | video/out/opengl/hwdec_d3d11eglrgb.c | 10 |
3 files changed, 17 insertions, 3 deletions
diff --git a/video/out/d3d11/hwdec_d3d11va.c b/video/out/d3d11/hwdec_d3d11va.c index d83fdc57af..8d22fe3de5 100644 --- a/video/out/d3d11/hwdec_d3d11va.c +++ b/video/out/d3d11/hwdec_d3d11va.c @@ -104,9 +104,12 @@ static int init(struct ra_hwdec *hw) ID3D10Multithread_SetMultithreadProtected(multithread, TRUE); ID3D10Multithread_Release(multithread); + static const int subfmts[] = {IMGFMT_NV12, IMGFMT_P010, 0}; p->hwctx = (struct mp_hwdec_ctx){ .driver_name = hw->driver->name, .av_device_ref = d3d11_wrap_device_ref(p->device), + .supported_formats = subfmts, + .hw_imgfmt = IMGFMT_D3D11, }; hwdec_devices_add(hw->devs, &p->hwctx); return 0; @@ -236,7 +239,7 @@ static void mapper_unmap(struct ra_hwdec_mapper *mapper) const struct ra_hwdec_driver ra_hwdec_d3d11va = { .name = "d3d11va", .priv_size = sizeof(struct priv_owner), - .imgfmts = {IMGFMT_D3D11VA, IMGFMT_D3D11NV12, 0}, + .imgfmts = {IMGFMT_D3D11, 0}, .init = init, .uninit = uninit, .mapper = &(const struct ra_hwdec_mapper_driver){ diff --git a/video/out/opengl/hwdec_d3d11egl.c b/video/out/opengl/hwdec_d3d11egl.c index e7416330d7..f9a6700bb9 100644 --- a/video/out/opengl/hwdec_d3d11egl.c +++ b/video/out/opengl/hwdec_d3d11egl.c @@ -178,9 +178,12 @@ static int init(struct ra_hwdec *hw) ID3D10Multithread_SetMultithreadProtected(multithread, TRUE); ID3D10Multithread_Release(multithread); + static const int subfmts[] = {IMGFMT_NV12, 0}; p->hwctx = (struct mp_hwdec_ctx){ .driver_name = hw->driver->name, .av_device_ref = d3d11_wrap_device_ref(p->d3d11_device), + .supported_formats = subfmts, + .hw_imgfmt = IMGFMT_D3D11, }; hwdec_devices_add(hw->devs, &p->hwctx); @@ -332,7 +335,7 @@ static void mapper_unmap(struct ra_hwdec_mapper *mapper) const struct ra_hwdec_driver ra_hwdec_d3d11egl = { .name = "d3d11-egl", .priv_size = sizeof(struct priv_owner), - .imgfmts = {IMGFMT_D3D11NV12, 0}, + .imgfmts = {IMGFMT_D3D11, 0}, .init = init, .uninit = uninit, .mapper = &(const struct ra_hwdec_mapper_driver){ diff --git a/video/out/opengl/hwdec_d3d11eglrgb.c b/video/out/opengl/hwdec_d3d11eglrgb.c index c8f6580320..db7b1cfbee 100644 --- a/video/out/opengl/hwdec_d3d11eglrgb.c +++ b/video/out/opengl/hwdec_d3d11eglrgb.c @@ -135,9 +135,12 @@ static int init(struct ra_hwdec *hw) goto fail; } + static const int subfmts[] = {IMGFMT_RGB0, 0}; p->hwctx = (struct mp_hwdec_ctx){ .driver_name = hw->driver->name, .av_device_ref = d3d11_wrap_device_ref(p->d3d11_device), + .supported_formats = subfmts, + .hw_imgfmt = IMGFMT_D3D11, }; hwdec_devices_add(hw->devs, &p->hwctx); @@ -159,6 +162,11 @@ static int mapper_init(struct ra_hwdec_mapper *mapper) struct priv *p = mapper->priv; GL *gl = ra_gl_get(mapper->ra); + if (mapper->src_params.hw_subfmt != IMGFMT_RGB0) { + MP_FATAL(mapper, "Format not supported.\n"); + return -1; + } + gl->GenTextures(1, &p->gl_texture); gl->BindTexture(GL_TEXTURE_2D, p->gl_texture); gl->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); @@ -258,7 +266,7 @@ static int mapper_map(struct ra_hwdec_mapper *mapper) const struct ra_hwdec_driver ra_hwdec_d3d11eglrgb = { .name = "d3d11-egl-rgb", .priv_size = sizeof(struct priv_owner), - .imgfmts = {IMGFMT_D3D11RGB, 0}, + .imgfmts = {IMGFMT_D3D11, 0}, .init = init, .uninit = uninit, .mapper = &(const struct ra_hwdec_mapper_driver){ |