summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-07-10 12:52:13 +0200
committerwm4 <wm4@nowhere>2015-07-10 14:09:22 +0200
commita6b67abeaa634e210440650efd63d28e03e8d048 (patch)
tree32e195d4dd101c1e99c44606cd224b8eea27c4c1
parent01ce203ed7a4ab1014062fadec717f7c1fb2c0d1 (diff)
downloadmpv-deprecate_opengl_hq.tar.bz2
mpv-deprecate_opengl_hq.tar.xz
video: deprecate opengl-hqdeprecate_opengl_hq
In fact, remove opengl-hq completely. Add a profile that sets the opengl-hq options explicitly instead. It uses the vo-defaults option, so users can still use e.g. "vo=opengl:<options>" to customize the options. The future plan is "flattening" all vo_opengl sub-options to global options like "--vo-opengl-scale=...". Then the profile based approach will be much nicer. Some effort was spent to keep old configs (and command lines too) compatible to some degree. The compatibility has its limits, but should be sufficient for most uses.
-rw-r--r--DOCS/man/vo.rst36
-rw-r--r--options/m_option.c7
-rw-r--r--player/main.c27
-rw-r--r--video/out/gl_video.c20
-rw-r--r--video/out/gl_video.h1
-rw-r--r--video/out/vo.c3
-rw-r--r--video/out/vo_opengl.c22
7 files changed, 54 insertions, 62 deletions
diff --git a/DOCS/man/vo.rst b/DOCS/man/vo.rst
index 9f6e7277c3..5ae720febf 100644
--- a/DOCS/man/vo.rst
+++ b/DOCS/man/vo.rst
@@ -290,6 +290,23 @@ Available video output drivers are:
color space conversion and chroma upsampling is generally in the hand of
the hardware decoder APIs.
+ There is a high quality preset, which can be selected with
+ ``--profile=opengl-hq``. This sets the ``opengl`` VO, but also applies
+ a bunch of different default settings. It is almost equivalent to::
+
+ --vo=opengl:scale=spline36:cscale=spline36:dscale=mitchell:dither-depth=auto:fancy-downscaling:sigmoid-upscaling
+
+ You can list the actual profile contents with ``--show-profile=opengl-hq``.
+ Sometimes you can achieve better quality or performance by changing the
+ ``fbo-format`` suboption to ``rgb16f``, ``rgb32f`` or ``rgb``. Known
+ problems include Mesa/Intel not accepting ``rgb16``, Mesa sometimes not
+ being compiled with float texture support, and some OS X setups being very
+ slow with ``rgb16`` but fast with ``rgb32f``.
+
+ Note that some cheaper LCDs do dithering that gravely interferes with
+ ``opengl``'s dithering. Disabling dithering with ``dither-depth=no`` helps.
+
+
``scale=<filter>``
``bilinear``
@@ -806,21 +823,10 @@ Available video output drivers are:
See ``--osd-color`` option how colors are defined.
``opengl-hq``
- Same as ``opengl``, but with default settings for high quality rendering.
-
- This is equivalent to::
-
- --vo=opengl:scale=spline36:cscale=spline36:dscale=mitchell:dither-depth=auto:fancy-downscaling:sigmoid-upscaling
-
- Note that some cheaper LCDs do dithering that gravely interferes with
- ``opengl``'s dithering. Disabling dithering with ``dither-depth=no`` helps.
-
- Unlike ``opengl``, ``opengl-hq`` makes use of FBOs by default. Sometimes you
- can achieve better quality or performance by changing the ``fbo-format``
- suboption to ``rgb16f``, ``rgb32f`` or ``rgb``. Known problems include
- Mesa/Intel not accepting ``rgb16``, Mesa sometimes not being compiled with
- float texture support, and some OS X setups being very slow with ``rgb16``
- but fast with ``rgb32f``.
+ Deprecated. This merely selected a specific ``opengl`` preset, which is
+ now done with ``--profile=opengl-hq``. This VO entry does not exist, but
+ is explicitly handled to some degree after option parsing for the sake
+ of compatibility.
``sdl``
SDL 2.0+ Render video output driver, depending on system with or without
diff --git a/options/m_option.c b/options/m_option.c
index 020bd371ce..90fce87e6f 100644
--- a/options/m_option.c
+++ b/options/m_option.c
@@ -2635,8 +2635,11 @@ static int get_obj_param(struct mp_log *log, bstr opt_name, bstr obj_name,
{
int r;
- if (!config)
- return 0; // skip
+ if (!config) { // skip
+ *out_name = name;
+ *out_val = val;
+ return 1;
+ }
// va.start != NULL => of the form name=val (not positional)
// If it's just "name", and the associated option exists and is a flag,
diff --git a/player/main.c b/player/main.c
index b5d019db81..c51b1a2e07 100644
--- a/player/main.c
+++ b/player/main.c
@@ -117,6 +117,11 @@ static const char def_config[] =
"input-media-keys=no\n"
"input-app-events=no\n"
"stop-playback-on-init-failure=yes\n"
+ "\n"
+ "[opengl-hq]\n"
+ "vo=opengl\n"
+ "vo-defaults=opengl:scale=spline36:cscale=spline36:dscale=mitchell:"
+ "dither-depth=auto:fancy-downscaling:sigmoid-upscaling\n"
#if HAVE_ENCODING
"\n"
"[encoding]\n"
@@ -307,6 +312,26 @@ static bool handle_help_options(struct MPContext *mpctx)
return opt_exit;
}
+extern const struct m_obj_list vo_obj_list;
+
+static void handle_deprecated_options(struct MPContext *mpctx)
+{
+ struct MPOpts *opts = mpctx->opts;
+ struct m_obj_settings *vo = opts->vo.video_driver_list;
+ if (vo && vo->name && strcmp(vo->name, "opengl-hq") == 0) {
+ MP_WARN(mpctx,
+ "--vo=opengl-hq is deprecated! Use --profile=opengl-hq instead.\n");
+ // Fudge it. This will replace the --vo option too, which is why we
+ // unset/safe it, and later restore it.
+ opts->vo.video_driver_list = NULL;
+ m_config_set_profile(mpctx->mconfig, "opengl-hq", 0);
+ talloc_free(vo->name);
+ vo->name = talloc_strdup(NULL, "opengl");
+ m_option_type_obj_settings_list.free(&opts->vo.video_driver_list);
+ opts->vo.video_driver_list = vo;
+ }
+}
+
static int cfg_include(void *ctx, char *filename, int flags)
{
struct MPContext *mpctx = ctx;
@@ -415,6 +440,8 @@ int mp_initialize(struct MPContext *mpctx, char **options)
if (handle_help_options(mpctx))
return -2;
+ handle_deprecated_options(mpctx);
+
if (opts->dump_stats && opts->dump_stats[0]) {
if (mp_msg_open_stats_file(mpctx->global, opts->dump_stats) < 0)
MP_ERR(mpctx, "Failed to open stats file '%s'\n", opts->dump_stats);
diff --git a/video/out/gl_video.c b/video/out/gl_video.c
index 273a312b06..57d442c6e5 100644
--- a/video/out/gl_video.c
+++ b/video/out/gl_video.c
@@ -347,26 +347,6 @@ const struct gl_video_opts gl_video_opts_def = {
.gamma = 1.0f,
};
-const struct gl_video_opts gl_video_opts_hq_def = {
- .dither_depth = 0,
- .dither_size = 6,
- .fbo_format = GL_RGBA16,
- .fancy_downscaling = 1,
- .sigmoid_center = 0.75,
- .sigmoid_slope = 6.5,
- .sigmoid_upscaling = 1,
- .scaler = {
- {{"spline36", .params={NAN, NAN}}, {.params = {NAN, NAN}}}, // scale
- {{"mitchell", .params={NAN, NAN}}, {.params = {NAN, NAN}}}, // dscale
- {{"spline36", .params={NAN, NAN}}, {.params = {NAN, NAN}}}, // cscale
- {{"robidoux", .params={NAN, NAN}}, {.params = {NAN, NAN}}}, // tscale
- },
- .alpha_mode = 2,
- .background = {0, 0, 0, 255},
- .gamma = 1.0f,
- .blend_subs = 0,
-};
-
static int validate_scaler_opt(struct mp_log *log, const m_option_t *opt,
struct bstr name, struct bstr param);
diff --git a/video/out/gl_video.h b/video/out/gl_video.h
index 4e82215268..fbc7adbf9a 100644
--- a/video/out/gl_video.h
+++ b/video/out/gl_video.h
@@ -73,7 +73,6 @@ struct gl_video_opts {
};
extern const struct m_sub_options gl_video_conf;
-extern const struct gl_video_opts gl_video_opts_hq_def;
extern const struct gl_video_opts gl_video_opts_def;
struct gl_video;
diff --git a/video/out/vo.c b/video/out/vo.c
index 94dcabf00e..f38e963c4f 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -50,7 +50,6 @@
extern const struct vo_driver video_out_vdpau;
extern const struct vo_driver video_out_xv;
extern const struct vo_driver video_out_opengl;
-extern const struct vo_driver video_out_opengl_hq;
extern const struct vo_driver video_out_opengl_cb;
extern const struct vo_driver video_out_null;
extern const struct vo_driver video_out_image;
@@ -104,7 +103,6 @@ const struct vo_driver *const video_out_drivers[] =
&video_out_lavc,
#endif
#if HAVE_GL
- &video_out_opengl_hq,
&video_out_opengl_cb,
#endif
NULL
@@ -183,7 +181,6 @@ const struct m_obj_list vo_obj_list = {
.description = "video outputs",
.aliases = {
{"gl", "opengl"},
- {"gl3", "opengl-hq"},
{0}
},
.allow_unknown_entries = true,
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c
index b25d162d7b..981c2c96df 100644
--- a/video/out/vo_opengl.c
+++ b/video/out/vo_opengl.c
@@ -473,27 +473,10 @@ static const struct m_option options[] = {
{0},
};
-#define CAPS VO_CAP_ROTATE90
-
const struct vo_driver video_out_opengl = {
.description = "Extended OpenGL Renderer",
.name = "opengl",
- .caps = CAPS,
- .preinit = preinit,
- .query_format = query_format,
- .reconfig = reconfig,
- .control = control,
- .draw_frame = draw_frame,
- .flip_page = flip_page,
- .uninit = uninit,
- .priv_size = sizeof(struct gl_priv),
- .options = options,
-};
-
-const struct vo_driver video_out_opengl_hq = {
- .description = "Extended OpenGL Renderer (high quality rendering preset)",
- .name = "opengl-hq",
- .caps = CAPS,
+ .caps = VO_CAP_ROTATE90,
.preinit = preinit,
.query_format = query_format,
.reconfig = reconfig,
@@ -502,8 +485,5 @@ const struct vo_driver video_out_opengl_hq = {
.flip_page = flip_page,
.uninit = uninit,
.priv_size = sizeof(struct gl_priv),
- .priv_defaults = &(const struct gl_priv){
- .renderer_opts = (struct gl_video_opts *)&gl_video_opts_hq_def,
- },
.options = options,
};