From 7e87feaf15d5ab99473d13856bb247a0ed10e521 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 1 Dec 2017 05:09:05 +0100 Subject: vo_gpu: hwdec: remove redundant fields The testing_only field is not referenced anymore with vaglx removed and the previous commit dropping all uses. The ra_hwdec_driver.api field became unused with the previous commit, but all hwdec interop drivers still initialized it. Since this touches highly OS-specific code, build regressions are possible (plus the previous commit might break hw decoding at runtime). At least hwdec_cuda.c still used the .api field, other than initializing it. --- video/out/d3d11/hwdec_d3d11va.c | 1 - video/out/gpu/hwdec.h | 7 ++----- video/out/opengl/hwdec_cuda.c | 3 +-- video/out/opengl/hwdec_d3d11egl.c | 1 - video/out/opengl/hwdec_d3d11eglrgb.c | 1 - video/out/opengl/hwdec_drmprime_drm.c | 1 - video/out/opengl/hwdec_dxva2egl.c | 1 - video/out/opengl/hwdec_dxva2gldx.c | 1 - video/out/opengl/hwdec_ios.m | 1 - video/out/opengl/hwdec_osx.c | 1 - video/out/opengl/hwdec_rpi.c | 1 - video/out/opengl/hwdec_vaegl.c | 1 - video/out/opengl/hwdec_vdpau.c | 1 - 13 files changed, 3 insertions(+), 18 deletions(-) diff --git a/video/out/d3d11/hwdec_d3d11va.c b/video/out/d3d11/hwdec_d3d11va.c index 7de24dde28..d6cbe31bdc 100644 --- a/video/out/d3d11/hwdec_d3d11va.c +++ b/video/out/d3d11/hwdec_d3d11va.c @@ -239,7 +239,6 @@ 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), - .api = HWDEC_D3D11VA, .imgfmts = {IMGFMT_D3D11VA, IMGFMT_D3D11NV12, 0}, .init = init, .uninit = uninit, diff --git a/video/out/gpu/hwdec.h b/video/out/gpu/hwdec.h index 0ff6056bfd..258ab881b6 100644 --- a/video/out/gpu/hwdec.h +++ b/video/out/gpu/hwdec.h @@ -72,17 +72,14 @@ struct ra_hwdec_mapper_driver { }; struct ra_hwdec_driver { - // Name of the interop backend. This is used for informational purposes only. + // Name of the interop backend. This is used for informational purposes and + // for use with debugging options. const char *name; // Used to create ra_hwdec.priv. size_t priv_size; - // Used to explicitly request a specific API. - enum hwdec_type api; // One of the hardware surface IMGFMT_ that must be passed to map_image later. // Terminated with a 0 entry. (Extend the array size as needed.) const int imgfmts[3]; - // Dosn't load this unless requested by name. - bool testing_only; // Create the hwdec device. It must add it to hw->devs, if applicable. int (*init)(struct ra_hwdec *hw); diff --git a/video/out/opengl/hwdec_cuda.c b/video/out/opengl/hwdec_cuda.c index 321826eb49..b74f02f707 100644 --- a/video/out/opengl/hwdec_cuda.c +++ b/video/out/opengl/hwdec_cuda.c @@ -160,7 +160,7 @@ static int cuda_init(struct ra_hwdec *hw) goto error; p->hwctx = (struct mp_hwdec_ctx) { - .type = hw->driver->api, + .type = HWDEC_CUDA, .ctx = p->decode_ctx, .av_device_ref = hw_device_ctx, }; @@ -327,7 +327,6 @@ static int mapper_map(struct ra_hwdec_mapper *mapper) const struct ra_hwdec_driver ra_hwdec_cuda = { .name = "cuda-nvdec", - .api = HWDEC_CUDA, .imgfmts = {IMGFMT_CUDA, 0}, .priv_size = sizeof(struct priv_owner), .init = cuda_init, diff --git a/video/out/opengl/hwdec_d3d11egl.c b/video/out/opengl/hwdec_d3d11egl.c index 1c3d412dbb..ca49a5d0e6 100644 --- a/video/out/opengl/hwdec_d3d11egl.c +++ b/video/out/opengl/hwdec_d3d11egl.c @@ -335,7 +335,6 @@ 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), - .api = HWDEC_D3D11VA, .imgfmts = {IMGFMT_D3D11NV12, 0}, .init = init, .uninit = uninit, diff --git a/video/out/opengl/hwdec_d3d11eglrgb.c b/video/out/opengl/hwdec_d3d11eglrgb.c index 46264ac1bf..0e201f7a6d 100644 --- a/video/out/opengl/hwdec_d3d11eglrgb.c +++ b/video/out/opengl/hwdec_d3d11eglrgb.c @@ -261,7 +261,6 @@ 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), - .api = HWDEC_D3D11VA, .imgfmts = {IMGFMT_D3D11RGB, 0}, .init = init, .uninit = uninit, diff --git a/video/out/opengl/hwdec_drmprime_drm.c b/video/out/opengl/hwdec_drmprime_drm.c index 45e6c908c0..db624adfb4 100644 --- a/video/out/opengl/hwdec_drmprime_drm.c +++ b/video/out/opengl/hwdec_drmprime_drm.c @@ -257,7 +257,6 @@ err: const struct ra_hwdec_driver ra_hwdec_drmprime_drm = { .name = "drmprime-drm", - .api = HWDEC_RKMPP, .priv_size = sizeof(struct priv), .imgfmts = {IMGFMT_DRMPRIME, 0}, .init = init, diff --git a/video/out/opengl/hwdec_dxva2egl.c b/video/out/opengl/hwdec_dxva2egl.c index 6a92eb8934..298c1eb4ef 100644 --- a/video/out/opengl/hwdec_dxva2egl.c +++ b/video/out/opengl/hwdec_dxva2egl.c @@ -368,7 +368,6 @@ static int mapper_map(struct ra_hwdec_mapper *mapper) const struct ra_hwdec_driver ra_hwdec_dxva2egl = { .name = "dxva2-egl", .priv_size = sizeof(struct priv_owner), - .api = HWDEC_DXVA2, .imgfmts = {IMGFMT_DXVA2, 0}, .init = init, .uninit = uninit, diff --git a/video/out/opengl/hwdec_dxva2gldx.c b/video/out/opengl/hwdec_dxva2gldx.c index 0b3e30fbb1..46f3b23df7 100644 --- a/video/out/opengl/hwdec_dxva2gldx.c +++ b/video/out/opengl/hwdec_dxva2gldx.c @@ -229,7 +229,6 @@ static int mapper_map(struct ra_hwdec_mapper *mapper) const struct ra_hwdec_driver ra_hwdec_dxva2gldx = { .name = "dxva2-dxinterop", .priv_size = sizeof(struct priv_owner), - .api = HWDEC_DXVA2, .imgfmts = {IMGFMT_DXVA2, 0}, .init = init, .uninit = uninit, diff --git a/video/out/opengl/hwdec_ios.m b/video/out/opengl/hwdec_ios.m index b55230292e..4d41827e03 100644 --- a/video/out/opengl/hwdec_ios.m +++ b/video/out/opengl/hwdec_ios.m @@ -262,7 +262,6 @@ static void mapper_uninit(struct ra_hwdec_mapper *mapper) const struct ra_hwdec_driver ra_hwdec_videotoolbox = { .name = "videotoolbox", .priv_size = sizeof(struct priv_owner), - .api = HWDEC_VIDEOTOOLBOX, .imgfmts = {IMGFMT_VIDEOTOOLBOX, 0}, .init = init, .uninit = uninit, diff --git a/video/out/opengl/hwdec_osx.c b/video/out/opengl/hwdec_osx.c index 0e72f1511c..9980e8483b 100644 --- a/video/out/opengl/hwdec_osx.c +++ b/video/out/opengl/hwdec_osx.c @@ -210,7 +210,6 @@ static void mapper_uninit(struct ra_hwdec_mapper *mapper) const struct ra_hwdec_driver ra_hwdec_videotoolbox = { .name = "videotoolbox", .priv_size = sizeof(struct priv_owner), - .api = HWDEC_VIDEOTOOLBOX, .imgfmts = {IMGFMT_VIDEOTOOLBOX, 0}, .init = init, .uninit = uninit, diff --git a/video/out/opengl/hwdec_rpi.c b/video/out/opengl/hwdec_rpi.c index ea8312a179..6c080f1942 100644 --- a/video/out/opengl/hwdec_rpi.c +++ b/video/out/opengl/hwdec_rpi.c @@ -378,7 +378,6 @@ static int create(struct ra_hwdec *hw) const struct ra_hwdec_driver ra_hwdec_rpi_overlay = { .name = "rpi-overlay", - .api = HWDEC_RPI, .priv_size = sizeof(struct priv), .imgfmts = {IMGFMT_MMAL, IMGFMT_420P, 0}, .init = create, diff --git a/video/out/opengl/hwdec_vaegl.c b/video/out/opengl/hwdec_vaegl.c index 2e21bc512e..597b81a2b5 100644 --- a/video/out/opengl/hwdec_vaegl.c +++ b/video/out/opengl/hwdec_vaegl.c @@ -544,7 +544,6 @@ done: const struct ra_hwdec_driver ra_hwdec_vaegl = { .name = "vaapi-egl", .priv_size = sizeof(struct priv_owner), - .api = HWDEC_VAAPI, .imgfmts = {IMGFMT_VAAPI, 0}, .init = init, .uninit = uninit, diff --git a/video/out/opengl/hwdec_vdpau.c b/video/out/opengl/hwdec_vdpau.c index e0618e425e..603a70eb93 100644 --- a/video/out/opengl/hwdec_vdpau.c +++ b/video/out/opengl/hwdec_vdpau.c @@ -304,7 +304,6 @@ static int mapper_map(struct ra_hwdec_mapper *mapper) const struct ra_hwdec_driver ra_hwdec_vdpau = { .name = "vdpau-glx", .priv_size = sizeof(struct priv_owner), - .api = HWDEC_VDPAU, .imgfmts = {IMGFMT_VDPAU, 0}, .init = init, .uninit = uninit, -- cgit v1.2.3