summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-10-04 17:16:47 +0200
committerwm4 <wm4@nowhere>2012-10-16 07:26:32 +0200
commit3ad918bbc62449759bbf97f6a809ebdde27ad59e (patch)
tree24c3668687c5ebff37d6d1aaa0354d01310a0d8d /libvo
parentcc05910f16a5ccd8e3dca26a89e9c3835cbdb645 (diff)
downloadmpv-3ad918bbc62449759bbf97f6a809ebdde27ad59e.tar.bz2
mpv-3ad918bbc62449759bbf97f6a809ebdde27ad59e.tar.xz
sub: never decode subs to old OSD format
Instead, sd_lavc.c and spudec.c (the two image sub decoders) always output indexed/paletted images. For this purpose, add SUBBITMAP_INDEXED, and convert the subs to RGBA in img_convert.c instead. If a VO is used that supports the old OSD format only, the indexed bitmaps are converted to the old OSD format by abusing spudec.c in a similar way sd_lavc.c used to do. The main reason why spudec.c is used is because the images must not only be converted to the old format, but also properly scaled, cropped, and aligned (the asm code in libvo/osd.c requires this alignment). Remove support for the old format (packed variant) from the OpenGL VOs. (The packed formats were how the actual OSD format was handled in some GPU-driven VOs for a while.) Remove all conversions from old to new formats. Now all subtitle decoders and OSD renderers produce the new formats only. Add an evil hack to convert the new format (scaled+indexed bitmaps) to the old format. It creates a new spudec instance to convert images to grayscale and to scale them. This is temporary for VOs which don't support new OSD formats yet (vo_xv, vo_x11, vo_lavc).
Diffstat (limited to 'libvo')
-rw-r--r--libvo/gl_osd.c4
-rw-r--r--libvo/vo_gl3.c1
-rw-r--r--libvo/vo_gl3_shaders.glsl11
3 files changed, 0 insertions, 16 deletions
diff --git a/libvo/gl_osd.c b/libvo/gl_osd.c
index ce4bee5c03..74053afd4a 100644
--- a/libvo/gl_osd.c
+++ b/libvo/gl_osd.c
@@ -33,20 +33,16 @@ struct osd_fmt_entry {
static const int blend_factors[SUBBITMAP_COUNT][2] = {
[SUBBITMAP_LIBASS] = {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA},
[SUBBITMAP_RGBA] = {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA},
- [SUBBITMAP_OLD] = {GL_ONE, GL_ONE_MINUS_SRC_ALPHA},
};
static const struct osd_fmt_entry osd_to_gl3_formats[SUBBITMAP_COUNT] = {
[SUBBITMAP_LIBASS] = {GL_RED, GL_RED, GL_UNSIGNED_BYTE},
[SUBBITMAP_RGBA] = {GL_RGBA, GL_BGRA, GL_UNSIGNED_BYTE},
- [SUBBITMAP_OLD] = {GL_RG, GL_RG, GL_UNSIGNED_BYTE},
};
static const struct osd_fmt_entry osd_to_gl_legacy_formats[SUBBITMAP_COUNT] = {
[SUBBITMAP_LIBASS] = {GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE},
[SUBBITMAP_RGBA] = {GL_RGBA, GL_BGRA, GL_UNSIGNED_BYTE},
- [SUBBITMAP_OLD] =
- {GL_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE},
};
struct mpgl_osd *mpgl_osd_init(GL *gl, bool legacy)
diff --git a/libvo/vo_gl3.c b/libvo/vo_gl3.c
index f3c1767b78..f5df6a1ae4 100644
--- a/libvo/vo_gl3.c
+++ b/libvo/vo_gl3.c
@@ -252,7 +252,6 @@ static const struct fmt_entry mp_to_gl_formats[] = {
static const char *osd_shaders[SUBBITMAP_COUNT] = {
[SUBBITMAP_LIBASS] = "frag_osd_libass",
[SUBBITMAP_RGBA] = "frag_osd_rgba",
- [SUBBITMAP_OLD] = "frag_osd_old",
};
diff --git a/libvo/vo_gl3_shaders.glsl b/libvo/vo_gl3_shaders.glsl
index 20f8c597ad..04d886f9c0 100644
--- a/libvo/vo_gl3_shaders.glsl
+++ b/libvo/vo_gl3_shaders.glsl
@@ -66,17 +66,6 @@ void main() {
out_color = texture(texture1, texcoord);
}
-#!section frag_osd_old
-uniform sampler2D texture1;
-uniform vec4 osd_color;
-
-in vec2 texcoord;
-out vec4 out_color;
-
-void main() {
- out_color = texture(texture1, texcoord).rrrg * osd_color;
-}
-
#!section frag_video
uniform sampler2D texture1;
uniform sampler2D texture2;