From 989d873d6ec57171a55f432d6f87a9e5a61a706c Mon Sep 17 00:00:00 2001 From: Philip Langdale Date: Sat, 12 Mar 2022 11:24:51 -0800 Subject: filters: lavfi: allow hwdec_interop selection for filters Today, lavfi filters are provided a hw_device from the first hwdec_interop that was loaded, regardless of whether it's the right one or not. In most situations where a hardware based filter is used, we need more control over the device. In this change, a `hwdec_interop` option is added to the lavfi wrapper filter configuration and this is used to pick the correct hw_device to inject into the filter or graph (in the case of a graph, all filters get the same device). Note that this requires the use of the explicit lavfi syntax to allow for the extra configuration. eg: ``` mpv --vf=hwupload ``` becomes ``` mpv --vf=lavfi=[hwupload]:hwdec_interop=cuda-nvdec ``` or ``` mpv --vf=lavfi-bridge=[hwupload]:hwdec_interop=cuda-nvdec ``` --- player/loadfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'player') diff --git a/player/loadfile.c b/player/loadfile.c index a4ef62f2aa..da0d8b3a28 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -1257,7 +1257,7 @@ static int reinit_complex_filters(struct MPContext *mpctx, bool force_uninit) } struct mp_lavfi *l = - mp_lavfi_create_graph(mpctx->filter_root, 0, false, NULL, graph); + mp_lavfi_create_graph(mpctx->filter_root, 0, false, NULL, NULL, graph); if (!l) goto done; mpctx->lavfi = l->f; -- cgit v1.2.3