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.
This commit is contained in:
wm4 2017-12-01 05:09:05 +01:00
parent 91586c3592
commit 7e87feaf15
13 changed files with 3 additions and 18 deletions

View File

@ -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,

View File

@ -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);

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,