summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
Diffstat (limited to 'video')
-rw-r--r--video/csputils.c19
-rw-r--r--video/decode/vd_lavc.c43
-rw-r--r--video/filter/vf_d3d11vpp.c18
-rw-r--r--video/filter/vf_fingerprint.c6
-rw-r--r--video/filter/vf_format.c36
-rw-r--r--video/filter/vf_gpu.c4
-rw-r--r--video/filter/vf_sub.c4
-rw-r--r--video/filter/vf_vapoursynth.c9
-rw-r--r--video/filter/vf_vavpp.c22
-rw-r--r--video/filter/vf_vdpaupp.c26
-rw-r--r--video/image_writer.c20
-rw-r--r--video/out/android_common.c3
-rw-r--r--video/out/d3d11/context.c60
-rw-r--r--video/out/d3d11/hwdec_d3d11va.c2
-rw-r--r--video/out/drm_common.c42
-rw-r--r--video/out/gpu/lcms.c20
-rw-r--r--video/out/gpu/spirv.c2
-rw-r--r--video/out/gpu/video.c212
-rw-r--r--video/out/gpu/video_shaders.c8
-rw-r--r--video/out/opengl/context.c29
-rw-r--r--video/out/opengl/context_angle.c40
-rw-r--r--video/out/opengl/context_cocoa.c2
-rw-r--r--video/out/vo_direct3d.c30
-rw-r--r--video/out/vo_gpu.c8
-rw-r--r--video/out/vo_image.c4
-rw-r--r--video/out/vo_null.c2
-rw-r--r--video/out/vo_rpi.c8
-rw-r--r--video/out/vo_sdl.c6
-rw-r--r--video/out/vo_tct.c12
-rw-r--r--video/out/vo_vaapi.c12
-rw-r--r--video/out/vo_vdpau.c38
-rw-r--r--video/out/vo_xv.c28
-rw-r--r--video/out/vulkan/context.c20
-rw-r--r--video/out/wayland_common.c8
-rw-r--r--video/sws_utils.c42
-rw-r--r--video/vaapi.c2
-rw-r--r--video/zimg.c27
37 files changed, 440 insertions, 434 deletions
diff --git a/video/csputils.c b/video/csputils.c
index 98c5c96c39..cc9aa4d64a 100644
--- a/video/csputils.c
+++ b/video/csputils.c
@@ -821,13 +821,18 @@ bool mp_colorspace_equal(struct mp_colorspace c1, struct mp_colorspace c2)
const struct m_sub_options mp_csp_equalizer_conf = {
.opts = (const m_option_t[]) {
- OPT_INTRANGE("brightness", values[MP_CSP_EQ_BRIGHTNESS], 0, -100, 100),
- OPT_INTRANGE("saturation", values[MP_CSP_EQ_SATURATION], 0, -100, 100),
- OPT_INTRANGE("contrast", values[MP_CSP_EQ_CONTRAST], 0, -100, 100),
- OPT_INTRANGE("hue", values[MP_CSP_EQ_HUE], 0, -100, 100),
- OPT_INTRANGE("gamma", values[MP_CSP_EQ_GAMMA], 0, -100, 100),
- OPT_CHOICE_C("video-output-levels", values[MP_CSP_EQ_OUTPUT_LEVELS], 0,
- mp_csp_levels_names),
+ {"brightness", OPT_INT(values[MP_CSP_EQ_BRIGHTNESS]),
+ M_RANGE(-100, 100)},
+ {"saturation", OPT_INT(values[MP_CSP_EQ_SATURATION]),
+ M_RANGE(-100, 100)},
+ {"contrast", OPT_INT(values[MP_CSP_EQ_CONTRAST]),
+ M_RANGE(-100, 100)},
+ {"hue", OPT_INT(values[MP_CSP_EQ_HUE]),
+ M_RANGE(-100, 100)},
+ {"gamma", OPT_INT(values[MP_CSP_EQ_GAMMA]),
+ M_RANGE(-100, 100)},
+ {"video-output-levels",
+ OPT_CHOICE_C(values[MP_CSP_EQ_OUTPUT_LEVELS], mp_csp_levels_names)},
{0}
},
.size = sizeof(struct mp_csp_equalizer_opts),
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index 76f2b46e3e..14f1343d6f 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -99,32 +99,29 @@ static const struct m_opt_choice_alternatives discard_names[] = {
{"all", AVDISCARD_ALL},
{0}
};
-#define OPT_DISCARD(name, field, flags) \
- OPT_GENERAL(int, name, field, flags, .type = CONF_TYPE_CHOICE, \
- .priv = (void *)discard_names)
+#define OPT_DISCARD(field) OPT_CHOICE_C(field, discard_names)
const struct m_sub_options vd_lavc_conf = {
.opts = (const m_option_t[]){
- OPT_FLAG("vd-lavc-fast", fast, 0),
- OPT_FLAG("vd-lavc-show-all", show_all, 0),
- OPT_DISCARD("vd-lavc-skiploopfilter", skip_loop_filter, 0),
- OPT_DISCARD("vd-lavc-skipidct", skip_idct, 0),
- OPT_DISCARD("vd-lavc-skipframe", skip_frame, 0),
- OPT_DISCARD("vd-lavc-framedrop", framedrop, 0),
- OPT_INT("vd-lavc-threads", threads, 0, .min = 0, .max = DBL_MAX),
- OPT_FLAG("vd-lavc-bitexact", bitexact, 0),
- OPT_FLAG("vd-lavc-assume-old-x264", old_x264, 0),
- OPT_FLAG("vd-lavc-check-hw-profile", check_hw_profile, 0),
- OPT_CHOICE_OR_INT("vd-lavc-software-fallback", software_fallback,
- 0, 1, INT_MAX, ({"no", INT_MAX}, {"yes", 1})),
- OPT_KEYVALUELIST("vd-lavc-o", avopts, 0),
- OPT_FLAG("vd-lavc-dr", dr, 0),
- OPT_STRING_VALIDATE("hwdec", hwdec_api,
- M_OPT_OPTIONAL_PARAM | UPDATE_HWDEC,
- hwdec_validate_opt),
- OPT_STRING("hwdec-codecs", hwdec_codecs, 0),
- OPT_IMAGEFORMAT("hwdec-image-format", hwdec_image_format, 0, .min = -1),
- OPT_INTRANGE("hwdec-extra-frames", hwdec_extra_frames, 0, 0, 256),
+ {"vd-lavc-fast", OPT_FLAG(fast)},
+ {"vd-lavc-show-all", OPT_FLAG(show_all)},
+ {"vd-lavc-skiploopfilter", OPT_DISCARD(skip_loop_filter)},
+ {"vd-lavc-skipidct", OPT_DISCARD(skip_idct)},
+ {"vd-lavc-skipframe", OPT_DISCARD(skip_frame)},
+ {"vd-lavc-framedrop", OPT_DISCARD(framedrop)},
+ {"vd-lavc-threads", OPT_INT(threads), M_RANGE(0, DBL_MAX)},
+ {"vd-lavc-bitexact", OPT_FLAG(bitexact)},
+ {"vd-lavc-assume-old-x264", OPT_FLAG(old_x264)},
+ {"vd-lavc-check-hw-profile", OPT_FLAG(check_hw_profile)},
+ {"vd-lavc-software-fallback", OPT_CHOICE(software_fallback,
+ {"no", INT_MAX}, {"yes", 1}), M_RANGE(1, INT_MAX)},
+ {"vd-lavc-o", OPT_KEYVALUELIST(avopts)},
+ {"vd-lavc-dr", OPT_FLAG(dr)},
+ {"hwdec", OPT_STRING_VALIDATE(hwdec_api, hwdec_validate_opt),
+ .flags = M_OPT_OPTIONAL_PARAM | UPDATE_HWDEC},
+ {"hwdec-codecs", OPT_STRING(hwdec_codecs)},
+ {"hwdec-image-format", OPT_IMAGEFORMAT(hwdec_image_format), .min = -1},
+ {"hwdec-extra-frames", OPT_INT(hwdec_extra_frames), M_RANGE(0, 256)},
{0}
},
.size = sizeof(struct vd_lavc_params),
diff --git a/video/filter/vf_d3d11vpp.c b/video/filter/vf_d3d11vpp.c
index 504b881f3f..e3aa90c05e 100644
--- a/video/filter/vf_d3d11vpp.c
+++ b/video/filter/vf_d3d11vpp.c
@@ -476,15 +476,15 @@ fail:
#define OPT_BASE_STRUCT struct opts
static const m_option_t vf_opts_fields[] = {
- OPT_FLAG("deint", deint_enabled, 0),
- OPT_FLAG("interlaced-only", interlaced_only, 0),
- OPT_CHOICE("mode", mode, 0,
- ({"blend", D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_BLEND},
- {"bob", D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_BOB},
- {"adaptive", D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_ADAPTIVE},
- {"mocomp", D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_MOTION_COMPENSATION},
- {"ivctc", D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_INVERSE_TELECINE},
- {"none", 0})),
+ {"deint", OPT_FLAG(deint_enabled)},
+ {"interlaced-only", OPT_FLAG(interlaced_only)},
+ {"mode", OPT_CHOICE(mode,
+ {"blend", D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_BLEND},
+ {"bob", D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_BOB},
+ {"adaptive", D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_ADAPTIVE},
+ {"mocomp", D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_MOTION_COMPENSATION},
+ {"ivctc", D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_INVERSE_TELECINE},
+ {"none", 0})},
{0}
};
diff --git a/video/filter/vf_fingerprint.c b/video/filter/vf_fingerprint.c
index 471d995f4f..d06f80502d 100644
--- a/video/filter/vf_fingerprint.c
+++ b/video/filter/vf_fingerprint.c
@@ -45,9 +45,9 @@ const struct m_opt_choice_alternatives type_names[] = {
#define OPT_BASE_STRUCT struct f_opts
static const struct m_option f_opts_list[] = {
- OPT_CHOICE_C("type", type, 0, type_names),
- OPT_FLAG("clear-on-query", clear, 0),
- OPT_FLAG("print", print, 0),
+ {"type", OPT_CHOICE_C(type, type_names)},
+ {"clear-on-query", OPT_FLAG(clear)},
+ {"print", OPT_FLAG(print)},
{0}
};
diff --git a/video/filter/vf_format.c b/video/filter/vf_format.c
index 6681467fc3..a2adcca54a 100644
--- a/video/filter/vf_format.c
+++ b/video/filter/vf_format.c
@@ -183,24 +183,24 @@ static struct mp_filter *vf_format_create(struct mp_filter *parent, void *option
#define OPT_BASE_STRUCT struct vf_format_opts
static const m_option_t vf_opts_fields[] = {
- OPT_IMAGEFORMAT("fmt", fmt, 0),
- OPT_CHOICE_C("colormatrix", colormatrix, 0, mp_csp_names),
- OPT_CHOICE_C("colorlevels", colorlevels, 0, mp_csp_levels_names),
- OPT_CHOICE_C("primaries", primaries, 0, mp_csp_prim_names),
- OPT_CHOICE_C("gamma", gamma, 0, mp_csp_trc_names),
- OPT_FLOAT("sig-peak", sig_peak, 0),
- OPT_CHOICE_C("light", light, 0, mp_csp_light_names),
- OPT_CHOICE_C("chroma-location", chroma_location, 0, mp_chroma_names),
- OPT_CHOICE_C("stereo-in", stereo_in, 0, mp_stereo3d_names),
- OPT_INTRANGE("rotate", rotate, 0, -1, 359),
- OPT_INT("w", w, 0),
- OPT_INT("h", h, 0),
- OPT_INT("dw", dw, 0),
- OPT_INT("dh", dh, 0),
- OPT_DOUBLE("dar", dar, 0),
- OPT_FLAG("convert", convert, 0),
- OPT_REMOVED("outputlevels", "use the --video-output-levels global option"),
- OPT_REMOVED("peak", "use sig-peak instead (changed value scale!)"),
+ {"fmt", OPT_IMAGEFORMAT(fmt)},
+ {"colormatrix", OPT_CHOICE_C(colormatrix, mp_csp_names)},
+ {"colorlevels", OPT_CHOICE_C(colorlevels, mp_csp_levels_names)},
+ {"primaries", OPT_CHOICE_C(primaries, mp_csp_prim_names)},
+ {"gamma", OPT_CHOICE_C(gamma, mp_csp_trc_names)},
+ {"sig-peak", OPT_FLOAT(sig_peak)},
+ {"light", OPT_CHOICE_C(light, mp_csp_light_names)},
+ {"chroma-location", OPT_CHOICE_C(chroma_location, mp_chroma_names)},
+ {"stereo-in", OPT_CHOICE_C(stereo_in, mp_stereo3d_names)},
+ {"rotate", OPT_INT(rotate), M_RANGE(-1, 359)},
+ {"w", OPT_INT(w)},
+ {"h", OPT_INT(h)},
+ {"dw", OPT_INT(dw)},
+ {"dh", OPT_INT(dh)},
+ {"dar", OPT_DOUBLE(dar)},
+ {"convert", OPT_FLAG(convert)},
+ {"outputlevels", OPT_REMOVED("use the --video-output-levels global option")},
+ {"peak", OPT_REMOVED("use sig-peak instead (changed value scale!)")},
{0}
};
diff --git a/video/filter/vf_gpu.c b/video/filter/vf_gpu.c
index 5528abaa60..463d626e7d 100644
--- a/video/filter/vf_gpu.c
+++ b/video/filter/vf_gpu.c
@@ -363,8 +363,8 @@ const struct mp_user_filter_entry vf_gpu = {
.name = "gpu",
.priv_size = sizeof(OPT_BASE_STRUCT),
.options = (const struct m_option[]){
- OPT_INT("w", w, 0),
- OPT_INT("h", h, 0),
+ {"w", OPT_INT(w)},
+ {"h", OPT_INT(h)},
{0}
},
},
diff --git a/video/filter/vf_sub.c b/video/filter/vf_sub.c
index 8b2c1c83f0..ab2e308563 100644
--- a/video/filter/vf_sub.c
+++ b/video/filter/vf_sub.c
@@ -147,8 +147,8 @@ static struct mp_filter *vf_sub_create(struct mp_filter *parent, void *options)
#define OPT_BASE_STRUCT struct vf_sub_opts
static const m_option_t vf_opts_fields[] = {
- OPT_INTRANGE("bottom-margin", bottom_margin, 0, 0, 2000),
- OPT_INTRANGE("top-margin", top_margin, 0, 0, 2000),
+ {"bottom-margin", OPT_INT(bottom_margin), M_RANGE(0, 2000)},
+ {"top-margin", OPT_INT(top_margin), M_RANGE(0, 2000)},
{0}
};
diff --git a/video/filter/vf_vapoursynth.c b/video/filter/vf_vapoursynth.c
index d6cef08b3f..b7ed163c82 100644
--- a/video/filter/vf_vapoursynth.c
+++ b/video/filter/vf_vapoursynth.c
@@ -800,10 +800,11 @@ error:
#define OPT_BASE_STRUCT struct vapoursynth_opts
static const m_option_t vf_opts_fields[] = {
- OPT_STRING("file", file, M_OPT_FILE),
- OPT_INTRANGE("buffered-frames", maxbuffer, 0, 1, 9999, OPTDEF_INT(4)),
- OPT_CHOICE_OR_INT("concurrent-frames", maxrequests, 0, 1, 99,
- ({"auto", -1}), OPTDEF_INT(-1)),
+ {"file", OPT_STRING(file), .flags = M_OPT_FILE},
+ {"buffered-frames", OPT_INT(maxbuffer), M_RANGE(1, 9999),
+ OPTDEF_INT(4)},
+ {"concurrent-frames", OPT_CHOICE(maxrequests, {"auto", -1}),
+ M_RANGE(1, 99), OPTDEF_INT(-1)},
{0}
};
diff --git a/video/filter/vf_vavpp.c b/video/filter/vf_vavpp.c
index 8c41ba8734..ad2ecc04dc 100644
--- a/video/filter/vf_vavpp.c
+++ b/video/filter/vf_vavpp.c
@@ -471,17 +471,17 @@ error:
#define OPT_BASE_STRUCT struct opts
static const m_option_t vf_opts_fields[] = {
- OPT_CHOICE("deint", deint_type, 0,
- // The values >=0 must match with deint_algorithm[].
- ({"auto", -1},
- {"no", 0},
- {"first-field", 1},
- {"bob", 2},
- {"weave", 3},
- {"motion-adaptive", 4},
- {"motion-compensated", 5})),
- OPT_FLAG("interlaced-only", interlaced_only, 0),
- OPT_FLAG("reversal-bug", reversal_bug, 0),
+ {"deint", OPT_CHOICE(deint_type,
+ // The values >=0 must match with deint_algorithm[].
+ {"auto", -1},
+ {"no", 0},
+ {"first-field", 1},
+ {"bob", 2},
+ {"weave", 3},
+ {"motion-adaptive", 4},
+ {"motion-compensated", 5})},
+ {"interlaced-only", OPT_FLAG(interlaced_only)},
+ {"reversal-bug", OPT_FLAG(reversal_bug)},
{0}
};
diff --git a/video/filter/vf_vdpaupp.c b/video/filter/vf_vdpaupp.c
index fe3a903558..2f485bdbad 100644
--- a/video/filter/vf_vdpaupp.c
+++ b/video/filter/vf_vdpaupp.c
@@ -168,19 +168,19 @@ error:
#define OPT_BASE_STRUCT struct opts
static const m_option_t vf_opts_fields[] = {
- OPT_CHOICE("deint-mode", opts.deint, 0,
- ({"first-field", 1},
- {"bob", 2},
- {"temporal", 3},
- {"temporal-spatial", 4}),
- OPTDEF_INT(3)),
- OPT_FLAG("deint", deint_enabled, 0),
- OPT_FLAG("chroma-deint", opts.chroma_deint, 0, OPTDEF_INT(1)),
- OPT_FLAG("pullup", opts.pullup, 0),
- OPT_FLOATRANGE("denoise", opts.denoise, 0, 0, 1),
- OPT_FLOATRANGE("sharpen", opts.sharpen, 0, -1, 1),
- OPT_INTRANGE("hqscaling", opts.hqscaling, 0, 0, 9),
- OPT_FLAG("interlaced-only", interlaced_only, 0),
+ {"deint-mode", OPT_CHOICE(opts.deint,
+ {"first-field", 1},
+ {"bob", 2},
+ {"temporal", 3},
+ {"temporal-spatial", 4}),
+ OPTDEF_INT(3)},
+ {"deint", OPT_FLAG(deint_enabled)},
+ {"chroma-deint", OPT_FLAG(opts.chroma_deint), OPTDEF_INT(1)},
+ {"pullup", OPT_FLAG(opts.pullup)},
+ {"denoise", OPT_FLOAT(opts.denoise), M_RANGE(0, 1)},
+ {"sharpen", OPT_FLOAT(opts.sharpen), M_RANGE(-1, 1)},
+ {"hqscaling", OPT_INT(opts.hqscaling), M_RANGE(0, 9)},
+ {"interlaced-only", OPT_FLAG(interlaced_only)},
{0}
};
diff --git a/video/image_writer.c b/video/image_writer.c
index 5438249c42..8c3cf98d19 100644
--- a/video/image_writer.c
+++ b/video/image_writer.c
@@ -65,16 +65,16 @@ const struct m_opt_choice_alternatives mp_image_writer_formats[] = {
#define OPT_BASE_STRUCT struct image_writer_opts
const struct m_option image_writer_opts[] = {
- OPT_CHOICE_C("format", format, 0, mp_image_writer_formats),
- OPT_INTRANGE("jpeg-quality", jpeg_quality, 0, 0, 100),
- OPT_FLAG("jpeg-source-chroma", jpeg_source_chroma, 0),
- OPT_INTRANGE("png-compression", png_compression, 0, 0, 9),
- OPT_INTRANGE("png-filter", png_filter, 0, 0, 5),
- OPT_FLAG("webp-lossless", webp_lossless, 0),
- OPT_INTRANGE("webp-quality", webp_quality, 0, 0, 100),
- OPT_INTRANGE("webp-compression", webp_compression, 0, 0, 6),
- OPT_FLAG("high-bit-depth", high_bit_depth, 0),
- OPT_FLAG("tag-colorspace", tag_csp, 0),
+ {"format", OPT_CHOICE_C(format, mp_image_writer_formats)},
+ {"jpeg-quality", OPT_INT(jpeg_quality), M_RANGE(0, 100)},
+ {"jpeg-source-chroma", OPT_FLAG(jpeg_source_chroma)},
+ {"png-compression", OPT_INT(png_compression), M_RANGE(0, 9)},
+ {"png-filter", OPT_INT(png_filter), M_RANGE(0, 5)},
+ {"webp-lossless", OPT_FLAG(webp_lossless)},
+ {"webp-quality", OPT_INT(webp_quality), M_RANGE(0, 100)},
+ {"webp-compression", OPT_INT(webp_compression), M_RANGE(0, 6)},
+ {"high-bit-depth", OPT_FLAG(high_bit_depth)},
+ {"tag-colorspace", OPT_FLAG(tag_csp)},
{0},
};
diff --git a/video/out/android_common.c b/video/out/android_common.c
index 24b87d6017..52132f2d66 100644
--- a/video/out/android_common.c
+++ b/video/out/android_common.c
@@ -31,7 +31,8 @@ struct android_opts {
#define OPT_BASE_STRUCT struct android_opts
const struct m_sub_options android_conf = {
.opts = (const struct m_option[]) {
- OPT_SIZE_BOX("android-surface-size", surface_size, UPDATE_VO_RESIZE),
+ {"android-surface-size", OPT_SIZE_BOX(surface_size),
+ .flags = UPDATE_VO_RESIZE},
{0}
},
.size = sizeof(struct android_opts),
diff --git a/video/out/d3d11/context.c b/video/out/d3d11/context.c
index bdfbacfe54..600058c1d2 100644
--- a/video/out/d3d11/context.c
+++ b/video/out/d3d11/context.c
@@ -43,36 +43,36 @@ struct d3d11_opts {
#define OPT_BASE_STRUCT struct d3d11_opts
const struct m_sub_options d3d11_conf = {
.opts = (const struct m_option[]) {
- OPT_CHOICE("d3d11-warp", warp, 0,
- ({"auto", -1},
- {"no", 0},
- {"yes", 1})),
- OPT_CHOICE("d3d11-feature-level", feature_level, 0,
- ({"12_1", D3D_FEATURE_LEVEL_12_1},
- {"12_0", D3D_FEATURE_LEVEL_12_0},
- {"11_1", D3D_FEATURE_LEVEL_11_1},
- {"11_0", D3D_FEATURE_LEVEL_11_0},
- {"10_1", D3D_FEATURE_LEVEL_10_1},
- {"10_0", D3D_FEATURE_LEVEL_10_0},
- {"9_3", D3D_FEATURE_LEVEL_9_3},
- {"9_2", D3D_FEATURE_LEVEL_9_2},
- {"9_1", D3D_FEATURE_LEVEL_9_1})),
- OPT_FLAG("d3d11-flip", flip, 0),
- OPT_INTRANGE("d3d11-sync-interval", sync_interval, 0, 0, 4),
- OPT_STRING_VALIDATE("d3d11-adapter", adapter_name, 0,
- d3d11_validate_adapter),
- OPT_CHOICE("d3d11-output-format", output_format, 0,
- ({"auto", DXGI_FORMAT_UNKNOWN},
- {"rgba8", DXGI_FORMAT_R8G8B8A8_UNORM},
- {"bgra8", DXGI_FORMAT_B8G8R8A8_UNORM},
- {"rgb10_a2", DXGI_FORMAT_R10G10B10A2_UNORM},
- {"rgba16f", DXGI_FORMAT_R16G16B16A16_FLOAT})),
- OPT_CHOICE("d3d11-output-csp", color_space, 0,
- ({"auto", -1},
- {"srgb", DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709},
- {"linear", DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709},
- {"pq", DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020},
- {"bt.2020", DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P2020})),
+ {"d3d11-warp", OPT_CHOICE(warp,
+ {"auto", -1},
+ {"no", 0},
+ {"yes", 1})},
+ {"d3d11-feature-level", OPT_CHOICE(feature_level,
+ {"12_1", D3D_FEATURE_LEVEL_12_1},
+ {"12_0", D3D_FEATURE_LEVEL_12_0},
+ {"11_1", D3D_FEATURE_LEVEL_11_1},
+ {"11_0", D3D_FEATURE_LEVEL_11_0},
+ {"10_1", D3D_FEATURE_LEVEL_10_1},
+ {"10_0", D3D_FEATURE_LEVEL_10_0},
+ {"9_3", D3D_FEATURE_LEVEL_9_3},
+ {"9_2", D3D_FEATURE_LEVEL_9_2},
+ {"9_1", D3D_FEATURE_LEVEL_9_1})},
+ {"d3d11-flip", OPT_FLAG(flip)},
+ {"d3d11-sync-interval", OPT_INT(sync_interval), M_RANGE(0, 4)},
+ {"d3d11-adapter", OPT_STRING_VALIDATE(adapter_name,
+ d3d11_validate_adapter)},
+ {"d3d11-output-format", OPT_CHOICE(output_format,
+ {"auto", DXGI_FORMAT_UNKNOWN},
+ {"rgba8", DXGI_FORMAT_R8G8B8A8_UNORM},
+ {"bgra8", DXGI_FORMAT_B8G8R8A8_UNORM},
+ {"rgb10_a2", DXGI_FORMAT_R10G10B10A2_UNORM},
+ {"rgba16f", DXGI_FORMAT_R16G16B16A16_FLOAT})},
+ {"d3d11-output-csp", OPT_CHOICE(color_space,
+ {"auto", -1},
+ {"srgb", DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709},
+ {"linear", DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709},
+ {"pq", DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020},
+ {"bt.2020", DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P2020})},
{0}
},
.defaults = &(const struct d3d11_opts) {
diff --git a/video/out/d3d11/hwdec_d3d11va.c b/video/out/d3d11/hwdec_d3d11va.c
index 8d22fe3de5..02f796e003 100644
--- a/video/out/d3d11/hwdec_d3d11va.c
+++ b/video/out/d3d11/hwdec_d3d11va.c
@@ -36,7 +36,7 @@ struct d3d11va_opts {
#define OPT_BASE_STRUCT struct d3d11va_opts
const struct m_sub_options d3d11va_conf = {
.opts = (const struct m_option[]) {
- OPT_FLAG("d3d11va-zero-copy", zero_copy, 0),
+ {"d3d11va-zero-copy", OPT_FLAG(zero_copy)},
{0}
},
.defaults = &(const struct d3d11va_opts) {
diff --git a/video/out/drm_common.c b/video/out/drm_common.c
index 084cf22768..4ecad6f0c4 100644
--- a/video/out/drm_common.c
+++ b/video/out/drm_common.c
@@ -64,27 +64,27 @@ static double mode_get_Hz(const drmModeModeInfo *mode);
#define OPT_BASE_STRUCT struct drm_opts
const struct m_sub_options drm_conf = {
.opts = (const struct m_option[]) {
- OPT_STRING_VALIDATE("drm-connector", drm_connector_spec,
- 0, drm_validate_connector_opt),
- OPT_STRING_VALIDATE("drm-mode", drm_mode_spec,
- 0, drm_validate_mode_opt),
- OPT_CHOICE("drm-atomic", drm_atomic, 0,
- ({"no", 0},
- {"auto", 1})),
- OPT_CHOICE_OR_INT("drm-draw-plane", drm_draw_plane, 0, 0, INT_MAX,
- ({"primary", DRM_OPTS_PRIMARY_PLANE},
- {"overlay", DRM_OPTS_OVERLAY_PLANE})),
- OPT_CHOICE_OR_INT("drm-drmprime-video-plane", drm_drmprime_video_plane, 0, 0, INT_MAX,
- ({"primary", DRM_OPTS_PRIMARY_PLANE},
- {"overlay", DRM_OPTS_OVERLAY_PLANE})),
- OPT_CHOICE("drm-format", drm_format, 0,
- ({"xrgb8888", DRM_OPTS_FORMAT_XRGB8888},
- {"xrgb2101010", DRM_OPTS_FORMAT_XRGB2101010})),
- OPT_SIZE_BOX("drm-draw-surface-size", drm_draw_surface_size, 0),
-
- OPT_REPLACED("drm-osd-plane-id", "drm-draw-plane"),
- OPT_REPLACED("drm-video-plane-id", "drm-drmprime-video-plane"),
- OPT_REPLACED("drm-osd-size", "drm-draw-surface-size"),
+ {"drm-connector", OPT_STRING_VALIDATE(drm_connector_spec,
+ drm_validate_connector_opt)},
+ {"drm-mode", OPT_STRING_VALIDATE(drm_mode_spec,
+ drm_validate_mode_opt)},
+ {"drm-atomic", OPT_CHOICE(drm_atomic, {"no", 0}, {"auto", 1})},
+ {"drm-draw-plane", OPT_CHOICE(drm_draw_plane,
+ {"primary", DRM_OPTS_PRIMARY_PLANE},
+ {"overlay", DRM_OPTS_OVERLAY_PLANE}),
+ M_RANGE(0, INT_MAX)},
+ {"drm-drmprime-video-plane", OPT_CHOICE(drm_drmprime_video_plane,
+ {"primary", DRM_OPTS_PRIMARY_PLANE},
+ {"overlay", DRM_OPTS_OVERLAY_PLANE}),
+ M_RANGE(0, INT_MAX)},
+ {"drm-format", OPT_CHOICE(drm_format,
+ {"xrgb8888", DRM_OPTS_FORMAT_XRGB8888},
+ {"xrgb2101010", DRM_OPTS_FORMAT_XRGB2101010})},
+ {"drm-draw-surface-size", OPT_SIZE_BOX(drm_draw_surface_size)},
+
+ {"drm-osd-plane-id", OPT_REPLACED("drm-draw-plane")},
+ {"drm-video-plane-id", OPT_REPLACED("drm-drmprime-video-plane")},
+ {"drm-osd-size", OPT_REPLACED("drm-draw-surface-size")},
{0},
},
.defaults = &(const struct drm_opts) {
diff --git a/video/out/gpu/lcms.c b/video/out/gpu/lcms.c
index 1d4e90d7af..0f3a0bf646 100644
--- a/video/out/gpu/lcms.c
+++ b/video/out/gpu/lcms.c
@@ -78,16 +78,16 @@ static int validate_3dlut_size_opt(struct mp_log *log, const m_option_t *opt,
#define OPT_BASE_STRUCT struct mp_icc_opts
const struct m_sub_options mp_icc_conf = {
.opts = (const m_option_t[]) {
- OPT_FLAG("use-embedded-icc-profile", use_embedded, 0),
- OPT_STRING("icc-profile", profile, M_OPT_FILE),
- OPT_FLAG("icc-profile-auto", profile_auto, 0),
- OPT_STRING("icc-cache-dir", cache_dir, M_OPT_FILE),
- OPT_INT("icc-intent", intent, 0),
- OPT_CHOICE_OR_INT("icc-contrast", contrast, 0, 0, 1000000, ({"inf", -1})),
- OPT_STRING_VALIDATE("icc-3dlut-size", size_str, 0, validate_3dlut_size_opt),
-
- OPT_REPLACED("3dlut-size", "icc-3dlut-size"),
- OPT_REMOVED("icc-cache", "see icc-cache-dir"),
+ {"use-embedded-icc-profile", OPT_FLAG(use_embedded)},
+ {"icc-profile", OPT_STRING(profile), .flags = M_OPT_FILE},
+ {"icc-profile-auto", OPT_FLAG(profile_auto)},
+ {"icc-cache-dir", OPT_STRING(cache_dir), .flags = M_OPT_FILE},
+ {"icc-intent", OPT_INT(intent)},
+ {"icc-contrast", OPT_CHOICE(contrast, {"inf", -1}),
+ M_RANGE(0, 1000000)},
+ {"icc-3dlut-size", OPT_STRING_VALIDATE(size_str, validate_3dlut_size_opt)},
+ {"3dlut-size", OPT_REPLACED("icc-3dlut-size")},
+ {"icc-cache", OPT_REMOVED("see icc-cache-dir")},
{0}
},
.size = sizeof(struct mp_icc_opts),
diff --git a/video/out/gpu/spirv.c b/video/out/gpu/spirv.c
index ee11d601a3..67088bc7df 100644
--- a/video/out/gpu/spirv.c
+++ b/video/out/gpu/spirv.c
@@ -33,7 +33,7 @@ struct spirv_opts {
#define OPT_BASE_STRUCT struct spirv_opts
const struct m_sub_options spirv_conf = {
.opts = (const struct m_option[]) {
- OPT_CHOICE_C("spirv-compiler", compiler, 0, compiler_choices),
+ {"spirv-compiler", OPT_CHOICE_C(compiler, compiler_choices)},
{0}
},
.size = sizeof(struct spirv_opts),
diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c
index 539934fe67..9d5df7c739 100644
--- a/video/out/gpu/video.c
+++ b/video/out/gpu/video.c
@@ -346,119 +346,123 @@ static int validate_error_diffusion_opt(struct mp_log *log, const m_option_t *op
#define OPT_BASE_STRUCT struct gl_video_opts
// Use for options which use NAN for defaults.
-#define OPT_FLOATDEF(name, var, flags) \
- OPT_FLOAT(name, var, (flags) | M_OPT_DEFAULT_NAN)
+#define OPT_FLOATDEF(field) \
+ OPT_FLOAT(field), \
+ .flags = M_OPT_DEFAULT_NAN
#define SCALER_OPTS(n, i) \
- OPT_STRING_VALIDATE(n, scaler[i].kernel.name, 0, validate_scaler_opt), \
- OPT_FLOATDEF(n"-param1", scaler[i].kernel.params[0], 0), \
- OPT_FLOATDEF(n"-param2", scaler[i].kernel.params[1], 0), \
- OPT_FLOAT(n"-blur", scaler[i].kernel.blur, 0), \
- OPT_FLOATRANGE(n"-cutoff", scaler[i].cutoff, 0, 0.0, 1.0), \
- OPT_FLOATRANGE(n"-taper", scaler[i].kernel.taper, 0, 0.0, 1.0), \
- OPT_FLOATDEF(n"-wparam", scaler[i].window.params[0], 0), \
- OPT_FLOAT(n"-wblur", scaler[i].window.blur, 0), \
- OPT_FLOATRANGE(n"-wtaper", scaler[i].window.taper, 0, 0.0, 1.0), \
- OPT_FLOATRANGE(n"-clamp", scaler[i].clamp, 0, 0.0, 1.0), \
- OPT_FLOATRANGE(n"-radius", scaler[i].radius, 0, 0.5, 16.0), \
- OPT_FLOATRANGE(n"-antiring", scaler[i].antiring, 0, 0.0, 1.0), \
- OPT_STRING_VALIDATE(n"-window", scaler[i].window.name, 0, validate_window_opt)
+ {n, OPT_STRING_VALIDATE(scaler[i].kernel.name, validate_scaler_opt)}, \
+ {n"-param1", OPT_FLOATDEF(scaler[i].kernel.params[0])}, \
+ {n"-param2", OPT_FLOATDEF(scaler[i].kernel.params[1])}, \
+ {n"-blur", OPT_FLOAT(scaler[i].kernel.blur)}, \
+ {n"-cutoff", OPT_FLOAT(scaler[i].cutoff), M_RANGE(0.0, 1.0)}, \
+ {n"-taper", OPT_FLOAT(scaler[i].kernel.taper), M_RANGE(0.0, 1.0)}, \
+ {n"-wparam", OPT_FLOATDEF(scaler[i].window.params[0])}, \
+ {n"-wblur", OPT_FLOAT(scaler[i].window.blur)}, \
+ {n"-wtaper", OPT_FLOAT(scaler[i].window.taper), M_RANGE(0.0, 1.0)}, \
+ {n"-clamp", OPT_FLOAT(scaler[i].clamp), M_RANGE(0.0, 1.0)}, \
+ {n"-radius", OPT_FLOAT(scaler[i].radius), M_RANGE(0.5, 16.0)}, \
+ {n"-antiring", OPT_FLOAT(scaler[i].antiring), M_RANGE(0.0, 1.0)}, \
+ {n"-window", OPT_STRING_VALIDATE(scaler[i].window.name, validate_window_opt)}
const struct m_sub_options gl_video_conf = {
.opts = (const m_option_t[]) {
- OPT_CHOICE("gpu-dumb-mode", dumb_mode, 0,
- ({"auto", 0}, {"yes", 1}, {"no", -1})),
- OPT_FLOATRANGE("gamma-factor", gamma, 0, 0.1, 2.0),
- OPT_FLAG("gamma-auto", gamma_auto, 0),
- OPT_CHOICE_C("target-prim", target_prim, 0, mp_csp_prim_names),
- OPT_CHOICE_C("target-trc", target_trc, 0, mp_csp_trc_names),
- OPT_CHOICE_OR_INT("target-peak", target_peak, 0, 10, 10000,
- ({"auto", 0})),
- OPT_CHOICE("tone-mapping", tone_map.curve, 0,
- ({"clip", TONE_MAPPING_CLIP},
- {"mobius", TONE_MAPPING_MOBIUS},
- {"reinhard", TONE_MAPPING_REINHARD},
- {"hable", TONE_MAPPING_HABLE},
- {"gamma", TONE_MAPPING_GAMMA},
- {"linear", TONE_MAPPING_LINEAR})),
- OPT_CHOICE("hdr-compute-peak", tone_map.compute_peak, 0,
- ({"auto", 0},
- {"yes", 1},
- {"no", -1})),
- OPT_FLOATRANGE("hdr-peak-decay-rate", tone_map.decay_rate, 0, 1.0, 1000.0),
- OPT_FLOATRANGE("hdr-scene-threshold-low",
- tone_map.scene_threshold_low, 0, 0, 20.0),
- OPT_FLOATRANGE("hdr-scene-threshold-high",
- tone_map.scene_threshold_high, 0, 0, 20.0),
- OPT_FLOATDEF("tone-mapping-param", tone_map.curve_param, 0),
- OPT_FLOATRANGE("tone-mapping-max-boost", tone_map.max_boost, 0, 1.0, 10.0),
- OPT_FLOAT("tone-mapping-desaturate", tone_map.desat, 0),
- OPT_FLOATRANGE("tone-mapping-desaturate-exponent",
- tone_map.desat_exp, 0, 0.0, 20.0),
- OPT_FLAG("gamut-warning", tone_map.gamut_warning, 0),
- OPT_FLAG("opengl-pbo", pbo, 0),
+ {"gpu-dumb-mode", OPT_CHOICE(dumb_mode,
+ {"auto", 0}, {"yes", 1}, {"no", -1})},
+ {"gamma-factor", OPT_FLOAT(gamma), M_RANGE(0.1, 2.0)},
+ {"gamma-auto", OPT_FLAG(gamma_auto)},
+ {"target-prim", OPT_CHOICE_C(target_prim, mp_csp_prim_names)},
+ {"target-trc", OPT_CHOICE_C(target_trc, mp_csp_trc_names)},
+ {"target-peak", OPT_CHOICE(target_peak, {"auto", 0}),
+ M_RANGE(10, 10000)},
+ {"tone-mapping", OPT_CHOICE(tone_map.curve,
+ {"clip", TONE_MAPPING_CLIP},
+ {"mobius", TONE_MAPPING_MOBIUS},
+ {"reinhard", TONE_MAPPING_REINHARD},
+ {"hable", TONE_MAPPING_HABLE},
+ {"gamma", TONE_MAPPING_GAMMA},
+ {"linear", TONE_MAPPING_LINEAR})},
+ {"hdr-compute-peak", OPT_CHOICE(tone_map.compute_peak,
+ {"auto", 0},
+ {"yes", 1},
+ {"no", -1})},
+ {"hdr-peak-decay-rate", OPT_FLOAT(tone_map.decay_rate),
+ M_RANGE(1.0, 1000.0)},
+ {"hdr-scene-threshold-low", OPT_FLOAT(tone_map.scene_threshold_low),
+ M_RANGE(0, 20.0)},
+ {"hdr-scene-threshold-high", OPT_FLOAT(tone_map.scene_threshold_high),
+ M_RANGE(0, 20.0)},
+ {"tone-mapping-param", OPT_FLOATDEF(tone_map.curve_param)},
+ {"tone-mapping-max-boost", OPT_FLOAT(tone_map.max_boost),
+ M_RANGE(1.0, 10.0)},
+ {"tone-mapping-desaturate", OPT_FLOAT(tone_map.desat)},
+ {"tone-mapping-desaturate-exponent", OPT_FLOAT(tone_map.desat_exp),
+ M_RANGE(0.0, 20.0)},
+ {"gamut-warning", OPT_FLAG(tone_map.gamut_warning)},
+ {"opengl-pbo", OPT_FLAG(pbo)},
SCALER_OPTS("scale", SCALER_SCALE),
SCALER_OPTS("dscale", SCALER_DSCALE),
SCALER_OPTS("cscale", SCALER_CSCALE),
SCALER_OPTS("tscale", SCALER_TSCALE),
- OPT_INTRANGE("scaler-lut-size", scaler_lut_size, 0, 4, 10),
- OPT_FLAG("scaler-resizes-only", scaler_resizes_only, 0),
- OPT_FLAG("correct-downscaling", correct_downscaling, 0),
- OPT_FLAG("linear-downscaling", linear_downscaling, 0),
- OPT_FLAG("linear-upscaling", linear_upscaling, 0),
- OPT_FLAG("sigmoid-upscaling", sigmoid_upscaling, 0),
- OPT_FLOATRANGE("sigmoid-center", sigmoid_center, 0, 0.0, 1.0),
- OPT_FLOATRANGE("sigmoid-slope", sigmoid_slope, 0, 1.0, 20.0),
- OPT_STRING("fbo-format", fbo_format, 0),
- OPT_CHOICE_OR_INT("dither-depth", dither_depth, 0, -1, 16,
- ({"no", -1}, {"auto", 0})),
- OPT_CHOICE("dither", dither_algo, 0,
- ({"fruit", DITHER_FRUIT},
- {"ordered", DITHER_ORDERED},
- {"error-diffusion", DITHER_ERROR_DIFFUSION},
- {"no", DITHER_NONE})),
- OPT_INTRANGE("dither-size-fruit", dither_size, 0, 2, 8),
- OPT_FLAG("temporal-dither", temporal_dither, 0),
- OPT_INTRANGE("temporal-dither-period", temporal_dither_period, 0, 1, 128),
- OPT_STRING_VALIDATE("error-diffusion", error_diffusion, 0,
- validate_error_diffusion_opt),
- OPT_CHOICE("alpha", alpha_mode, 0,
- ({"no", ALPHA_NO},
- {"yes", ALPHA_YES},
- {"blend", ALPHA_BLEND},
- {"blend-tiles", ALPHA_BLEND_TILES})),
- OPT_FLAG("opengl-rectangle-textures", use_rectangle, 0),
- OPT_COLOR("background", background, 0),
- OPT_FLAG("interpolation", interpolation, 0),
- OPT_FLOAT("interpolation-threshold", interpolation_threshold, 0),
- OPT_CHOICE("blend-subtitles", blend_subs, 0,
- ({"no", BLEND_SUBS_NO},
- {"yes", BLEND_SUBS_YES},
- {"video", BLEND_SUBS_VIDEO})),
- OPT_PATHLIST("glsl-shaders", user_shaders, M_OPT_FILE),
- OPT_CLI_ALIAS("glsl-shader", "glsl-shaders-append"),
- OPT_FLAG("deband", deband, 0),
- OPT_SUBSTRUCT("deband", deband_opts, deband_conf, 0),
- OPT_FLOAT("sharpen", unsharp, 0),
- OPT_INTRANGE("gpu-tex-pad-x", tex_pad_x, 0, 0, 4096),
- OPT_INTRANGE("gpu-tex-pad-y", tex_pad_y, 0, 0, 4096),
- OPT_SUBSTRUCT("", icc_opts, mp_icc_conf, 0),
- OPT_STRING("gpu-shader-cache-dir", shader_cache_dir, M_OPT_FILE),
- OPT_STRING_VALIDATE("gpu-hwdec-interop", hwdec_interop, 0,
- ra_hwdec_validate_opt),
- OPT_REPLACED("opengl-hwdec-interop", "gpu-hwdec-interop"),
- OPT_REPLACED("hwdec-preload", "opengl-hwdec-interop"),
- OPT_REPLACED("hdr-tone-mapping", "tone-mapping"),
- OPT_REPLACED("opengl-shaders", "glsl-shaders"),
- OPT_REPLACED("opengl-shader", "glsl-shader"),
- OPT_REPLACED("opengl-shader-cache-dir", "gpu-shader-cache-dir"),
- OPT_REPLACED("opengl-tex-pad-x", "gpu-tex-pad-x"),
- OPT_REPLACED("opengl-tex-pad-y", "gpu-tex-pad-y"),
- OPT_REPLACED("opengl-fbo-format", "fbo-format"),
- OPT_REPLACED("opengl-dumb-mode", "gpu-dumb-mode"),
- OPT_REPLACED("opengl-gamma", "gamma-factor"),
- OPT_REMOVED("linear-scaling", "Split into --linear-upscaling and "
- "--linear-downscaling"),
+ {"scaler-lut-size", OPT_INT(scaler_lut_size), M_RANGE(4, 10)},
+ {"scaler-resizes-only", OPT_FLAG(scaler_resizes_only)},
+ {"correct-downscaling", OPT_FLAG(correct_downscaling)},
+ {"linear-downscaling", OPT_FLAG(linear_downscaling)},
+ {"linear-upscaling", OPT_FLAG(linear_upscaling)},
+ {"sigmoid-upscaling", OPT_FLAG(sigmoid_upscaling)},
+ {"sigmoid-center", OPT_FLOAT(sigmoid_center), M_RANGE(0.0, 1.0)},
+ {"sigmoid-slope", OPT_FLOAT(sigmoid_slope), M_RANGE(1.0, 20.0)},
+ {"fbo-format", OPT_STRING(fbo_format)},
+ {"dither-depth", OPT_CHOICE(dither_depth, {"no", -1}, {"auto", 0}),
+ M_RANGE(-1, 16)},
+ {"dither", OPT_CHOICE(dither_algo,
+ {"fruit", DITHER_FRUIT},
+ {"ordered", DITHER_ORDERED},
+ {"error-diffusion", DITHER_ERROR_DIFFUSION},
+ {"no", DITHER_NONE})},
+ {"dither-size-fruit", OPT_INT(dither_size), M_RANGE(2, 8)},
+ {"temporal-dither", OPT_FLAG(temporal_dither)},
+ {"temporal-dither-period", OPT_INT(temporal_dither_period),
+ M_RANGE(1, 128)},
+ {"error-diffusion",
+ OPT_STRING_VALIDATE(error_diffusion, validate_error_diffusion_opt)},
+ {"alpha", OPT_CHOICE(alpha_mode,
+ {"no", ALPHA_NO},
+ {"yes", ALPHA_YES},
+ {"blend", ALPHA_BLEND},
+ {"blend-tiles", ALPHA_BLEND_TILES})},
+ {"opengl-rectangle-textures", OPT_FLAG(use_rectangle)},
+ {"background", OPT_COLOR(background)},
+ {"interpolation", OPT_FLAG(interpolation)},
+ {"interpolation-threshold", OPT_FLOAT(interpolation_threshold)},
+ {"blend-subtitles", OPT_CHOICE(blend_subs,
+ {"no", BLEND_SUBS_NO},
+ {"yes", BLEND_SUBS_YES},
+ {"video", BLEND_SUBS_VIDEO})},
+ {"glsl-shaders", OPT_PATHLIST(user_shaders), .flags = M_OPT_FILE},
+ {"glsl-shader", OPT_CLI_ALIAS("glsl-shaders-append")},
+ {"deband", OPT_FLAG(deband)},
+ {"deband", OPT_SUBSTRUCT(deband_opts, deband_conf)},
+ {"sharpen", OPT_FLOAT(unsharp)},
+ {"gpu-tex-pad-x", OPT_INT(tex_pad_x), M_RANGE(0, 4096)},
+ {"gpu-tex-pad-y", OPT_INT(tex_pad_y), M_RANGE(0, 4096)},
+ {"", OPT_SUBSTRUCT(icc_opts, mp_icc_conf)},
+ {"gpu-shader-cache-dir", OPT_STRING(shader_cache_dir), .flags = M_OPT_FILE},
+ {"gpu-hwdec-interop",
+ OPT_STRING_VALIDATE(hwdec_interop, ra_hwdec_validate_opt)},
+ {"opengl-hwdec-interop", OPT_REPLACED("gpu-hwdec-interop")},
+ {"hwdec-preload", OPT_REPLACED("opengl-hwdec-interop")},
+ {"hdr-tone-mapping", OPT_REPLACED("tone-mapping")},
+ {"opengl-shaders", OPT_REPLACED("glsl-shaders")},
+ {"opengl-shader", OPT_REPLACED("glsl-shader")},
+ {"opengl-shader-cache-dir", OPT_REPLACED("gpu-shader-cache-dir")},
+ {"opengl-tex-pad-x", OPT_REPLACED("gpu-tex-pad-x")},
+ {"opengl-tex-pad-y", OPT_REPLACED("gpu-tex-pad-y")},
+ {"opengl-fbo-format", OPT_REPLACED("fbo-format")},
+ {"opengl-dumb-mode", OPT_REPLACED("gpu-dumb-mode")},
+ {"opengl-gamma", OPT_REPLACED("gamma-factor")},
+ {"linear-scaling", OPT_REMOVED("Split into --linear-upscaling and "
+ "--linear-downscaling")},
{0}
},
.size = sizeof(struct gl_video_opts),
diff --git a/video/out/gpu/video_shaders.c b/video/out/gpu/video_shaders.c
index 51b62ad7db..ff1660c85a 100644
--- a/video/out/gpu/video_shaders.c
+++ b/video/out/gpu/video_shaders.c
@@ -882,10 +882,10 @@ const struct deband_opts deband_opts_def = {
#define OPT_BASE_STRUCT struct deband_opts
const struct m_sub_options deband_conf = {
.opts = (const m_option_t[]) {
- OPT_INTRANGE("iterations", iterations, 0, 1, 16),
- OPT_FLOATRANGE("threshold", threshold, 0, 0.0, 4096.0),
- OPT_FLOATRANGE("range", range, 0, 1.0, 64.0),
- OPT_FLOATRANGE("grain", grain, 0, 0.0, 4096.0),
+ {"iterations", OPT_INT(iterations), M_RANGE(1, 16)},
+ {"threshold", OPT_FLOAT(threshold), M_RANGE(0.0, 4096.0)},
+ {"range", OPT_FLOAT(range), M_RANGE(1.0, 64.0)},
+ {"grain", OPT_FLOAT(grain), M_RANGE(0.0, 4096.0)},
{0}
},
.size = sizeof(struct deband_opts),
diff --git a/video/out/opengl/context.c b/video/out/opengl/context.c
index 07fa183acc..781352da34 100644
--- a/video/out/opengl/context.c
+++ b/video/out/opengl/context.c
@@ -59,21 +59,20 @@ struct opengl_opts {
#define OPT_BASE_STRUCT struct opengl_opts
const struct m_sub_options opengl_conf = {
.opts = (const struct m_option[]) {
- OPT_FLAG("opengl-glfinish", use_glfinish, 0),
- OPT_FLAG("opengl-waitvsync", waitvsync, 0),
- OPT_INT("opengl-swapinterval", swapinterval, 0),
- OPT_INT("opengl-check-pattern-a", vsync_pattern[0], 0),
- OPT_INT("opengl-check-pattern-b", vsync_pattern[1], 0),
- OPT_INT("opengl-restrict", restrict_version, 0),
- OPT_CHOICE("opengl-es", gles_mode, 0,
- ({"auto", GLES_AUTO}, {"yes", GLES_YES}, {"no", GLES_NO})),
- OPT_CHOICE("opengl-early-flush", early_flush, 0,
- ({"no", FLUSH_NO}, {"yes", FLUSH_YES}, {"auto", FLUSH_AUTO})),
-
- OPT_REPLACED("opengl-debug", "gpu-debug"),
- OPT_REPLACED("opengl-sw", "gpu-sw"),
- OPT_REPLACED("opengl-vsync-fences", "swapchain-depth"),
- OPT_REPLACED("opengl-backend", "gpu-context"),
+ {"opengl-glfinish", OPT_FLAG(use_glfinish)},
+ {"opengl-waitvsync", OPT_FLAG(waitvsync)},
+ {"opengl-swapinterval", OPT_INT(swapinterval)},
+ {"opengl-check-pattern-a", OPT_INT(vsync_pattern[0])},
+ {"opengl-check-pattern-b", OPT_INT(vsync_pattern[1])},
+ {"opengl-restrict", OPT_INT(restrict_version)},
+ {"opengl-es", OPT_CHOICE(gles_mode,
+ {"auto", GLES_AUTO}, {"yes", GLES_YES}, {"no", GLES_NO})},
+ {"opengl-early-flush", OPT_CHOICE(early_flush,
+ {"no", FLUSH_NO}, {"yes", FLUSH_YES}, {"auto", FLUSH_AUTO})},
+ {"opengl-debug", OPT_REPLACED("gpu-debug")},
+ {"opengl-sw", OPT_REPLACED("gpu-sw")},
+ {"opengl-vsync-fences", OPT_REPLACED("swapchain-depth")},
+ {"opengl-backend", OPT_REPLACED("gpu-context")},
{0},
},
.defaults = &(const struct opengl_opts) {
diff --git a/video/out/opengl/context_angle.c b/video/out/opengl/context_angle.c
index 76d104e9b9..2784026d1d 100644
--- a/video/out/opengl/context_angle.c
+++ b/video/out/opengl/context_angle.c
@@ -59,26 +59,26 @@ struct angle_opts {
#define OPT_BASE_STRUCT struct angle_opts
const struct m_sub_options angle_conf = {
.opts = (const struct m_option[]) {
- OPT_CHOICE("angle-renderer", renderer, 0,
- ({"auto", RENDERER_AUTO},
- {"d3d9", RENDERER_D3D9},
- {"d3d11", RENDERER_D3D11})),
- OPT_CHOICE("angle-d3d11-warp", d3d11_warp, 0,
- ({"auto", -1},
- {"no", 0},
- {"yes", 1})),
- OPT_CHOICE("angle-d3d11-feature-level", d3d11_feature_level, 0,
- ({"11_0", D3D_FEATURE_LEVEL_11_0},
- {"10_1", D3D_FEATURE_LEVEL_10_1},
- {"10_0", D3D_FEATURE_LEVEL_10_0},
- {"9_3", D3D_FEATURE_LEVEL_9_3})),
- OPT_CHOICE("angle-egl-windowing", egl_windowing, 0,
- ({"auto", -1},
- {"no", 0},
- {"yes", 1})),
- OPT_FLAG("angle-flip", flip, 0),
- OPT_REPLACED("angle-max-frame-latency", "swapchain-depth"),
- OPT_REMOVED("angle-swapchain-length", "controlled by --swapchain-depth"),
+ {"angle-renderer", OPT_CHOICE(renderer,
+ {"auto", RENDERER_AUTO},
+ {"d3d9", RENDERER_D3D9},
+ {"d3d11", RENDERER_D3D11})},
+ {"angle-d3d11-warp", OPT_CHOICE(d3d11_warp,
+ {"auto", -1},
+ {"no", 0},
+ {"yes", 1})},
+ {"angle-d3d11-feature-level", OPT_CHOICE(d3d11_feature_level,
+ {"11_0", D3D_FEATURE_LEVEL_11_0},
+ {"10_1", D3D_FEATURE_LEVEL_10_1},
+ {"10_0", D3D_FEATURE_LEVEL_10_0},
+ {"9_3", D3D_FEATURE_LEVEL_9_3})},
+ {"angle-egl-windowing", OPT_CHOICE(egl_windowing,
+ {"auto", -1},
+ {"no", 0},
+ {"yes", 1})},
+ {"angle-flip", OPT_FLAG(flip)},
+ {"angle-max-frame-latency", OPT_REPLACED("swapchain-depth")},
+ {"angle-swapchain-length", OPT_REMOVED("controlled by --swapchain-depth")},
{0}
},
.defaults = &(const struct angle_opts) {
diff --git a/video/out/opengl/context_cocoa.c b/video/out/opengl/context_cocoa.c
index d0fcd63d62..b7cab8e718 100644
--- a/video/out/opengl/context_cocoa.c
+++ b/video/out/opengl/context_cocoa.c
@@ -28,7 +28,7 @@ struct cocoa_opts {
#define OPT_BASE_STRUCT struct cocoa_opts
const struct m_sub_options cocoa_conf = {
.opts = (const struct m_option[]) {
- OPT_REPLACED("cocoa-force-dedicated-gpu", "macos-force-dedicated-gpu"),
+ {"cocoa-force-dedicated-gpu", OPT_REPLACED("macos-force-dedicated-gpu")},
{0}
},
.size = sizeof(struct cocoa_opts),
diff --git a/video/out/vo_direct3d.c b/video/out/vo_direct3d.c
index a131d210cb..455c3faafd 100644
--- a/video/out/vo_direct3d.c
+++ b/video/out/vo_direct3d.c
@@ -1684,21 +1684,21 @@ static void draw_osd(struct vo *vo)
#define OPT_BASE_STRUCT d3d_priv
static const struct m_option opts[] = {
- OPT_FLAG("prefer-stretchrect", opt_prefer_stretchrect, 0),
- OPT_FLAG("disable-textures", opt_disable_textures, 0),
- OPT_FLAG("disable-stretchrect", opt_disable_stretchrect, 0),
- OPT_FLAG("disable-shaders", opt_disable_shaders, 0),
- OPT_FLAG("only-8bit", opt_only_8bit, 0),
- OPT_FLAG("force-power-of-2", opt_force_power_of_2, 0),
- OPT_FLAG("disable-texture-align", opt_disable_texture_align, 0),
- OPT_CHOICE("texture-memory", opt_texture_memory, 0,
- ({"default", 0},
- {"managed", 1},
- {"default-pool", 2},
- {"default-pool-shadow", 3},
- {"scratch", 4})),
- OPT_FLAG("swap-discard", opt_swap_discard, 0),
- OPT_FLAG("exact-backbuffer", opt_exact_backbuffer, 0),
+ {"prefer-stretchrect", OPT_FLAG(opt_prefer_stretchrect)},
+ {"disable-textures", OPT_FLAG(opt_disable_textures)},
+ {"disable-stretchrect", OPT_FLAG(opt_disable_stretchrect)},
+ {"disable-shaders", OPT_FLAG(opt_disable_shaders)},
+ {"only-8bit", OPT_FLAG(opt_only_8bit)},
+ {"force-power-of-2", OPT_FLAG(opt_force_power_of_2)},
+ {"disable-texture-align", OPT_FLAG(opt_disable_texture_align)},
+ {"texture-memory", OPT_CHOICE(opt_texture_memory,
+ {"default", 0},
+ {"managed", 1},
+ {"default-pool", 2},
+ {"default-pool-shadow", 3},
+ {"scratch", 4})},
+ {"swap-discard", OPT_FLAG(opt_swap_discard)},
+ {"exact-backbuffer", OPT_FLAG(opt_exact_backbuffer)},
{0}
};
diff --git a/video/out/vo_gpu.c b/video/out/vo_gpu.c
index 5b21646aa2..f765e79d34 100644
--- a/video/out/vo_gpu.c
+++ b/video/out/vo_gpu.c
@@ -311,10 +311,10 @@ err_out:
#define OPT_BASE_STRUCT struct gpu_priv
static const m_option_t options[] = {
- OPT_STRING_VALIDATE("gpu-context", context_name, 0, ra_ctx_validate_context),
- OPT_STRING_VALIDATE("gpu-api", context_type, 0, ra_ctx_validate_api),
- OPT_FLAG("gpu-debug", opts.debug, 0),
- OPT_FLAG("gpu-sw", opts.allow_sw, 0),
+ {"gpu-context", OPT_STRING_VALIDATE(context_name, ra_ctx_validate_context)},
+ {"gpu-api", OPT_STRING_VALIDATE(context_type, ra_ctx_validate_api)},
+ {"gpu-debug", OPT_FLAG(opts.debug)},
+ {"gpu-sw", OPT_FLAG(opts.allow_sw)},
{0}
};
diff --git a/video/out/vo_image.c b/video/out/vo_image.c
index 2a3b8fae87..15c1a34498 100644
--- a/video/out/vo_image.c
+++ b/video/out/vo_image.c
@@ -56,8 +56,8 @@ struct vo_image_opts {
static const struct m_sub_options vo_image_conf = {
.opts = (const struct m_option[]) {
- OPT_SUBSTRUCT("vo-image", opts, image_writer_conf, 0),
- OPT_STRING("vo-image-outdir", outdir, M_OPT_FILE),
+ {"vo-image", OPT_SUBSTRUCT(opts, image_writer_conf)},
+ {"vo-image-outdir", OPT_STRING(outdir), .flags = M_OPT_FILE},
{0},
},
.size = sizeof(struct vo_image_opts),
diff --git a/video/out/vo_null.c b/video/out/vo_null.c
index 7a0662fcb9..430cd8d12b 100644
--- a/video/out/vo_null.c
+++ b/video/out/vo_null.c
@@ -98,7 +98,7 @@ const struct vo_driver video_out_null = {
.uninit = uninit,
.priv_size = sizeof(struct priv),
.options = (const struct m_option[]) {
- OPT_DOUBLE("fps", cfg_fps, 0, .min = 0, .max = 10000),
+ {"fps", OPT_DOUBLE(cfg_fps), M_RANGE(0, 10000)},
{0},
},
.options_prefix = "vo-null",
diff --git a/video/out/vo_rpi.c b/video/out/vo_rpi.c
index 94bb30efe6..da066ec1d2 100644
--- a/video/out/vo_rpi.c
+++ b/video/out/vo_rpi.c
@@ -889,10 +889,10 @@ fail:
#define OPT_BASE_STRUCT struct priv
static const struct m_option options[] = {
- OPT_INT("display", display_nr, 0),
- OPT_INT("layer", layer, 0, OPTDEF_INT(-10)),
- OPT_FLAG("background", background, 0),
- OPT_FLAG("osd", enable_osd, 0, OPTDEF_INT(1)),
+ {"display", OPT_INT(display_nr)},
+ {"layer", OPT_INT(layer), OPTDEF_INT(-10)},
+ {"background", OPT_FLAG(background)},
+ {"osd", OPT_FLAG(enable_osd), OPTDEF_INT(1)},
{0},
};
diff --git a/video/out/vo_sdl.c b/video/out/vo_sdl.c
index 039547f2d4..b50fc6d94c 100644
--- a/video/out/vo_sdl.c
+++ b/video/out/vo_sdl.c
@@ -980,9 +980,9 @@ const struct vo_driver video_out_sdl = {
.screensaver_enabled = false,
},
.options = (const struct m_option []){
- OPT_FLAG("sw", allow_sw, 0),
- OPT_FLAG("switch-mode", switch_mode, 0),
- OPT_FLAG("vsync", vsync, 0),
+ {"sw", OPT_FLAG(allow_sw)},
+ {"switch-mode", OPT_FLAG(switch_mode)},
+ {"vsync", OPT_FLAG(vsync)},
{NULL}
},
.preinit = preinit,
diff --git a/video/out/vo_tct.c b/video/out/vo_tct.c
index 8018a6ba72..ddd27d0380 100644
--- a/video/out/vo_tct.c
+++ b/video/out/vo_tct.c
@@ -58,12 +58,12 @@ struct vo_tct_opts {
#define OPT_BASE_STRUCT struct vo_tct_opts
static const struct m_sub_options vo_tct_conf = {
.opts = (const m_option_t[]) {
- OPT_CHOICE("vo-tct-algo", algo, 0,
- ({"plain", ALGO_PLAIN},
- {"half-blocks", ALGO_HALF_BLOCKS})),
- OPT_INT("vo-tct-width", width, 0),
- OPT_INT("vo-tct-height", height, 0),
- OPT_FLAG("vo-tct-256", term256, 0),
+ {"vo-tct-algo", OPT_CHOICE(algo,
+ {"plain", ALGO_PLAIN},
+ {"half-blocks", ALGO_HALF_BLOCKS})},
+ {"vo-tct-width", OPT_INT(width)},
+ {"vo-tct-height", OPT_INT(height)},
+ {"vo-tct-256", OPT_FLAG(term256)},
{0}
},
.defaults = &(const struct vo_tct_opts) {
diff --git a/video/out/vo_vaapi.c b/video/out/vo_vaapi.c
index c94fbf56f7..91ce7bc534 100644
--- a/video/out/vo_vaapi.c
+++ b/video/out/vo_vaapi.c
@@ -897,12 +897,12 @@ const struct vo_driver video_out_vaapi = {
.scaling = VA_FILTER_SCALING_DEFAULT,
},
.options = (const struct m_option[]) {
- OPT_CHOICE("scaling", scaling, 0,
- ({"default", VA_FILTER_SCALING_DEFAULT},
- {"fast", VA_FILTER_SCALING_FAST},
- {"hq", VA_FILTER_SCALING_HQ},
- {"nla", VA_FILTER_SCALING_NL_ANAMORPHIC})),
- OPT_FLAG("scaled-osd", force_scaled_osd, 0),
+ {"scaling", OPT_CHOICE(scaling,
+ {"default", VA_FILTER_SCALING_DEFAULT},
+ {"fast", VA_FILTER_SCALING_FAST},
+ {"hq", VA_FILTER_SCALING_HQ},
+ {"nla", VA_FILTER_SCALING_NL_ANAMORPHIC})},
+ {"scaled-osd", OPT_FLAG(force_scaled_osd)},
{0}
},
.options_prefix = "vo-vaapi",
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c
index 177fd5e270..b5b936243f 100644
--- a/video/out/vo_vdpau.c
+++ b/video/out/vo_vdpau.c
@@ -1115,26 +1115,24 @@ const struct vo_driver video_out_vdpau = {
.uninit = uninit,
.priv_size = sizeof(struct vdpctx),
.options = (const struct m_option []){
- OPT_INTRANGE("deint", deint, 0, -4, 4),
- OPT_FLAG("chroma-deint", chroma_deint, 0, OPTDEF_INT(1)),
- OPT_FLAG("pullup", pullup, 0),
- OPT_FLOATRANGE("denoise", denoise, 0, 0, 1),
- OPT_FLOATRANGE("sharpen", sharpen, 0, -1, 1),
- OPT_INTRANGE("hqscaling", hqscaling, 0, 0, 9),
- OPT_FLOAT("fps", user_fps, 0),
- OPT_FLAG("composite-detect", composite_detect, 0, OPTDEF_INT(1)),
- OPT_INT("queuetime-windowed", flip_offset_window, 0, OPTDEF_INT(50)),
- OPT_INT("queuetime-fs", flip_offset_fs, 0, OPTDEF_INT(50)),
- OPT_INTRANGE("output-surfaces", num_output_surfaces, 0,
- 2, MAX_OUTPUT_SURFACES, OPTDEF_INT(3)),
- OPT_COLOR("colorkey", colorkey, 0,
- .defval = &(const struct m_color) {
- .r = 2, .g = 5, .b = 7, .a = 255,
- }),
- OPT_FLAG("force-yuv", force_yuv, 0),
- OPT_REPLACED("queuetime_windowed", "queuetime-windowed"),
- OPT_REPLACED("queuetime_fs", "queuetime-fs"),
- OPT_REPLACED("output_surfaces", "output-surfaces"),
+ {"deint", OPT_INT(deint), M_RANGE(-4, 4)},
+ {"chroma-deint", OPT_FLAG(chroma_deint), OPTDEF_INT(1)},
+ {"pullup", OPT_FLAG(pullup)},
+ {"denoise", OPT_FLOAT(denoise), M_RANGE(0, 1)},
+ {"sharpen", OPT_FLOAT(sharpen), M_RANGE(-1, 1)},
+ {"hqscaling", OPT_INT(hqscaling), M_RANGE(0, 9)},
+ {"fps", OPT_FLOAT(user_fps)},
+ {"composite-detect", OPT_FLAG(composite_detect), OPTDEF_INT(1)},
+ {"queuetime-windowed", OPT_INT(flip_offset_window), OPTDEF_INT(50)},
+ {"queuetime-fs", OPT_INT(flip_offset_fs), OPTDEF_INT(50)},
+ {"output-surfaces", OPT_INT(num_output_surfaces),
+ M_RANGE(2, MAX_OUTPUT_SURFACES), OPTDEF_INT(3)},
+ {"colorkey", OPT_COLOR(colorkey),
+ .defval = &(const struct m_color){.r = 2, .g = 5, .b = 7, .a = 255}},
+ {"force-yuv", OPT_FLAG(force_yuv)},
+ {"queuetime_windowed", OPT_REPLACED("queuetime-windowed")},
+ {"queuetime_fs", OPT_REPLACED("queuetime-fs")},
+ {"output_surfaces", OPT_REPLACED("output-surfaces")},
{NULL},
},
.options_prefix = "vo-vdpau",
diff --git a/video/out/vo_xv.c b/video/out/vo_xv.c
index 06812336d1..43fc046f9f 100644
--- a/video/out/vo_xv.c
+++ b/video/out/vo_xv.c
@@ -898,20 +898,20 @@ const struct vo_driver video_out_xv = {
.cfg_buffers = 2,
},
.options = (const struct m_option[]) {
- OPT_INT("port", xv_port, 0, .min = 0, .max = DBL_MAX),
- OPT_INT("adaptor", cfg_xv_adaptor, 0, .min = -1, .max = DBL_MAX),
- OPT_CHOICE("ck", xv_ck_info.source, 0,
- ({"use", CK_SRC_USE},
- {"set", CK_SRC_SET},
- {"cur", CK_SRC_CUR})),
- OPT_CHOICE("ck-method", xv_ck_info.method, 0,
- ({"none", CK_METHOD_NONE},
- {"bg", CK_METHOD_BACKGROUND},
- {"man", CK_METHOD_MANUALFILL},
- {"auto", CK_METHOD_AUTOPAINT})),
- OPT_INT("colorkey", colorkey, 0),
- OPT_INTRANGE("buffers", cfg_buffers, 0, 1, MAX_BUFFERS),
- OPT_REMOVED("no-colorkey", "use ck-method=none instead"),
+ {"port", OPT_INT(xv_port), M_RANGE(0, DBL_MAX)},
+ {"adaptor", OPT_INT(cfg_xv_adaptor), M_RANGE(-1, DBL_MAX)},
+ {"ck", OPT_CHOICE(xv_ck_info.source,
+ {"use", CK_SRC_USE},
+ {"set", CK_SRC_SET},
+ {"cur", CK_SRC_CUR})},
+ {"ck-method", OPT_CHOICE(xv_ck_info.method,
+ {"none", CK_METHOD_NONE},
+ {"bg", CK_METHOD_BACKGROUND},
+ {"man", CK_METHOD_MANUALFILL},
+ {"auto", CK_METHOD_AUTOPAINT})},
+ {"colorkey", OPT_INT(colorkey)},
+ {"buffers", OPT_INT(cfg_buffers), M_RANGE(1, MAX_BUFFERS)},
+ {"no-colorkey", OPT_REMOVED("use ck-method=none instead")},
{0}
},
.options_prefix = "xv",
diff --git a/video/out/vulkan/context.c b/video/out/vulkan/context.c
index a51a9a87db..000afe211e 100644
--- a/video/out/vulkan/context.c
+++ b/video/out/vulkan/context.c
@@ -87,16 +87,16 @@ done:
#define OPT_BASE_STRUCT struct vulkan_opts
const struct m_sub_options vulkan_conf = {
.opts = (const struct m_option[]) {
- OPT_STRING_VALIDATE("vulkan-device", device, 0, vk_validate_dev),
- OPT_CHOICE("vulkan-swap-mode", swap_mode, 0,
- ({"auto", -1},
- {"fifo", VK_PRESENT_MODE_FIFO_KHR},
- {"fifo-relaxed", VK_PRESENT_MODE_FIFO_RELAXED_KHR},
- {"mailbox", VK_PRESENT_MODE_MAILBOX_KHR},
- {"immediate", VK_PRESENT_MODE_IMMEDIATE_KHR})),
- OPT_INTRANGE("vulkan-queue-count", queue_count, 0, 1, 8),
- OPT_FLAG("vulkan-async-transfer", async_transfer, 0),
- OPT_FLAG("vulkan-async-compute", async_compute, 0),
+ {"vulkan-device", OPT_STRING_VALIDATE(device, vk_validate_dev)},
+ {"vulkan-swap-mode", OPT_CHOICE(swap_mode,
+ {"auto", -1},
+ {"fifo", VK_PRESENT_MODE_FIFO_KHR},
+ {"fifo-relaxed", VK_PRESENT_MODE_FIFO_RELAXED_KHR},
+ {"mailbox", VK_PRESENT_MODE_MAILBOX_KHR},
+ {"immediate", VK_PRESENT_MODE_IMMEDIATE_KHR})},
+ {"vulkan-queue-count", OPT_INT(queue_count), M_RANGE(1, 8)},
+ {"vulkan-async-transfer", OPT_FLAG(async_transfer)},
+ {"vulkan-async-compute", OPT_FLAG(async_compute)},
{0}
},
.size = sizeof(struct vulkan_opts),
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index 20a25f8652..ebb22e23c0 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -45,9 +45,11 @@
#define OPT_BASE_STRUCT struct wayland_opts
const struct m_sub_options wayland_conf = {
.opts = (const struct m_option[]) {
- OPT_FLAG("wayland-disable-vsync", disable_vsync, 0),
- OPT_INTRANGE("wayland-edge-pixels-pointer", edge_pixels_pointer, 10, 0, INT_MAX),
- OPT_INTRANGE("wayland-edge-pixels-touch", edge_pixels_touch, 64, 0, INT_MAX),
+ {"wayland-disable-vsync", OPT_FLAG(disable_vsync)},
+ {"wayland-edge-pixels-pointer", OPT_INT(edge_pixels_pointer),
+ M_RANGE(0, INT_MAX)},
+ {"wayland-edge-pixels-touch", OPT_INT(edge_pixels_touch),
+ M_RANGE(0, INT_MAX)},
{0},
},
.size = sizeof(struct wayland_opts),
diff --git a/video/sws_utils.c b/video/sws_utils.c
index 55faadb1ee..ee37fc4f91 100644
--- a/video/sws_utils.c
+++ b/video/sws_utils.c
@@ -57,27 +57,27 @@ struct sws_opts {
#define OPT_BASE_STRUCT struct sws_opts
const struct m_sub_options sws_conf = {
.opts = (const m_option_t[]) {
- OPT_CHOICE("scaler", scaler, 0,
- ({"fast-bilinear", SWS_FAST_BILINEAR},
- {"bilinear", SWS_BILINEAR},
- {"bicubic", SWS_BICUBIC},
- {"x", SWS_X},
- {"point", SWS_POINT},
- {"area", SWS_AREA},
- {"bicublin", SWS_BICUBLIN},
- {"gauss", SWS_GAUSS},
- {"sinc", SWS_SINC},
- {"lanczos", SWS_LANCZOS},
- {"spline", SWS_SPLINE})),
- OPT_FLOATRANGE("lgb", lum_gblur, 0, 0, 100.0),
- OPT_FLOATRANGE("cgb", chr_gblur, 0, 0, 100.0),
- OPT_INT("cvs", chr_vshift, 0),
- OPT_INT("chs", chr_hshift, 0),
- OPT_FLOATRANGE("ls", lum_sharpen, 0, -100.0, 100.0),
- OPT_FLOATRANGE("cs", chr_sharpen, 0, -100.0, 100.0),
- OPT_FLAG("fast", fast, 0),
- OPT_FLAG("bitexact", bitexact, 0),
- OPT_FLAG("allow-zimg", zimg, 0),
+ {"scaler", OPT_CHOICE(scaler,
+ {"fast-bilinear", SWS_FAST_BILINEAR},
+ {"bilinear", SWS_BILINEAR},
+ {"bicubic", SWS_BICUBIC},
+ {"x", SWS_X},
+ {"point", SWS_POINT},
+ {"area", SWS_AREA},
+ {"bicublin", SWS_BICUBLIN},
+ {"gauss", SWS_GAUSS},
+ {"sinc", SWS_SINC},
+ {"lanczos", SWS_LANCZOS},
+ {"spline", SWS_SPLINE})},
+ {"lgb", OPT_FLOAT(lum_gblur), M_RANGE(0, 100.0)},
+ {"cgb", OPT_FLOAT(chr_gblur), M_RANGE(0, 100.0)},
+ {"cvs", OPT_INT(chr_vshift)},
+ {"chs", OPT_INT(chr_hshift)},
+ {"ls", OPT_FLOAT(lum_sharpen), M_RANGE(-100.0, 100.0)},
+ {"cs", OPT_FLOAT(chr_sharpen), M_RANGE(-100.0, 100.0)},
+ {"fast", OPT_FLAG(fast)},
+ {"bitexact", OPT_FLAG(bitexact)},
+ {"allow-zimg", OPT_FLAG(zimg)},
{0}
},
.size = sizeof(struct sws_opts),
diff --git a/video/vaapi.c b/video/vaapi.c
index d0a2852a47..bee24c1e72 100644
--- a/video/vaapi.c
+++ b/video/vaapi.c
@@ -38,7 +38,7 @@ struct vaapi_opts {
#define OPT_BASE_STRUCT struct vaapi_opts
const struct m_sub_options vaapi_conf = {
.opts = (const struct m_option[]) {
- OPT_STRING("device", path, 0),
+ {"device", OPT_STRING(path)},
{0},
},
.defaults = &(const struct vaapi_opts) {
diff --git a/video/zimg.c b/video/zimg.c
index 8127e87b9d..6622094022 100644
--- a/video/zimg.c
+++ b/video/zimg.c
@@ -39,24 +39,23 @@ static const struct m_opt_choice_alternatives mp_zimg_scalers[] = {
{0}
};
-#define OPT_PARAM(name, var, flags) \
- OPT_DOUBLE(name, var, (flags) | M_OPT_DEFAULT_NAN)
+#define OPT_PARAM(var) OPT_DOUBLE(var), .flags = M_OPT_DEFAULT_NAN
#define OPT_BASE_STRUCT struct zimg_opts
const struct m_sub_options zimg_conf = {
.opts = (struct m_option[]) {
- OPT_CHOICE_C("scaler", scaler, 0, mp_zimg_scalers),
- OPT_PARAM("scaler-param-a", scaler_params[0], 0),
- OPT_PARAM("scaler-param-b", scaler_params[1], 0),
- OPT_CHOICE_C("scaler-chroma", scaler_chroma, 0, mp_zimg_scalers),
- OPT_PARAM("scaler-chroma-param-a", scaler_chroma_params[0], 0),
- OPT_PARAM("scaler-chroma-param-b", scaler_chroma_params[1], 0),
- OPT_CHOICE("dither", dither, 0,
- ({"no", ZIMG_DITHER_NONE},
- {"ordered", ZIMG_DITHER_ORDERED},
- {"random", ZIMG_DITHER_RANDOM},
- {"error-diffusion", ZIMG_DITHER_ERROR_DIFFUSION})),
- OPT_FLAG("fast", fast, 0),
+ {"scaler", OPT_CHOICE_C(scaler, mp_zimg_scalers)},
+ {"scaler-param-a", OPT_PARAM(scaler_params[0])},
+ {"scaler-param-b", OPT_PARAM(scaler_params[1])},
+ {"scaler-chroma", OPT_CHOICE_C(scaler_chroma, mp_zimg_scalers)},
+ {"scaler-chroma-param-a", OPT_PARAM(scaler_chroma_params[0])},
+ {"scaler-chroma-param-b", OPT_PARAM(scaler_chroma_params[1])},
+ {"dither", OPT_CHOICE(dither,
+ {"no", ZIMG_DITHER_NONE},
+ {"ordered", ZIMG_DITHER_ORDERED},
+ {"random", ZIMG_DITHER_RANDOM},
+ {"error-diffusion", ZIMG_DITHER_ERROR_DIFFUSION})},
+ {"fast", OPT_FLAG(fast)},
{0}
},
.size = sizeof(struct zimg_opts),