summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorChristoph Heinrich <christoph.heinrich@student.tugraz.at>2023-02-20 04:32:50 +0100
committerDudemanguy <random342@airmail.cc>2023-02-21 17:15:17 +0000
commit91cc0d8cf6a2cf264c243ca3b3e99b5fd4044c29 (patch)
tree448b141d92c9ea7636954213b587aaf380fc21db /video
parentb9850a6e8c45f95563a703af7f21dfe1c1ee40b6 (diff)
downloadmpv-91cc0d8cf6a2cf264c243ca3b3e99b5fd4044c29.tar.bz2
mpv-91cc0d8cf6a2cf264c243ca3b3e99b5fd4044c29.tar.xz
options: transition options from OPT_FLAG to OPT_BOOL
c78482045444c488bb7948305d583a55d17cd236 introduced a bool option type as a replacement for the flag type, but didn't actually transition and remove the flag type because it would have been too much mundane work.
Diffstat (limited to 'video')
-rw-r--r--video/decode/vd_lavc.c23
-rw-r--r--video/filter/vf_d3d11vpp.c12
-rw-r--r--video/filter/vf_fingerprint.c12
-rw-r--r--video/filter/vf_format.c16
-rw-r--r--video/filter/vf_vavpp.c11
-rw-r--r--video/filter/vf_vdpaupp.c12
-rw-r--r--video/image_writer.c15
-rw-r--r--video/image_writer.h8
-rw-r--r--video/out/cocoa_cb_common.swift2
-rw-r--r--video/out/d3d11/context.c12
-rw-r--r--video/out/d3d11/hwdec_d3d11va.c5
-rw-r--r--video/out/gpu/context.c4
-rw-r--r--video/out/gpu/context.h4
-rw-r--r--video/out/gpu/lcms.c4
-rw-r--r--video/out/gpu/lcms.h4
-rw-r--r--video/out/gpu/user_shaders.c1
-rw-r--r--video/out/gpu/video.c33
-rw-r--r--video/out/gpu/video.h26
-rw-r--r--video/out/mac/common.swift2
-rw-r--r--video/out/mac/gl_layer.swift4
-rw-r--r--video/out/mac/window.swift2
-rw-r--r--video/out/opengl/context.c8
-rw-r--r--video/out/opengl/context_angle.c6
-rw-r--r--video/out/opengl/libmpv_gl.c5
-rw-r--r--video/out/placebo/ra_pl.c1
-rw-r--r--video/out/vo_direct3d.c16
-rw-r--r--video/out/vo_gpu_next.c12
-rw-r--r--video/out/vo_kitty.c14
-rw-r--r--video/out/vo_rpi.c8
-rw-r--r--video/out/vo_sdl.c17
-rw-r--r--video/out/vo_sixel.c23
-rw-r--r--video/out/vo_tct.c4
-rw-r--r--video/out/vo_vaapi.c4
-rw-r--r--video/out/vo_vdpau.c16
-rw-r--r--video/out/vulkan/context.c8
-rw-r--r--video/out/wayland_common.c3
-rw-r--r--video/out/wayland_common.h2
-rw-r--r--video/sws_utils.c14
-rw-r--r--video/vdpau_mixer.h4
-rw-r--r--video/zimg.c4
-rw-r--r--video/zimg.h2
41 files changed, 185 insertions, 198 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index 2817bfedd5..82d78787d6 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -70,17 +70,17 @@ static int hwdec_opt_help(struct mp_log *log, const m_option_t *opt,
#define OPT_BASE_STRUCT struct vd_lavc_params
struct vd_lavc_params {
- int fast;
+ bool fast;
int film_grain;
- int show_all;
+ bool show_all;
int skip_loop_filter;
int skip_idct;
int skip_frame;
int framedrop;
int threads;
- int bitexact;
- int old_x264;
- int check_hw_profile;
+ bool bitexact;
+ bool old_x264;
+ bool check_hw_profile;
int software_fallback;
char **avopts;
int dr;
@@ -103,18 +103,18 @@ static const struct m_opt_choice_alternatives discard_names[] = {
const struct m_sub_options vd_lavc_conf = {
.opts = (const m_option_t[]){
- {"vd-lavc-fast", OPT_FLAG(fast)},
+ {"vd-lavc-fast", OPT_BOOL(fast)},
{"vd-lavc-film-grain", OPT_CHOICE(film_grain,
{"auto", -1}, {"cpu", 0}, {"gpu", 1})},
- {"vd-lavc-show-all", OPT_FLAG(show_all)},
+ {"vd-lavc-show-all", OPT_BOOL(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-bitexact", OPT_BOOL(bitexact)},
+ {"vd-lavc-assume-old-x264", OPT_BOOL(old_x264)},
+ {"vd-lavc-check-hw-profile", OPT_BOOL(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)},
@@ -131,8 +131,7 @@ const struct m_sub_options vd_lavc_conf = {
.size = sizeof(struct vd_lavc_params),
.defaults = &(const struct vd_lavc_params){
.film_grain = -1 /*auto*/,
- .show_all = 0,
- .check_hw_profile = 1,
+ .check_hw_profile = true,
.software_fallback = 3,
.skip_loop_filter = AVDISCARD_DEFAULT,
.skip_idct = AVDISCARD_DEFAULT,
diff --git a/video/filter/vf_d3d11vpp.c b/video/filter/vf_d3d11vpp.c
index 2f05219976..3f306e4be7 100644
--- a/video/filter/vf_d3d11vpp.c
+++ b/video/filter/vf_d3d11vpp.c
@@ -43,8 +43,8 @@
#define D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_FRAME_RATE_CONVERSION 0x20
struct opts {
- int deint_enabled;
- int interlaced_only;
+ bool deint_enabled;
+ bool interlaced_only;
int mode;
};
@@ -429,7 +429,6 @@ static struct mp_filter *vf_d3d11vpp_create(struct mp_filter *parent,
struct hwdec_imgfmt_request params = {
.imgfmt = IMGFMT_D3D11,
- .probing = false,
};
hwdec_devices_request_for_img_fmt(info->hwdec_devs, &params);
@@ -479,8 +478,8 @@ fail:
#define OPT_BASE_STRUCT struct opts
static const m_option_t vf_opts_fields[] = {
- {"deint", OPT_FLAG(deint_enabled)},
- {"interlaced-only", OPT_FLAG(interlaced_only)},
+ {"deint", OPT_BOOL(deint_enabled)},
+ {"interlaced-only", OPT_BOOL(interlaced_only)},
{"mode", OPT_CHOICE(mode,
{"blend", D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_BLEND},
{"bob", D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_BOB},
@@ -497,8 +496,7 @@ const struct mp_user_filter_entry vf_d3d11vpp = {
.name = "d3d11vpp",
.priv_size = sizeof(OPT_BASE_STRUCT),
.priv_defaults = &(const OPT_BASE_STRUCT) {
- .deint_enabled = 1,
- .interlaced_only = 0,
+ .deint_enabled = true,
.mode = D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_BOB,
},
.options = vf_opts_fields,
diff --git a/video/filter/vf_fingerprint.c b/video/filter/vf_fingerprint.c
index d06f80502d..8714382ff3 100644
--- a/video/filter/vf_fingerprint.c
+++ b/video/filter/vf_fingerprint.c
@@ -33,8 +33,8 @@
struct f_opts {
int type;
- int clear;
- int print;
+ bool clear;
+ bool print;
};
const struct m_opt_choice_alternatives type_names[] = {
@@ -46,14 +46,14 @@ const struct m_opt_choice_alternatives type_names[] = {
#define OPT_BASE_STRUCT struct f_opts
static const struct m_option f_opts_list[] = {
{"type", OPT_CHOICE_C(type, type_names)},
- {"clear-on-query", OPT_FLAG(clear)},
- {"print", OPT_FLAG(print)},
+ {"clear-on-query", OPT_BOOL(clear)},
+ {"print", OPT_BOOL(print)},
{0}
};
static const struct f_opts f_opts_def = {
.type = 16,
- .clear = 1,
+ .clear = true,
};
struct print_entry {
@@ -212,7 +212,7 @@ static struct mp_filter *f_create(struct mp_filter *parent, void *options)
.scaler_chroma_params = {NAN, NAN},
.scaler_chroma = ZIMG_RESIZE_BILINEAR,
.dither = ZIMG_DITHER_NONE,
- .fast = 1,
+ .fast = true,
};
return f;
}
diff --git a/video/filter/vf_format.c b/video/filter/vf_format.c
index 6c3061ce0a..0073efab7f 100644
--- a/video/filter/vf_format.c
+++ b/video/filter/vf_format.c
@@ -55,10 +55,10 @@ struct vf_format_opts {
int w, h;
int dw, dh;
double dar;
- int convert;
+ bool convert;
int force_scaler;
- int dovi;
- int film_grain;
+ bool dovi;
+ bool film_grain;
};
static void set_params(struct vf_format_opts *p, struct mp_image_params *out,
@@ -219,9 +219,9 @@ static const m_option_t vf_opts_fields[] = {
{"dw", OPT_INT(dw)},
{"dh", OPT_INT(dh)},
{"dar", OPT_DOUBLE(dar)},
- {"convert", OPT_FLAG(convert)},
- {"dolbyvision", OPT_FLAG(dovi)},
- {"film-grain", OPT_FLAG(film_grain)},
+ {"convert", OPT_BOOL(convert)},
+ {"dolbyvision", OPT_BOOL(dovi)},
+ {"film-grain", OPT_BOOL(film_grain)},
{"force-scaler", OPT_CHOICE(force_scaler,
{"auto", MP_SWS_AUTO},
{"sws", MP_SWS_SWS},
@@ -238,8 +238,8 @@ const struct mp_user_filter_entry vf_format = {
.priv_size = sizeof(OPT_BASE_STRUCT),
.priv_defaults = &(const OPT_BASE_STRUCT){
.rotate = -1,
- .dovi = 1,
- .film_grain = 1,
+ .dovi = true,
+ .film_grain = true,
},
.options = vf_opts_fields,
},
diff --git a/video/filter/vf_vavpp.c b/video/filter/vf_vavpp.c
index c96b4b3a5b..5b30c46163 100644
--- a/video/filter/vf_vavpp.c
+++ b/video/filter/vf_vavpp.c
@@ -51,8 +51,8 @@ struct pipeline {
struct opts {
int deint_type;
- int interlaced_only;
- int reversal_bug;
+ bool interlaced_only;
+ bool reversal_bug;
};
struct priv {
@@ -482,8 +482,8 @@ static const m_option_t vf_opts_fields[] = {
{"weave", 3},
{"motion-adaptive", 4},
{"motion-compensated", 5})},
- {"interlaced-only", OPT_FLAG(interlaced_only)},
- {"reversal-bug", OPT_FLAG(reversal_bug)},
+ {"interlaced-only", OPT_BOOL(interlaced_only)},
+ {"reversal-bug", OPT_BOOL(reversal_bug)},
{0}
};
@@ -494,8 +494,7 @@ const struct mp_user_filter_entry vf_vavpp = {
.priv_size = sizeof(OPT_BASE_STRUCT),
.priv_defaults = &(const OPT_BASE_STRUCT){
.deint_type = -1,
- .interlaced_only = 0,
- .reversal_bug = 1,
+ .reversal_bug = true,
},
.options = vf_opts_fields,
},
diff --git a/video/filter/vf_vdpaupp.c b/video/filter/vf_vdpaupp.c
index de5caa3534..0519f5a8b8 100644
--- a/video/filter/vf_vdpaupp.c
+++ b/video/filter/vf_vdpaupp.c
@@ -41,8 +41,8 @@
// processing on the final rendering process in the VO.
struct opts {
- int deint_enabled;
- int interlaced_only;
+ bool deint_enabled;
+ bool interlaced_only;
struct mp_vdpau_mixer_opts opts;
};
@@ -174,13 +174,13 @@ static const m_option_t vf_opts_fields[] = {
{"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)},
+ {"deint", OPT_BOOL(deint_enabled)},
+ {"chroma-deint", OPT_BOOL(opts.chroma_deint), OPTDEF_INT(1)},
+ {"pullup", OPT_BOOL(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)},
+ {"interlaced-only", OPT_BOOL(interlaced_only)},
{0}
};
diff --git a/video/image_writer.c b/video/image_writer.c
index 657ea6f64f..11f0f6fdb5 100644
--- a/video/image_writer.c
+++ b/video/image_writer.c
@@ -43,17 +43,16 @@
const struct image_writer_opts image_writer_opts_defaults = {
.format = AV_CODEC_ID_MJPEG,
- .high_bit_depth = 1,
+ .high_bit_depth = true,
.png_compression = 7,
.png_filter = 5,
.jpeg_quality = 90,
- .jpeg_source_chroma = 1,
- .webp_lossless = 0,
+ .jpeg_source_chroma = true,
.webp_quality = 75,
.webp_compression = 4,
.jxl_distance = 1.0,
.jxl_effort = 4,
- .tag_csp = 1,
+ .tag_csp = true,
};
const struct m_opt_choice_alternatives mp_image_writer_formats[] = {
@@ -72,18 +71,18 @@ const struct m_opt_choice_alternatives mp_image_writer_formats[] = {
const struct m_option image_writer_opts[] = {
{"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)},
+ {"jpeg-source-chroma", OPT_BOOL(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-lossless", OPT_BOOL(webp_lossless)},
{"webp-quality", OPT_INT(webp_quality), M_RANGE(0, 100)},
{"webp-compression", OPT_INT(webp_compression), M_RANGE(0, 6)},
#if HAVE_JPEGXL
{"jxl-distance", OPT_DOUBLE(jxl_distance), M_RANGE(0.0, 15.0)},
{"jxl-effort", OPT_INT(jxl_effort), M_RANGE(1, 9)},
#endif
- {"high-bit-depth", OPT_FLAG(high_bit_depth)},
- {"tag-colorspace", OPT_FLAG(tag_csp)},
+ {"high-bit-depth", OPT_BOOL(high_bit_depth)},
+ {"tag-colorspace", OPT_BOOL(tag_csp)},
{0},
};
diff --git a/video/image_writer.h b/video/image_writer.h
index 8a9d67e5bf..c4a9cea386 100644
--- a/video/image_writer.h
+++ b/video/image_writer.h
@@ -22,7 +22,7 @@ struct mp_log;
struct image_writer_opts {
int format;
- int high_bit_depth;
+ bool high_bit_depth;
int png_compression;
int png_filter;
int jpeg_quality;
@@ -31,13 +31,13 @@ struct image_writer_opts {
int jpeg_dpi;
int jpeg_progressive;
int jpeg_baseline;
- int jpeg_source_chroma;
- int webp_lossless;
+ bool jpeg_source_chroma;
+ bool webp_lossless;
int webp_quality;
int webp_compression;
double jxl_distance;
int jxl_effort;
- int tag_csp;
+ bool tag_csp;
};
extern const struct image_writer_opts image_writer_opts_defaults;
diff --git a/video/out/cocoa_cb_common.swift b/video/out/cocoa_cb_common.swift
index 5c312cbff0..03b263cf99 100644
--- a/video/out/cocoa_cb_common.swift
+++ b/video/out/cocoa_cb_common.swift
@@ -202,7 +202,7 @@ class CocoaCB: Common {
func shutdown(_ destroy: Bool = false) {
isShuttingDown = window?.isAnimating ?? false ||
- window?.isInFullscreen ?? false && Bool(mpv?.opts.native_fs ?? 1)
+ window?.isInFullscreen ?? false && mpv?.opts.native_fs ?? true
if window?.isInFullscreen ?? false && !(window?.isAnimating ?? false) {
window?.close()
}
diff --git a/video/out/d3d11/context.c b/video/out/d3d11/context.c
index b96039fe55..2d736203fd 100644
--- a/video/out/d3d11/context.c
+++ b/video/out/d3d11/context.c
@@ -34,12 +34,12 @@ static int d3d11_validate_adapter(struct mp_log *log,
struct d3d11_opts {
int feature_level;
int warp;
- int flip;
+ bool flip;
int sync_interval;
char *adapter_name;
int output_format;
int color_space;
- int exclusive_fs;
+ bool exclusive_fs;
};
#define OPT_BASE_STRUCT struct d3d11_opts
@@ -59,7 +59,7 @@ const struct m_sub_options d3d11_conf = {
{"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-flip", OPT_BOOL(flip)},
{"d3d11-sync-interval", OPT_INT(sync_interval), M_RANGE(0, 4)},
{"d3d11-adapter", OPT_STRING_VALIDATE(adapter_name,
d3d11_validate_adapter)},
@@ -75,18 +75,17 @@ const struct m_sub_options d3d11_conf = {
{"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-exclusive-fs", OPT_FLAG(exclusive_fs)},
+ {"d3d11-exclusive-fs", OPT_BOOL(exclusive_fs)},
{0}
},
.defaults = &(const struct d3d11_opts) {
.feature_level = D3D_FEATURE_LEVEL_12_1,
.warp = -1,
- .flip = 1,
+ .flip = true,
.sync_interval = 1,
.adapter_name = NULL,
.output_format = DXGI_FORMAT_UNKNOWN,
.color_space = -1,
- .exclusive_fs = 0,
},
.size = sizeof(struct d3d11_opts)
};
@@ -222,7 +221,6 @@ static bool d3d11_start_frame(struct ra_swapchain *sw, struct ra_fbo *out_fbo)
*out_fbo = (struct ra_fbo) {
.tex = p->backbuffer,
- .flip = false,
.color_space = p->swapchain_csp
};
return true;
diff --git a/video/out/d3d11/hwdec_d3d11va.c b/video/out/d3d11/hwdec_d3d11va.c
index 1bce9a5cd7..a080e5f618 100644
--- a/video/out/d3d11/hwdec_d3d11va.c
+++ b/video/out/d3d11/hwdec_d3d11va.c
@@ -28,17 +28,16 @@
#include "video/out/gpu/hwdec.h"
struct d3d11va_opts {
- int zero_copy;
+ bool zero_copy;
};
#define OPT_BASE_STRUCT struct d3d11va_opts
const struct m_sub_options d3d11va_conf = {
.opts = (const struct m_option[]) {
- {"d3d11va-zero-copy", OPT_FLAG(zero_copy)},
+ {"d3d11va-zero-copy", OPT_BOOL(zero_copy)},
{0}
},
.defaults = &(const struct d3d11va_opts) {
- .zero_copy = 0,
},
.size = sizeof(struct d3d11va_opts)
};
diff --git a/video/out/gpu/context.c b/video/out/gpu/context.c
index a145e2dc98..e41dd99476 100644
--- a/video/out/gpu/context.c
+++ b/video/out/gpu/context.c
@@ -269,8 +269,8 @@ const struct m_sub_options ra_ctx_conf = {
{"gpu-api",
OPT_STRING_VALIDATE(context_type, ra_ctx_validate_api),
.help = ra_ctx_api_help},
- {"gpu-debug", OPT_FLAG(debug)},
- {"gpu-sw", OPT_FLAG(allow_sw)},
+ {"gpu-debug", OPT_BOOL(debug)},
+ {"gpu-sw", OPT_BOOL(allow_sw)},
{0}
},
.size = sizeof(struct ra_ctx_opts),
diff --git a/video/out/gpu/context.h b/video/out/gpu/context.h
index dae95fa666..a7510c2afd 100644
--- a/video/out/gpu/context.h
+++ b/video/out/gpu/context.h
@@ -6,9 +6,9 @@
#include "ra.h"
struct ra_ctx_opts {
- int allow_sw; // allow software renderers
+ bool allow_sw; // allow software renderers
int want_alpha; // create an alpha framebuffer if possible
- int debug; // enable debugging layers/callbacks etc.
+ bool debug; // enable debugging layers/callbacks etc.
bool probing; // the backend was auto-probed
char *context_name; // filter by `ra_ctx_fns.name`
char *context_type; // filter by `ra_ctx_fns.type`
diff --git a/video/out/gpu/lcms.c b/video/out/gpu/lcms.c
index 3df5eba5f2..bbf857d968 100644
--- a/video/out/gpu/lcms.c
+++ b/video/out/gpu/lcms.c
@@ -491,9 +491,9 @@ 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[]) {
- {"use-embedded-icc-profile", OPT_FLAG(use_embedded)},
+ {"use-embedded-icc-profile", OPT_BOOL(use_embedded)},
{"icc-profile", OPT_STRING(profile), .flags = M_OPT_FILE},
- {"icc-profile-auto", OPT_FLAG(profile_auto)},
+ {"icc-profile-auto", OPT_BOOL(profile_auto)},
{"icc-cache-dir", OPT_STRING(cache_dir), .flags = M_OPT_FILE},
{"icc-intent", OPT_INT(intent)},
{"icc-force-contrast", OPT_CHOICE(contrast, {"no", 0}, {"inf", -1}),
diff --git a/video/out/gpu/lcms.h b/video/out/gpu/lcms.h
index 62b2437194..bd4b16175a 100644
--- a/video/out/gpu/lcms.h
+++ b/video/out/gpu/lcms.h
@@ -10,9 +10,9 @@
extern const struct m_sub_options mp_icc_conf;
struct mp_icc_opts {
- int use_embedded;
+ bool use_embedded;
char *profile;
- int profile_auto;
+ bool profile_auto;
char *cache_dir;
char *size_str;
int intent;
diff --git a/video/out/gpu/user_shaders.c b/video/out/gpu/user_shaders.c
index 708de87485..03842377f8 100644
--- a/video/out/gpu/user_shaders.c
+++ b/video/out/gpu/user_shaders.c
@@ -170,7 +170,6 @@ static bool parse_hook(struct mp_log *log, struct bstr *body,
*out = (struct gl_user_shader_hook){
.pass_desc = bstr0("(unknown)"),
.offset = identity_trans,
- .align_offset = false,
.width = {{ SZEXP_VAR_W, { .varname = bstr0("HOOKED") }}},
.height = {{ SZEXP_VAR_H, { .varname = bstr0("HOOKED") }}},
.cond = {{ SZEXP_CONST, { .cval = 1.0 }}},
diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c
index b94f4d85be..90b22dab23 100644
--- a/video/out/gpu/video.c
+++ b/video/out/gpu/video.c
@@ -25,6 +25,7 @@
#include <libavutil/common.h>
#include <libavutil/lfg.h>
+#include "options/m_option.h"
#include "video.h"
#include "misc/bstr.h"
@@ -312,7 +313,7 @@ static const struct gl_video_opts gl_video_opts_def = {
{{"mitchell", .params={NAN, NAN}}, {.params = {NAN, NAN}},
.clamp = 1, }, // tscale
},
- .scaler_resizes_only = 1,
+ .scaler_resizes_only = true,
.scaler_lut_size = 6,
.interpolation_threshold = 0.01,
.alpha_mode = ALPHA_BLEND_TILES,
@@ -368,7 +369,7 @@ const struct m_sub_options gl_video_conf = {
{"auto", 0}, {"yes", 1}, {"no", -1})},
{"gamma-factor", OPT_FLOAT(gamma), M_RANGE(0.1, 2.0),
.deprecation_message = "no replacement"},
- {"gamma-auto", OPT_FLAG(gamma_auto),
+ {"gamma-auto", OPT_BOOL(gamma_auto),
.deprecation_message = "no replacement"},
{"target-prim", OPT_CHOICE_C(target_prim, mp_csp_prim_names)},
{"target-trc", OPT_CHOICE_C(target_trc, mp_csp_trc_names)},
@@ -388,7 +389,7 @@ const struct m_sub_options gl_video_conf = {
{"st2094-40", TONE_MAPPING_ST2094_40},
{"st2094-10", TONE_MAPPING_ST2094_10})},
{"tone-mapping-param", OPT_FLOATDEF(tone_map.curve_param)},
- {"inverse-tone-mapping", OPT_FLAG(tone_map.inverse)},
+ {"inverse-tone-mapping", OPT_BOOL(tone_map.inverse)},
{"tone-mapping-crosstalk", OPT_FLOAT(tone_map.crosstalk),
M_RANGE(0.0, 0.3)},
{"tone-mapping-max-boost", OPT_FLOAT(tone_map.max_boost),
@@ -399,7 +400,7 @@ const struct m_sub_options gl_video_conf = {
{"max", TONE_MAP_MODE_MAX},
{"hybrid", TONE_MAP_MODE_HYBRID},
{"luma", TONE_MAP_MODE_LUMA})},
- {"tone-mapping-visualize", OPT_FLAG(tone_map.visualize)},
+ {"tone-mapping-visualize", OPT_BOOL(tone_map.visualize)},
{"gamut-mapping-mode", OPT_CHOICE(tone_map.gamut_mode,
{"auto", GAMUT_AUTO},
{"clip", GAMUT_CLIP},
@@ -416,17 +417,17 @@ const struct m_sub_options gl_video_conf = {
M_RANGE(0, 20.0)},
{"hdr-scene-threshold-high", OPT_FLOAT(tone_map.scene_threshold_high),
M_RANGE(0, 20.0)},
- {"opengl-pbo", OPT_FLAG(pbo)},
+ {"opengl-pbo", OPT_BOOL(pbo)},
SCALER_OPTS("scale", SCALER_SCALE),
SCALER_OPTS("dscale", SCALER_DSCALE),
SCALER_OPTS("cscale", SCALER_CSCALE),
SCALER_OPTS("tscale", SCALER_TSCALE),
{"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)},
+ {"scaler-resizes-only", OPT_BOOL(scaler_resizes_only)},
+ {"correct-downscaling", OPT_BOOL(correct_downscaling)},
+ {"linear-downscaling", OPT_BOOL(linear_downscaling)},
+ {"linear-upscaling", OPT_BOOL(linear_upscaling)},
+ {"sigmoid-upscaling", OPT_BOOL(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)},
@@ -438,7 +439,7 @@ const struct m_sub_options gl_video_conf = {
{"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", OPT_BOOL(temporal_dither)},
{"temporal-dither-period", OPT_INT(temporal_dither_period),
M_RANGE(1, 128)},
{"error-diffusion",
@@ -448,9 +449,9 @@ const struct m_sub_options gl_video_conf = {
{"yes", ALPHA_YES},
{"blend", ALPHA_BLEND},
{"blend-tiles", ALPHA_BLEND_TILES})},
- {"opengl-rectangle-textures", OPT_FLAG(use_rectangle)},
+ {"opengl-rectangle-textures", OPT_BOOL(use_rectangle)},
{"background", OPT_COLOR(background)},
- {"interpolation", OPT_FLAG(interpolation)},
+ {"interpolation", OPT_BOOL(interpolation)},
{"interpolation-threshold", OPT_FLOAT(interpolation_threshold)},
{"blend-subtitles", OPT_CHOICE(blend_subs,
{"no", BLEND_SUBS_NO},
@@ -459,7 +460,7 @@ const struct m_sub_options gl_video_conf = {
{"glsl-shaders", OPT_PATHLIST(user_shaders), .flags = M_OPT_FILE},
{"glsl-shader", OPT_CLI_ALIAS("glsl-shaders-append")},
{"glsl-shader-opts", OPT_KEYVALUELIST(user_shader_opts)},
- {"deband", OPT_FLAG(deband)},
+ {"deband", OPT_BOOL(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)},
@@ -3876,7 +3877,7 @@ static void check_gl_features(struct gl_video *p)
// p->opts is a copy => we can just mess with it.
p->opts.scaler[n].kernel.name = "bilinear";
if (n == SCALER_TSCALE)
- p->opts.interpolation = 0;
+ p->opts.interpolation = false;
}
}
}
@@ -3900,7 +3901,7 @@ static void check_gl_features(struct gl_video *p)
MP_WARN(p, "Disabling color management (GLSL version too old).\n");
}
if (!have_mglsl && p->opts.deband) {
- p->opts.deband = 0;
+ p->opts.deband = false;
MP_WARN(p, "Disabling debanding (GLSL version too old).\n");
}
}
diff --git a/video/out/gpu/video.h b/video/out/gpu/video.h
index 692d261584..0ef4618790 100644
--- a/video/out/gpu/video.h
+++ b/video/out/gpu/video.h
@@ -122,7 +122,7 @@ struct gl_tone_map_opts {
int curve;
float curve_param;
float max_boost;
- int inverse;
+ bool inverse;
float crosstalk;
int mode;
int compute_peak;
@@ -130,7 +130,7 @@ struct gl_tone_map_opts {
float scene_threshold_low;
float scene_threshold_high;
int gamut_mode;
- int visualize;
+