diff options
author | Philip Langdale <philipl@overt.org> | 2022-03-18 11:22:12 -0700 |
---|---|---|
committer | Philip Langdale <github.philipl@overt.org> | 2022-09-21 09:39:34 -0700 |
commit | 5629ed81eed90f95a04bb3d8ff64f135bd186651 (patch) | |
tree | 1749b94103493f83f3f19540491305fef5fe6d6f | |
parent | e50db4292795de511531e764d7e609c1a37a204f (diff) | |
download | mpv-5629ed81eed90f95a04bb3d8ff64f135bd186651.tar.bz2 mpv-5629ed81eed90f95a04bb3d8ff64f135bd186651.tar.xz |
filters: support loading new hwdec_interops from filters
If we want to be able to handle conversion between hw formats in filter
chains, then we need to be able to load hwdec_interops from filters, as
the VO is only ever going to initialise one interop, based on its
configuration. That means that in almost all situations, only one of
the required interops will be loaded at the time the filter is
initialised.
The existing code has some assumptions that new hwdec_interops will not
be loaded after the vo has picked one to use. This change fixes two
instances:
* Refusing to load a new hwdec_interop if there is at least one
loaded already.
* Not recalculating the set of formats known to the autoconvert
filter when a new output format shows up. This leads to autoconvert
not knowing that a new format is supported when the hwdec interop is
lazily loaded.
-rw-r--r-- | filters/f_output_chain.c | 12 | ||||
-rw-r--r-- | video/hwdec.c | 2 | ||||
-rw-r--r-- | video/out/gpu/hwdec.c | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/filters/f_output_chain.c b/filters/f_output_chain.c index 468bfe6466..de01c954d7 100644 --- a/filters/f_output_chain.c +++ b/filters/f_output_chain.c @@ -106,16 +106,16 @@ static void check_in_format_change(struct mp_user_filter *u, if (u == p->input) { p->public.input_params = img->params; - - // Unfortunately there's no good place to update these. - // But a common case is enabling HW decoding, which - // might init some support of them in the VO, and update - // the VO's format list. - update_output_caps(p); } else if (u == p->output) { p->public.output_params = img->params; } + // Unfortunately there's no good place to update these. + // But a common case is enabling HW decoding, which + // might init some support of them in the VO, and update + // the VO's format list. + update_output_caps(p); + p->public.reconfig_happened = true; } } diff --git a/video/hwdec.c b/video/hwdec.c index 1b15c95c64..246117a4f1 100644 --- a/video/hwdec.c +++ b/video/hwdec.c @@ -94,7 +94,7 @@ void hwdec_devices_set_loader(struct mp_hwdec_devices *devs, void hwdec_devices_request_for_img_fmt(struct mp_hwdec_devices *devs, struct hwdec_imgfmt_request *params) { - if (devs->load_api && !hwdec_devices_get_first(devs)) + if (devs->load_api) devs->load_api(devs->load_api_ctx, params); } diff --git a/video/out/gpu/hwdec.c b/video/out/gpu/hwdec.c index 4217bad16a..9b994bc0a1 100644 --- a/video/out/gpu/hwdec.c +++ b/video/out/gpu/hwdec.c @@ -244,7 +244,7 @@ void ra_hwdec_ctx_init(struct ra_hwdec_ctx *ctx, struct mp_hwdec_devices *devs, * obviously no interops will need to be loaded later. * * Finally, if a specific interop is requested, it will be loaded now, and - * no other interop will be loaded, even if requested later. + * other interops can be loaded, if requested later. */ if (!type || !type[0] || strcmp(type, "auto") == 0) { if (!load_all_by_default) |