summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-07-22 02:14:15 +0200
committerwm4 <wm4@nowhere>2013-07-22 02:14:15 +0200
commitb38e631ed211734f019e9844c00b1f72ddb20842 (patch)
treed7ccfa7c3dd66239961b60013b1ca1173bb7765e
parent7bf1b9066cd179022f43c8d5b3d69cbce4b66e80 (diff)
downloadmpv-b38e631ed211734f019e9844c00b1f72ddb20842.tar.bz2
mpv-b38e631ed211734f019e9844c00b1f72ddb20842.tar.xz
vo_opengl: some option changes
Doing "mpv --vo=opengl:lscale=help" now lists possible scalers and exits. The "backend" suboption behaves similar. Make the "stereo" suboption a choice, instead of using magic integer values.
-rw-r--r--DOCS/man/en/vo.rst41
-rw-r--r--video/out/gl_common.c8
-rw-r--r--video/out/gl_video.c14
3 files changed, 33 insertions, 30 deletions
diff --git a/DOCS/man/en/vo.rst b/DOCS/man/en/vo.rst
index 8f314f9b64..42078dd6f8 100644
--- a/DOCS/man/en/vo.rst
+++ b/DOCS/man/en/vo.rst
@@ -235,31 +235,6 @@ Available video output drivers are:
(or if the necessary extensions are available).
``lscale=<filter>``
- Set the scaling filter. Possible choices:
- bilinear
- bicubic_fast
- sharpen3
- sharpen5
- hanning
- hamming
- hermite
- quadric
- bicubic
- kaiser
- catmull_rom
- mitchell
- spline16
- spline36
- gaussian
- sinc2
- sinc3
- sinc4
- lanczos2
- lanczos3
- lanczos4
- blackman2
- blackman3
- blackman4
``bilinear``
Bilinear hardware texture filtering (fastest, mid-quality).
@@ -288,6 +263,10 @@ Available video output drivers are:
Mitchell-Netravali. The ``b`` and ``c`` parameters can be set with
``lparam1`` and ``lparam2``. Both are set to 1/3 by default.
+
+ There are some more filters. For a complete list, pass ``help`` as
+ value, e.g.: ``mpv --vo=opengl:lscale=help``
+
``lparam1=<value>``
Set filter parameters. Ignored if the filter is not tunable. These are
unset by default, and use the filter specific default if applicable.
@@ -307,13 +286,13 @@ Available video output drivers are:
Select a method for stereo display. You may have to use ``--aspect`` to
fix the aspect value. Experimental, do not expect too much from it.
- 0
+ no
Normal 2D display
- 1
+ red-cyan
Convert side by side input to full-color red-cyan stereo.
- 2
+ green-magenta
Convert side by side input to full-color green-magenta stereo.
- 3
+ quadbuffer
Convert side by side input to quadbuffered stereo. Only supported
by very few OpenGL cards.
@@ -406,6 +385,10 @@ Available video output drivers are:
Continue even if a software renderer is detected.
``backend=<sys>``
+ The value ``auto`` (the default) selects the windowing backend. You
+ can also pass ``help`` to get a complete list of compiled in backends
+ (sorted by autoprobe order).
+
auto
auto-select (default)
cocoa
diff --git a/video/out/gl_common.c b/video/out/gl_common.c
index 6ede196cb4..497387aa4f 100644
--- a/video/out/gl_common.c
+++ b/video/out/gl_common.c
@@ -43,6 +43,7 @@
#include "talloc.h"
#include "gl_common.h"
#include "core/options.h"
+#include "core/m_option.h"
#include "sub/sub.h"
#include "bitmap_packer.h"
@@ -879,6 +880,13 @@ int mpgl_find_backend(const char *name)
int mpgl_validate_backend_opt(const struct m_option *opt, struct bstr name,
struct bstr param)
{
+ if (bstr_equals0(param, "help")) {
+ mp_msg(MSGT_VO, MSGL_INFO, "OpenGL windowing backends:\n");
+ mp_msg(MSGT_VO, MSGL_INFO, " auto (autodetect)\n");
+ for (const struct backend *entry = backends; entry->name; entry++)
+ mp_msg(MSGT_VO, MSGL_INFO, " %s\n", entry->name);
+ return M_OPT_EXIT - 1;
+ }
char s[20];
snprintf(s, sizeof(s), "%.*s", BSTR_P(param));
return mpgl_find_backend(s) >= -1 ? 1 : M_OPT_INVALID;
diff --git a/video/out/gl_video.c b/video/out/gl_video.c
index dac2bb2451..98862b92e7 100644
--- a/video/out/gl_video.c
+++ b/video/out/gl_video.c
@@ -283,7 +283,11 @@ const struct m_sub_options gl_video_conf = {
OPT_FLAG("srgb", srgb, 0),
OPT_FLAG("npot", npot, 0),
OPT_FLAG("pbo", pbo, 0),
- OPT_INT("stereo", stereo_mode, 0),
+ OPT_CHOICE("stereo", stereo_mode, 0,
+ ({"no", 0},
+ {"red-cyan", GL_3D_RED_CYAN},
+ {"green-magenta", GL_3D_GREEN_MAGENTA},
+ {"quadbuffer", GL_3D_QUADBUFFER})),
OPT_STRING_VALIDATE("lscale", scalers[0], 0, validate_scaler_opt),
OPT_STRING_VALIDATE("cscale", scalers[1], 0, validate_scaler_opt),
OPT_FLOAT("lparam1", scaler_params[0], 0),
@@ -2059,6 +2063,14 @@ bool gl_video_get_equalizer(struct gl_video *p, const char *name, int *val)
static int validate_scaler_opt(const m_option_t *opt, struct bstr name,
struct bstr param)
{
+ if (bstr_equals0(param, "help")) {
+ mp_msg(MSGT_VO, MSGL_INFO, "Available scalers:\n");
+ for (const char **filter = fixed_scale_filters; *filter; filter++)
+ mp_msg(MSGT_VO, MSGL_INFO, " %s\n", *filter);
+ for (int n = 0; mp_filter_kernels[n].name; n++)
+ mp_msg(MSGT_VO, MSGL_INFO, " %s\n", mp_filter_kernels[n].name);
+ return M_OPT_EXIT - 1;
+ }
char s[20];
snprintf(s, sizeof(s), "%.*s", BSTR_P(param));
return handle_scaler_opt(s) ? 1 : M_OPT_INVALID;