summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-10-01 12:01:57 +0200
committerwm4 <wm4@nowhere>2016-10-01 12:09:18 +0200
commit052584c9e2b87a69ef2359d88989a694910ac506 (patch)
treee155a7e3fcc6a8257f2416580224a1d644438f3e
parent52fea2f909ec7fd5c99819d1d283a6ac6bd0c937 (diff)
downloadmpv-052584c9e2b87a69ef2359d88989a694910ac506.tar.bz2
mpv-052584c9e2b87a69ef2359d88989a694910ac506.tar.xz
vo_opengl: add debugging options for testing with padded textures
-rw-r--r--DOCS/man/options.rst8
-rw-r--r--video/out/opengl/video.c13
-rw-r--r--video/out/opengl/video.h1
3 files changed, 17 insertions, 5 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst
index 9103d3d641..04d178764a 100644
--- a/DOCS/man/options.rst
+++ b/DOCS/man/options.rst
@@ -4490,12 +4490,18 @@ The following video options are currently all specific to ``--vo=opengl`` and
``--opengl-rectangle-textures``
Force use of rectangle textures (default: no). Normally this shouldn't have
any advantages over normal textures. Note that hardware decoding overrides
- this flag.
+ this flag. Could be removed any time.
``--background=<color>``
Color used to draw parts of the mpv window not covered by video. See
``--osd-color`` option how colors are defined.
+``--opengl-tex-pad-x``, ``--opengl-tex-pad-y``
+ Enlarge the video source textures by this many pixels. For debugging only
+ (normally textures are sized exactly, but due to hardware decoding interop
+ we may have to deal with additional padding, which can be tested with these
+ options). Could be removed any time.
+
Miscellaneous
-------------
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index 93930a5a21..7d7641a1ea 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -409,6 +409,8 @@ const struct m_sub_options gl_video_conf = {
OPT_FLAG("deband", deband, 0),
OPT_SUBSTRUCT("deband", deband_opts, deband_conf, 0),
OPT_FLOAT("sharpen", unsharp, 0),
+ OPT_INTRANGE("opengl-tex-pad-x", tex_pad_x, 0, 0, 4096),
+ OPT_INTRANGE("opengl-tex-pad-y", tex_pad_y, 0, 0, 4096),
OPT_SUBSTRUCT("", icc_opts, mp_icc_conf, 0),
{0}
@@ -875,14 +877,16 @@ static void init_video(struct gl_video *p)
plane->gl_target = gl_target;
- plane->w = plane->tex_w = mp_image_plane_w(&layout, n);
- plane->h = plane->tex_h = mp_image_plane_h(&layout, n);
+ plane->w = mp_image_plane_w(&layout, n);
+ plane->h = mp_image_plane_h(&layout, n);
+ plane->tex_w = plane->w + p->opts.tex_pad_x;
+ plane->tex_h = plane->h + p->opts.tex_pad_y;
gl->GenTextures(1, &plane->gl_texture);
gl->BindTexture(gl_target, plane->gl_texture);
gl->TexImage2D(gl_target, 0, plane->gl_internal_format,
- plane->w, plane->h, 0,
+ plane->tex_w, plane->tex_h, 0,
plane->gl_format, plane->gl_type, NULL);
int filter = plane->use_integer ? GL_NEAREST : GL_LINEAR;
@@ -893,7 +897,8 @@ static void init_video(struct gl_video *p)
gl->BindTexture(gl_target, 0);
- MP_VERBOSE(p, "Texture for plane %d: %dx%d\n", n, plane->w, plane->h);
+ MP_VERBOSE(p, "Texture for plane %d: %dx%d\n", n,
+ plane->tex_w, plane->tex_h);
}
}
diff --git a/video/out/opengl/video.h b/video/out/opengl/video.h
index 9c76c4a454..f2fe5e4423 100644
--- a/video/out/opengl/video.h
+++ b/video/out/opengl/video.h
@@ -130,6 +130,7 @@ struct gl_video_opts {
int deband;
struct deband_opts *deband_opts;
float unsharp;
+ int tex_pad_x, tex_pad_y;
struct mp_icc_opts *icc_opts;
};