diff options
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/drm_common.c | 3 | ||||
-rw-r--r-- | video/out/gpu/context.c | 6 | ||||
-rw-r--r-- | video/out/gpu/d3d11_helpers.h | 4 | ||||
-rw-r--r-- | video/out/gpu/hwdec.h | 8 | ||||
-rw-r--r-- | video/out/gpu/lcms.c | 3 | ||||
-rw-r--r-- | video/out/gpu/video.c | 11 | ||||
-rw-r--r-- | video/out/vulkan/context.c | 3 |
7 files changed, 11 insertions, 27 deletions
diff --git a/video/out/drm_common.c b/video/out/drm_common.c index da45ca27a3..1669e249eb 100644 --- a/video/out/drm_common.c +++ b/video/out/drm_common.c @@ -65,8 +65,7 @@ static int drm_connector_opt_help(struct mp_log *log, const struct m_option *opt static int drm_mode_opt_help(struct mp_log *log, const struct m_option *opt, struct bstr name); -static int drm_validate_mode_opt(struct mp_log *log, const struct m_option *opt, - struct bstr name, const char **value); +static OPT_STRING_VALIDATE_FUNC(drm_validate_mode_opt); static void drm_show_available_modes(struct mp_log *log, const drmModeConnector *connector); diff --git a/video/out/gpu/context.c b/video/out/gpu/context.c index d842ddda91..88d4f4232d 100644 --- a/video/out/gpu/context.c +++ b/video/out/gpu/context.c @@ -129,8 +129,7 @@ static int ra_ctx_api_help(struct mp_log *log, const struct m_option *opt, return M_OPT_EXIT; } -static int ra_ctx_validate_api(struct mp_log *log, const struct m_option *opt, - struct bstr name, const char **value) +static inline OPT_STRING_VALIDATE_FUNC(ra_ctx_validate_api) { struct bstr param = bstr0(*value); if (bstr_equals0(param, "auto")) @@ -154,8 +153,7 @@ static int ra_ctx_context_help(struct mp_log *log, const struct m_option *opt, return M_OPT_EXIT; } -static int ra_ctx_validate_context(struct mp_log *log, const struct m_option *opt, - struct bstr name, const char **value) +static inline OPT_STRING_VALIDATE_FUNC(ra_ctx_validate_context) { struct bstr param = bstr0(*value); if (bstr_equals0(param, "auto")) diff --git a/video/out/gpu/d3d11_helpers.h b/video/out/gpu/d3d11_helpers.h index c6954a7a4a..5ba013e747 100644 --- a/video/out/gpu/d3d11_helpers.h +++ b/video/out/gpu/d3d11_helpers.h @@ -69,9 +69,7 @@ IDXGIAdapter1 *mp_get_dxgi_adapter(struct mp_log *log, bstr requested_adapter_name, bstr *listing); -int mp_dxgi_validate_adapter(struct mp_log *log, - const struct m_option *opt, - struct bstr name, const char **value); +OPT_STRING_VALIDATE_FUNC(mp_dxgi_validate_adapter); bool mp_dxgi_list_or_verify_adapters(struct mp_log *log, bstr adapter_name, diff --git a/video/out/gpu/hwdec.h b/video/out/gpu/hwdec.h index 7766073e0c..f195606417 100644 --- a/video/out/gpu/hwdec.h +++ b/video/out/gpu/hwdec.h @@ -18,12 +18,8 @@ struct ra_hwdec_ctx { int num_hwdecs; }; -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); +OPT_STRING_VALIDATE_FUNC(ra_hwdec_validate_opt); +OPT_STRING_VALIDATE_FUNC(ra_hwdec_validate_drivers_only_opt); void ra_hwdec_ctx_init(struct ra_hwdec_ctx *ctx, struct mp_hwdec_devices *devs, const char *opt, bool load_all_by_default); diff --git a/video/out/gpu/lcms.c b/video/out/gpu/lcms.c index 1e451aa7a2..e8fe1d48c3 100644 --- a/video/out/gpu/lcms.c +++ b/video/out/gpu/lcms.c @@ -494,8 +494,7 @@ bool gl_lcms_get_lut3d(struct gl_lcms *p, struct lut3d **result_lut3d, #endif -static int validate_3dlut_size_opt(struct mp_log *log, const m_option_t *opt, - struct bstr name, const char **value) +static inline OPT_STRING_VALIDATE_FUNC(validate_3dlut_size_opt) { int p1, p2, p3; return gl_parse_3dlut_size(*value, &p1, &p2, &p3) ? 0 : M_OPT_INVALID; diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c index 07a2bf8947..1de9ae8cd5 100644 --- a/video/out/gpu/video.c +++ b/video/out/gpu/video.c @@ -329,14 +329,9 @@ static const struct gl_video_opts gl_video_opts_def = { .hwdec_interop = "auto", }; -static int validate_scaler_opt(struct mp_log *log, const m_option_t *opt, - struct bstr name, const char **value); - -static int validate_window_opt(struct mp_log *log, const m_option_t *opt, - struct bstr name, const char **value); - -static int validate_error_diffusion_opt(struct mp_log *log, const m_option_t *opt, - struct bstr name, const char **value); +static OPT_STRING_VALIDATE_FUNC(validate_scaler_opt); +static OPT_STRING_VALIDATE_FUNC(validate_window_opt); +static OPT_STRING_VALIDATE_FUNC(validate_error_diffusion_opt); #define OPT_BASE_STRUCT struct gl_video_opts diff --git a/video/out/vulkan/context.c b/video/out/vulkan/context.c index 5087403ade..f04895a2ae 100644 --- a/video/out/vulkan/context.c +++ b/video/out/vulkan/context.c @@ -37,8 +37,7 @@ struct vulkan_opts { bool async_compute; }; -static int vk_validate_dev(struct mp_log *log, const struct m_option *opt, - struct bstr name, const char **value) +static inline OPT_STRING_VALIDATE_FUNC(vk_validate_dev) { struct bstr param = bstr0(*value); int ret = M_OPT_INVALID; |