summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-11-25 21:00:39 +0100
committerwm4 <wm4@nowhere>2016-11-25 21:17:25 +0100
commit1a2319f3e4cc42c680e2fd3ba30022c7a9adf3fe (patch)
tree37261ccac2acc614777ba4c790cfed78b96fb58f /video
parent98a257b3a871587a97f51ef1b09800959a94ed1e (diff)
downloadmpv-1a2319f3e4cc42c680e2fd3ba30022c7a9adf3fe.tar.bz2
mpv-1a2319f3e4cc42c680e2fd3ba30022c7a9adf3fe.tar.xz
options: remove deprecated sub-option handling for --vo and --ao
Long planned. Leads to some sanity. There still are some rather gross things. Especially g_groups is ugly, and a hack that can hopefully be removed. (There is a plan for it, but whether it's implemented depends on how much energy is left.)
Diffstat (limited to 'video')
-rw-r--r--video/out/opengl/video.c89
-rw-r--r--video/out/opengl/video.h1
-rw-r--r--video/out/vo.c16
-rw-r--r--video/out/vo.h16
-rw-r--r--video/out/vo_direct3d.c2
-rw-r--r--video/out/vo_drm.c1
-rw-r--r--video/out/vo_image.c12
-rw-r--r--video/out/vo_null.c2
-rw-r--r--video/out/vo_opengl.c110
-rw-r--r--video/out/vo_opengl_cb.c10
-rw-r--r--video/out/vo_rpi.c2
-rw-r--r--video/out/vo_sdl.c2
-rw-r--r--video/out/vo_vaapi.c2
-rw-r--r--video/out/vo_vdpau.c2
-rw-r--r--video/out/vo_wayland.c2
-rw-r--r--video/out/vo_xv.c2
16 files changed, 68 insertions, 203 deletions
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index 498d89259e..3bd67c29fe 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -428,95 +428,6 @@ const struct m_sub_options gl_video_conf = {
.change_flags = UPDATE_RENDERER,
};
-#define LEGACY_SCALER_OPTS(n) \
- OPT_SUBOPT_LEGACY(n, n), \
- OPT_SUBOPT_LEGACY(n"-param1", n"-param1"), \
- OPT_SUBOPT_LEGACY(n"-param2", n"-param2"), \
- OPT_SUBOPT_LEGACY(n"-blur", n"-blur"), \
- OPT_SUBOPT_LEGACY(n"-wparam", n"-wparam"), \
- OPT_SUBOPT_LEGACY(n"-clamp", n"-clamp"), \
- OPT_SUBOPT_LEGACY(n"-radius", n"-radius"), \
- OPT_SUBOPT_LEGACY(n"-antiring", n"-antiring"), \
- OPT_SUBOPT_LEGACY(n"-window", n"-window")
-
-const struct m_sub_options gl_video_conf_legacy = {
- .opts = (const m_option_t[]) {
- OPT_SUBOPT_LEGACY("dumb-mode", "opengl-dumb-mode"),
- OPT_SUBOPT_LEGACY("gamma", "opengl-gamma"),
- OPT_SUBOPT_LEGACY("gamma-auto", "gamma-auto"),
- OPT_SUBOPT_LEGACY("target-prim", "target-prim"),
- OPT_SUBOPT_LEGACY("target-trc", "target-trc"),
- OPT_SUBOPT_LEGACY("target-brightness", "target-brightness"),
- OPT_SUBOPT_LEGACY("hdr-tone-mapping", "hdr-tone-mapping"),
- OPT_SUBOPT_LEGACY("tone-mapping-param", "tone-mapping-param"),
- OPT_SUBOPT_LEGACY("pbo", "opengl-pbo"),
- LEGACY_SCALER_OPTS("scale"),
- LEGACY_SCALER_OPTS("dscale"),
- LEGACY_SCALER_OPTS("cscale"),
- LEGACY_SCALER_OPTS("tscale"),
- OPT_SUBOPT_LEGACY("scaler-lut-size", "scaler-lut-size"),
- OPT_SUBOPT_LEGACY("scaler-resizes-only", "scaler-resizes-only"),
- OPT_SUBOPT_LEGACY("linear-scaling", "linear-scaling"),
- OPT_SUBOPT_LEGACY("correct-downscaling", "correct-downscaling"),
- OPT_SUBOPT_LEGACY("sigmoid-upscaling", "sigmoid-upscaling"),
- OPT_SUBOPT_LEGACY("sigmoid-center", "sigmoid-center"),
- OPT_SUBOPT_LEGACY("sigmoid-slope", "sigmoid-slope"),
- OPT_SUBOPT_LEGACY("fbo-format", "opengl-fbo-format"),
- OPT_SUBOPT_LEGACY("dither-depth", "dither-depth"),
- OPT_SUBOPT_LEGACY("dither", "dither"),
- OPT_SUBOPT_LEGACY("dither-size-fruit", "dither-size-fruit"),
- OPT_SUBOPT_LEGACY("temporal-dither", "temporal-dither"),
- OPT_SUBOPT_LEGACY("temporal-dither-period", "temporal-dither-period"),
- OPT_SUBOPT_LEGACY("alpha", "alpha"),
- OPT_SUBOPT_LEGACY("rectangle-textures", "opengl-rectangle-textures"),
- OPT_SUBOPT_LEGACY("background", "background"),
- OPT_SUBOPT_LEGACY("interpolation", "interpolation"),
- OPT_SUBOPT_LEGACY("interpolation-threshold", "interpolation-threshold"),
- OPT_SUBOPT_LEGACY("blend-subtitles", "blend-subtitles"),
- OPT_SUBOPT_LEGACY("user-shaders", "opengl-shaders"),
- OPT_SUBOPT_LEGACY("deband", "deband"),
- OPT_SUBOPT_LEGACY("deband-iterations", "deband-iterations"),
- OPT_SUBOPT_LEGACY("deband-threshold", "deband-threshold"),
- OPT_SUBOPT_LEGACY("deband-range", "deband-range"),
- OPT_SUBOPT_LEGACY("deband-grain", "deband-grain"),
- OPT_SUBOPT_LEGACY("sharpen", "sharpen"),
- OPT_SUBOPT_LEGACY("icc-profile", "icc-profile"),
- OPT_SUBOPT_LEGACY("icc-profile-auto", "icc-profile-auto"),
- OPT_SUBOPT_LEGACY("icc-cache-dir", "icc-cache-dir"),
- OPT_SUBOPT_LEGACY("icc-intent", "icc-intent"),
- OPT_SUBOPT_LEGACY("icc-contrast", "icc-contrast"),
- OPT_SUBOPT_LEGACY("3dlut-size", "icc-3dlut-size"),
-
- OPT_REMOVED("approx-gamma", "this is always enabled now"),
- OPT_REMOVED("cscale-down", "chroma is never downscaled"),
- OPT_REMOVED("scale-sep", "this is set automatically whenever sane"),
- OPT_REMOVED("indirect", "this is set automatically whenever sane"),
- OPT_REMOVED("srgb", "use target-prim=bt709:target-trc=srgb instead"),
- OPT_REMOVED("source-shader", "use :deband to enable debanding"),
- OPT_REMOVED("prescale-luma", "use opengl-shaders for prescaling"),
- OPT_REMOVED("scale-shader", "use opengl-shaders instead"),
- OPT_REMOVED("pre-shaders", "use opengl-shaders instead"),
- OPT_REMOVED("post-shaders", "use opengl-shaders instead"),
-
- OPT_SUBOPT_LEGACY("lscale", "scale"),
- OPT_SUBOPT_LEGACY("lscale-down", "scale-down"),
- OPT_SUBOPT_LEGACY("lparam1", "scale-param1"),
- OPT_SUBOPT_LEGACY("lparam2", "scale-param2"),
- OPT_SUBOPT_LEGACY("lradius", "scale-radius"),
- OPT_SUBOPT_LEGACY("lantiring", "scale-antiring"),
- OPT_SUBOPT_LEGACY("cparam1", "cscale-param1"),
- OPT_SUBOPT_LEGACY("cparam2", "cscale-param2"),
- OPT_SUBOPT_LEGACY("cradius", "cscale-radius"),
- OPT_SUBOPT_LEGACY("cantiring", "cscale-antiring"),
- OPT_SUBOPT_LEGACY("smoothmotion", "interpolation"),
- OPT_SUBOPT_LEGACY("smoothmotion-threshold", "tscale-param1"),
- OPT_SUBOPT_LEGACY("scale-down", "dscale"),
- OPT_SUBOPT_LEGACY("fancy-downscaling", "correct-downscaling"),
-
- {0}
- },
-};
-
static void uninit_rendering(struct gl_video *p);
static void uninit_scaler(struct gl_video *p, struct scaler *scaler);
static void check_gl_features(struct gl_video *p);
diff --git a/video/out/opengl/video.h b/video/out/opengl/video.h
index 54b7022f27..3b5f452bf4 100644
--- a/video/out/opengl/video.h
+++ b/video/out/opengl/video.h
@@ -137,7 +137,6 @@ struct gl_video_opts {
};
extern const struct m_sub_options gl_video_conf;
-extern const struct m_sub_options gl_video_conf_legacy;
struct gl_video;
struct vo_frame;
diff --git a/video/out/vo.c b/video/out/vo.c
index cbd2ca87c8..72a47af227 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -176,8 +176,8 @@ static bool get_desc(struct m_obj_desc *dst, int index)
.priv_size = vo->priv_size,
.priv_defaults = vo->priv_defaults,
.options = vo->options,
+ .options_prefix = vo->options_prefix,
.global_opts = vo->global_opts,
- .legacy_prefix = vo->legacy_prefix,
.hidden = vo->encode || !strcmp(vo->name, "opengl-cb"),
.p = vo,
};
@@ -196,6 +196,7 @@ const struct m_obj_list vo_obj_list = {
.allow_unknown_entries = true,
.allow_trailer = true,
.disallow_positional_parameters = true,
+ .use_global_options = true,
};
static void dispatch_wakeup_cb(void *ptr)
@@ -214,7 +215,7 @@ static void dealloc_vo(struct vo *vo)
}
static struct vo *vo_create(bool probing, struct mpv_global *global,
- struct vo_extra *ex, char *name, char **args)
+ struct vo_extra *ex, char *name)
{
assert(ex->wakeup_cb);
@@ -254,11 +255,9 @@ static struct vo *vo_create(bool probing, struct mpv_global *global,
mp_input_set_mouse_transform(vo->input_ctx, NULL, NULL);
if (vo->driver->encode != !!vo->encode_lavc_ctx)
goto error;
- vo->config = m_config_from_obj_desc_and_args(vo, vo->log, global, &desc,
- name, vo->opts->vo_defs, args);
- if (!vo->config)
+ vo->priv = m_config_group_from_desc(vo, vo->log, global, &desc, name);
+ if (!vo->priv)
goto error;
- vo->priv = vo->config->optstruct;
if (pthread_create(&vo->in->thread, NULL, vo_thread, vo))
goto error;
@@ -283,8 +282,7 @@ struct vo *init_best_video_out(struct mpv_global *global, struct vo_extra *ex)
if (strlen(vo_list[n].name) == 0)
goto autoprobe;
bool p = !!vo_list[n + 1].name;
- struct vo *vo = vo_create(p, global, ex, vo_list[n].name,
- vo_list[n].attribs);
+ struct vo *vo = vo_create(p, global, ex, vo_list[n].name);
if (vo)
return vo;
}
@@ -296,7 +294,7 @@ autoprobe:
const struct vo_driver *driver = video_out_drivers[i];
if (driver == &video_out_null)
break;
- struct vo *vo = vo_create(true, global, ex, (char *)driver->name, NULL);
+ struct vo *vo = vo_create(true, global, ex, (char *)driver->name);
if (vo)
return vo;
}
diff --git a/video/out/vo.h b/video/out/vo.h
index 99e6ccabae..724e03ca41 100644
--- a/video/out/vo.h
+++ b/video/out/vo.h
@@ -312,17 +312,16 @@ struct vo_driver {
const void *priv_defaults;
// List of options to parse into priv struct (requires priv_size to be set)
- // Deprecated. Use global options or global_opts instead.
+ // This will register them as global options (with options_prefix), and
+ // copy the current value at VO creation time to the priv struct.
const struct m_option *options;
- // Global options to register if the VO is compiled in.
- // mp_get_config_group() or other function can be used to access them.
- const struct m_sub_options *global_opts;
+ // All options in the above array are prefixed with this string. (It's just
+ // for convenience and makes no difference in semantics.)
+ const char *options_prefix;
- // Evil hack: add .options as global options, using the provided prefix.
- // For further evilness, the options will be copied to the priv struct
- // like with normal .options behavior.
- const char *legacy_prefix;
+ // Registers global options that go to a separate options struct.
+ const struct m_sub_options *global_opts;
};
struct vo {
@@ -356,7 +355,6 @@ struct vo {
struct m_config_cache *opts_cache; // cache for ->opts
struct mp_vo_opts *opts;
- struct m_config *config; // config for ->priv
bool want_redraw; // redraw as soon as possible
diff --git a/video/out/vo_direct3d.c b/video/out/vo_direct3d.c
index c99ea372f6..63de6fee4a 100644
--- a/video/out/vo_direct3d.c
+++ b/video/out/vo_direct3d.c
@@ -1747,5 +1747,5 @@ const struct vo_driver video_out_direct3d = {
.priv_size = sizeof(d3d_priv),
.priv_defaults = &defaults,
.options = opts,
- .legacy_prefix = "vo-direct3d",
+ .options_prefix = "vo-direct3d",
};
diff --git a/video/out/vo_drm.c b/video/out/vo_drm.c
index 7e642e391c..92357587c5 100644
--- a/video/out/vo_drm.c
+++ b/video/out/vo_drm.c
@@ -490,5 +490,4 @@ const struct vo_driver video_out_drm = {
.wait_events = wait_events,
.wakeup = wakeup,
.priv_size = sizeof(struct priv),
- .legacy_prefix = "drm",
};
diff --git a/video/out/vo_image.c b/video/out/vo_image.c
index f799a97fe9..e1bc1aab20 100644
--- a/video/out/vo_image.c
+++ b/video/out/vo_image.c
@@ -160,18 +160,6 @@ const struct vo_driver video_out_image =
.name = "image",
.untimed = true,
.priv_size = sizeof(struct priv),
- .options = (const struct m_option[]) {
- OPT_SUBOPT_LEGACY("jpeg-quality", "vo-image-jpeg-quality"),
- OPT_SUBOPT_LEGACY("jpeg-smooth", "vo-image-jpeg-smooth"),
- OPT_SUBOPT_LEGACY("jpeg-source-chroma", "vo-image-jpeg-source-chroma"),
- OPT_SUBOPT_LEGACY("png-compression", "vo-image-png-compression"),
- OPT_SUBOPT_LEGACY("png-filter", "vo-image-png-filter"),
- OPT_SUBOPT_LEGACY("format", "vo-image-format"),
- OPT_SUBOPT_LEGACY("high-bit-depth", "vo-image-high-bit-depth"),
- OPT_SUBOPT_LEGACY("tag-colorspace", "vo-image-tag-colorspace"),
- OPT_SUBOPT_LEGACY("outdir", "vo-image-outdir"),
- {0},
- },
.preinit = preinit,
.query_format = query_format,
.reconfig = reconfig,
diff --git a/video/out/vo_null.c b/video/out/vo_null.c
index 39c1bf6361..fcf8dc9051 100644
--- a/video/out/vo_null.c
+++ b/video/out/vo_null.c
@@ -101,5 +101,5 @@ const struct vo_driver video_out_null = {
OPT_DOUBLE("fps", cfg_fps, M_OPT_RANGE, .min = 0, .max = 10000),
{0},
},
- .legacy_prefix = "vo-null",
+ .options_prefix = "vo-null",
};
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c
index 2517ba7412..508ba9cda9 100644
--- a/video/out/vo_opengl.c
+++ b/video/out/vo_opengl.c
@@ -62,40 +62,13 @@ struct vo_opengl_opts {
int pattern[2];
};
-#define OPT_BASE_STRUCT struct vo_opengl_opts
-static const struct m_sub_options vo_opengl_conf = {
- .opts = (const m_option_t[]) {
- OPT_FLAG("opengl-glfinish", use_glFinish, 0),
- OPT_FLAG("opengl-waitvsync", waitvsync, 0),
- OPT_INT("opengl-swapinterval", swap_interval, 0),
- OPT_CHOICE("opengl-dwmflush", dwm_flush, 0,
- ({"no", -1}, {"auto", 0}, {"windowed", 1}, {"yes", 2})),
- OPT_FLAG("opengl-dcomposition", allow_direct_composition, 0),
- OPT_FLAG("opengl-debug", use_gl_debug, 0),
- OPT_STRING_VALIDATE("opengl-backend", backend, 0,
- mpgl_validate_backend_opt),
- OPT_FLAG("opengl-sw", allow_sw, 0),
- OPT_CHOICE("opengl-es", es, 0, ({"no", -1}, {"auto", 0}, {"yes", 1})),
- OPT_INTPAIR("opengl-check-pattern", pattern, 0),
- OPT_INTRANGE("opengl-vsync-fences", vsync_fences, 0,
- 0, NUM_VSYNC_FENCES),
-
- {0}
- },
- .defaults = &(const struct vo_opengl_opts){
- .swap_interval = 1,
- .allow_direct_composition = 1,
- },
- .size = sizeof(struct vo_opengl_opts),
-};
-
struct gl_priv {
struct vo *vo;
struct mp_log *log;
MPGLContext *glctx;
GL *gl;
- struct vo_opengl_opts *opts;
+ struct vo_opengl_opts opts;
struct gl_video *renderer;
@@ -133,7 +106,7 @@ static void resize(struct gl_priv *p)
static void check_pattern(struct vo *vo, int item)
{
struct gl_priv *p = vo->priv;
- int expected = p->opts->pattern[p->last_pattern];
+ int expected = p->opts.pattern[p->last_pattern];
if (item == expected) {
p->last_pattern++;
if (p->last_pattern >= 2)
@@ -151,7 +124,7 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame)
struct gl_priv *p = vo->priv;
GL *gl = p->gl;
- if (gl->FenceSync && p->num_vsync_fences < p->opts->vsync_fences) {
+ if (gl->FenceSync && p->num_vsync_fences < p->opts.vsync_fences) {
GLsync fence = gl->FenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);;
if (fence)
p->vsync_fences[p->num_vsync_fences++] = fence;
@@ -159,7 +132,7 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame)
gl_video_render_frame(p->renderer, frame, gl->main_fb);
- if (p->opts->use_glFinish)
+ if (p->opts.use_glFinish)
gl->Finish();
}
@@ -171,30 +144,30 @@ static void flip_page(struct vo *vo)
mpgl_swap_buffers(p->glctx);
p->frames_rendered++;
- if (p->frames_rendered > 5 && !p->opts->use_gl_debug)
+ if (p->frames_rendered > 5 && !p->opts.use_gl_debug)
gl_video_set_debug(p->renderer, false);
- if (p->opts->use_glFinish)
+ if (p->opts.use_glFinish)
gl->Finish();
- if (p->opts->waitvsync || p->opts->pattern[0]) {
+ if (p->opts.waitvsync || p->opts.pattern[0]) {
if (gl->GetVideoSync) {
unsigned int n1 = 0, n2 = 0;
gl->GetVideoSync(&n1);
- if (p->opts->waitvsync)
+ if (p->opts.waitvsync)
gl->WaitVideoSync(2, (n1 + 1) % 2, &n2);
int step = n1 - p->prev_sgi_sync_count;
p->prev_sgi_sync_count = n1;
MP_DBG(vo, "Flip counts: %u->%u, step=%d\n", n1, n2, step);
- if (p->opts->pattern[0])
+ if (p->opts.pattern[0])
check_pattern(vo, step);
} else {
MP_WARN(vo, "GLX_SGI_video_sync not available, disabling.\n");
- p->opts->waitvsync = 0;
- p->opts->pattern[0] = 0;
+ p->opts.waitvsync = 0;
+ p->opts.pattern[0] = 0;
}
}
- while (p->opts->vsync_fences > 0 && p->num_vsync_fences >= p->opts->vsync_fences) {
+ while (p->opts.vsync_fences > 0 && p->num_vsync_fences >= p->opts.vsync_fences) {
gl->ClientWaitSync(p->vsync_fences[0], GL_SYNC_FLUSH_COMMANDS_BIT, 1e9);
gl->DeleteSync(p->vsync_fences[0]);
MP_TARRAY_REMOVE_AT(p->vsync_fences, p->num_vsync_fences, 0);
@@ -389,7 +362,6 @@ static int preinit(struct vo *vo)
struct gl_priv *p = vo->priv;
p->vo = vo;
p->log = vo->log;
- p->opts = mp_get_config_group(vo, vo->global, &vo_opengl_conf);
int vo_flags = 0;
@@ -399,29 +371,29 @@ static int preinit(struct vo *vo)
if (alpha_mode == 1)
vo_flags |= VOFLAG_ALPHA;
- if (p->opts->use_gl_debug)
+ if (p->opts.use_gl_debug)
vo_flags |= VOFLAG_GL_DEBUG;
- if (p->opts->es == 1)
+ if (p->opts.es == 1)
vo_flags |= VOFLAG_GLES;
- if (p->opts->es == -1)
+ if (p->opts.es == -1)
vo_flags |= VOFLAG_NO_GLES;
- if (p->opts->allow_sw)
+ if (p->opts.allow_sw)
vo_flags |= VOFLAG_SW;
- if (p->opts->allow_direct_composition)
+ if (p->opts.allow_direct_composition)
vo_flags |= VOFLAG_ANGLE_DCOMP;
- p->glctx = mpgl_init(vo, p->opts->backend, vo_flags);
+ p->glctx = mpgl_init(vo, p->opts.backend, vo_flags);
if (!p->glctx)
goto err_out;
p->gl = p->glctx->gl;
- p->glctx->dwm_flush_opt = p->opts->dwm_flush;
+ p->glctx->dwm_flush_opt = p->opts.dwm_flush;
if (p->gl->SwapInterval) {
- p->gl->SwapInterval(p->opts->swap_interval);
+ p->gl->SwapInterval(p->opts.swap_interval);
} else {
MP_VERBOSE(vo, "swap_control extension missing.\n");
}
@@ -454,21 +426,7 @@ err_out:
return -1;
}
-static const struct m_option legacy_options[] = {
- OPT_SUBOPT_LEGACY("glfinish", "opengl-glfinish"),
- OPT_SUBOPT_LEGACY("waitvsync", "opengl-waitvsync"),
- OPT_SUBOPT_LEGACY("swapinterval", "opengl-swapinterval"),
- OPT_SUBOPT_LEGACY("dwmflush", "opengl-dwmflush"),
- OPT_SUBOPT_LEGACY("dcomposition", "opengl-dcomposition"),
- OPT_SUBOPT_LEGACY("debug", "opengl-debug"),
- OPT_SUBOPT_LEGACY("backend", "opengl-backend"),
- OPT_SUBOPT_LEGACY("sw", "opengl-sw"),
- OPT_SUBOPT_LEGACY("es", "opengl-es"),
- OPT_SUBOPT_LEGACY("check-pattern", "opengl-check-pattern"),
- OPT_SUBOPT_LEGACY("vsync-fences", "opengl-vsync-fences"),
- OPT_SUBSTRUCT_LEGACY("", gl_video_conf_legacy),
- {0},
-};
+#define OPT_BASE_STRUCT struct gl_priv
const struct vo_driver video_out_opengl = {
.description = "Extended OpenGL Renderer",
@@ -484,6 +442,28 @@ const struct vo_driver video_out_opengl = {
.wakeup = wakeup,
.uninit = uninit,
.priv_size = sizeof(struct gl_priv),
- .options = legacy_options,
- .global_opts = &vo_opengl_conf,
+ .options = (const m_option_t[]) {
+ OPT_FLAG("opengl-glfinish", opts.use_glFinish, 0),
+ OPT_FLAG("opengl-waitvsync", opts.waitvsync, 0),
+ OPT_INT("opengl-swapinterval", opts.swap_interval, 0),
+ OPT_CHOICE("opengl-dwmflush", opts.dwm_flush, 0,
+ ({"no", -1}, {"auto", 0}, {"windowed", 1}, {"yes", 2})),
+ OPT_FLAG("opengl-dcomposition", opts.allow_direct_composition, 0),
+ OPT_FLAG("opengl-debug", opts.use_gl_debug, 0),
+ OPT_STRING_VALIDATE("opengl-backend", opts.backend, 0,
+ mpgl_validate_backend_opt),
+ OPT_FLAG("opengl-sw", opts.allow_sw, 0),
+ OPT_CHOICE("opengl-es", opts.es, 0, ({"no", -1}, {"auto", 0}, {"yes", 1})),
+ OPT_INTPAIR("opengl-check-pattern", opts.pattern, 0),
+ OPT_INTRANGE("opengl-vsync-fences", opts.vsync_fences, 0,
+ 0, NUM_VSYNC_FENCES),
+
+ {0}
+ },
+ .priv_defaults = &(const struct gl_priv){
+ .opts = {
+ .swap_interval = 1,
+ .allow_direct_composition = 1,
+ },
+ },
};
diff --git a/video/out/vo_opengl_cb.c b/video/out/vo_opengl_cb.c
index c66f6d434c..85e06ff598 100644
--- a/video/out/vo_opengl_cb.c
+++ b/video/out/vo_opengl_cb.c
@@ -144,7 +144,7 @@ static void copy_vo_opts(struct vo *vo)
// copy the struct with an assignment.
// Just remove all the dynamic data to avoid confusion.
struct mp_vo_opts opts = *vo->opts;
- opts.video_driver_list = opts.vo_defs = NULL;
+ opts.video_driver_list = NULL;
opts.winname = NULL;
opts.sws_opts = NULL;
p->ctx->vo_opts = opts;
@@ -529,13 +529,6 @@ static int preinit(struct vo *vo)
return 0;
}
-#define OPT_BASE_STRUCT struct vo_priv
-static const struct m_option options[] = {
- OPT_SUBOPT_LEGACY("debug", "opengl-debug"),
- OPT_SUBSTRUCT_LEGACY("", gl_video_conf_legacy),
- {0},
-};
-
const struct vo_driver video_out_opengl_cb = {
.description = "OpenGL Callbacks for libmpv",
.name = "opengl-cb",
@@ -548,5 +541,4 @@ const struct vo_driver video_out_opengl_cb = {
.flip_page = flip_page,
.uninit = uninit,
.priv_size = sizeof(struct vo_priv),
- .options = options,
};
diff --git a/video/out/vo_rpi.c b/video/out/vo_rpi.c
index acec865c6b..4824ac2616 100644
--- a/video/out/vo_rpi.c
+++ b/video/out/vo_rpi.c
@@ -933,5 +933,5 @@ const struct vo_driver video_out_rpi = {
.uninit = uninit,
.priv_size = sizeof(struct priv),
.options = options,
- .legacy_prefix = "rpi",
+ .options_prefix = "rpi",
};
diff --git a/video/out/vo_sdl.c b/video/out/vo_sdl.c
index 76f336ffeb..e32e89aaf3 100644
--- a/video/out/vo_sdl.c
+++ b/video/out/vo_sdl.c
@@ -1032,5 +1032,5 @@ const struct vo_driver video_out_sdl = {
.flip_page = flip_page,
.wait_events = wait_events,
.wakeup = wakeup,
- .legacy_prefix = "sdl",
+ .options_prefix = "sdl",
};
diff --git a/video/out/vo_vaapi.c b/video/out/vo_vaapi.c
index 0b741850b0..4aa1ef37df 100644
--- a/video/out/vo_vaapi.c
+++ b/video/out/vo_vaapi.c
@@ -696,5 +696,5 @@ const struct vo_driver video_out_vaapi = {
OPT_FLAG("scaled-osd", force_scaled_osd, 0),
{0}
},
- .legacy_prefix = "vo-vaapi",
+ .options_prefix = "vo-vaapi",
};
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c
index 757c31e32f..eb89301e94 100644
--- a/video/out/vo_vdpau.c
+++ b/video/out/vo_vdpau.c
@@ -1164,5 +1164,5 @@ const struct vo_driver video_out_vdpau = {
OPT_REPLACED("output_surfaces", "output-surfaces"),
{NULL},
},
- .legacy_prefix = "vo-vdpau",
+ .options_prefix = "vo-vdpau",
};
diff --git a/video/out/vo_wayland.c b/video/out/vo_wayland.c
index 6a7b18a6c5..37ab4c7858 100644
--- a/video/out/vo_wayland.c
+++ b/video/out/vo_wayland.c
@@ -677,6 +677,6 @@ const struct vo_driver video_out_wayland = {
OPT_FLAG("rgb565", use_rgb565, 0),
{0}
},
- .legacy_prefix = "vo-wayland",
+ .options_prefix = "vo-wayland",
};
diff --git a/video/out/vo_xv.c b/video/out/vo_xv.c
index 1cc5b0197b..cbc64433ee 100644
--- a/video/out/vo_xv.c
+++ b/video/out/vo_xv.c
@@ -933,5 +933,5 @@ const struct vo_driver video_out_xv = {
OPT_REMOVED("no-colorkey", "use ck-method=none instead"),
{0}
},
- .legacy_prefix = "xv",
+ .options_prefix = "xv",
};