vo_opengl: add debugging options for testing with padded textures

This commit is contained in:
wm4 2016-10-01 12:01:57 +02:00
parent 52fea2f909
commit 052584c9e2
3 changed files with 17 additions and 5 deletions

View File

@ -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
-------------

View File

@ -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);
}
}

View File

@ -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;
};