From d890e0731c0a0c002c32e8be89130e178059d3ba Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 20 Jan 2017 13:38:28 +0100 Subject: options: refactor how --opengl-dcomposition is declared vo_opengl used to have it as sub-option, which made it very hard to pass down option values to backends in a generic way (even if these options were completely backend-specific). For --opengl-dcomposition we used a VOFLAG to deal with this. Fortunately, sub-options are gone, and we can just add it as global option. Move the option to context_angle.c and add it as global option. I thought about adding a mechanism to let backends declare options, which would get magically picked up my m_config instead of having to add them to the global option list manually (similar to VO vo_driver.options), but decided against this complexity just for 1 or 2 backends. Likewise, it could have been added as a single option to avoid the boilerplate of an option struct, but then again there are probably going to be more angle suboptions, and it's cleaner. --- options/options.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'options/options.c') diff --git a/options/options.c b/options/options.c index 6afe611c6d..af13d1e434 100644 --- a/options/options.c +++ b/options/options.c @@ -88,6 +88,8 @@ extern const struct m_obj_list af_obj_list; extern const struct m_obj_list vo_obj_list; extern const struct m_obj_list ao_obj_list; +extern const struct m_sub_options angle_conf; + const struct m_opt_choice_alternatives mp_hwdec_names[] = { {"no", HWDEC_NONE}, {"auto", HWDEC_AUTO}, @@ -691,6 +693,10 @@ const m_option_t mp_opts[] = { OPT_SUBSTRUCT("", gl_video_opts, gl_video_conf, 0), #endif +#if HAVE_EGL_ANGLE + OPT_SUBSTRUCT("", angle_opts, angle_conf, 0), +#endif + #if HAVE_ENCODING OPT_SUBSTRUCT("", encode_opts, encode_config, 0), #endif -- cgit v1.2.3