summaryrefslogtreecommitdiffstats
path: root/video/out/gpu/hwdec.h
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 /video/out/gpu/hwdec.h
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 'video/out/gpu/hwdec.h')
-rw-r--r--video/out/gpu/hwdec.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/video/out/gpu/hwdec.h b/video/out/gpu/hwdec.h
index 34f8bc7856..0dd2e14588 100644
--- a/video/out/gpu/hwdec.h
+++ b/video/out/gpu/hwdec.h
@@ -20,6 +20,10 @@ struct ra_hwdec_ctx {
int ra_hwdec_validate_opt(struct mp_log *log, const m_option_t *opt,
struct bstr name, const char **value);
+int ra_hwdec_validate_drivers_only_opt(struct mp_log *log,
+ const m_option_t *opt,
+ struct bstr name, const char **value);
+
void ra_hwdec_ctx_init(struct ra_hwdec_ctx *ctx, struct mp_hwdec_devices *devs,
const char *opt, bool load_all_by_default);
void ra_hwdec_ctx_uninit(struct ra_hwdec_ctx *ctx);
@@ -143,4 +147,8 @@ void ra_hwdec_mapper_free(struct ra_hwdec_mapper **mapper);
void ra_hwdec_mapper_unmap(struct ra_hwdec_mapper *mapper);
int ra_hwdec_mapper_map(struct ra_hwdec_mapper *mapper, struct mp_image *img);
+// Get the primary image format for the given driver name.
+// Returns IMGFMT_NONE if the name doesn't get matched.
+int ra_hwdec_driver_get_imgfmt_for_name(const char *name);
+
#endif