summaryrefslogtreecommitdiffstats
path: root/filters/filter.c
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2022-03-12 11:24:51 -0800
committerPhilip Langdale <github.philipl@overt.org>2022-09-21 09:39:34 -0700
commit989d873d6ec57171a55f432d6f87a9e5a61a706c (patch)
tree0077fcefc7be591eea5d6ad2e4e2373c8d59b49d /filters/filter.c
parent5629ed81eed90f95a04bb3d8ff64f135bd186651 (diff)
downloadmpv-989d873d6ec57171a55f432d6f87a9e5a61a706c.tar.bz2
mpv-989d873d6ec57171a55f432d6f87a9e5a61a706c.tar.xz
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 ```
Diffstat (limited to 'filters/filter.c')
-rw-r--r--filters/filter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/filters/filter.c b/filters/filter.c
index 2522209b49..eb757f5753 100644
--- a/filters/filter.c
+++ b/filters/filter.c
@@ -685,7 +685,7 @@ struct mp_stream_info *mp_filter_find_stream_info(struct mp_filter *f)
return NULL;
}
-struct AVBufferRef *mp_filter_load_hwdec_device(struct mp_filter *f, int imgfmt)
+struct mp_hwdec_ctx *mp_filter_load_hwdec_device(struct mp_filter *f, int imgfmt)
{
struct mp_stream_info *info = mp_filter_find_stream_info(f);
if (!info || !info->hwdec_devs)
@@ -697,7 +697,7 @@ struct AVBufferRef *mp_filter_load_hwdec_device(struct mp_filter *f, int imgfmt)
};
hwdec_devices_request_for_img_fmt(info->hwdec_devs, &params);
- return hwdec_devices_get_imgfmt(info->hwdec_devs, imgfmt);
+ return hwdec_devices_get_by_imgfmt(info->hwdec_devs, imgfmt);
}
static void filter_wakeup(struct mp_filter *f, bool mark_only)