summaryrefslogtreecommitdiffstats
path: root/video/out/gl_osd.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-17 21:48:23 +0100
committerwm4 <wm4@nowhere>2014-12-17 21:48:23 +0100
commit10befa26d952ac2c403da1adcb3d36c300af0567 (patch)
tree4560871956886679f1a0292cde3a50571f433280 /video/out/gl_osd.c
parent07975877be410ed07d3110dc2a5350246360acd0 (diff)
downloadmpv-10befa26d952ac2c403da1adcb3d36c300af0567.tar.bz2
mpv-10befa26d952ac2c403da1adcb3d36c300af0567.tar.xz
vo_opengl: GLES 3 support
Tested with MESA on software emulation. Seems to work well, although the default FBO format in opengl-hq disables most interesting features. I have no idea how well it will work on real hardware (or if it does at all). Unfortunately, some features, including playback of 10 bit video, are not supported. Not sure what to do about this. GLES 2 or 1 do not work.
Diffstat (limited to 'video/out/gl_osd.c')
-rw-r--r--video/out/gl_osd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/video/out/gl_osd.c b/video/out/gl_osd.c
index 6b97ef77cf..2276dc9f71 100644
--- a/video/out/gl_osd.c
+++ b/video/out/gl_osd.c
@@ -42,6 +42,11 @@ static const struct osd_fmt_entry osd_to_gl3_formats[SUBBITMAP_COUNT] = {
[SUBBITMAP_RGBA] = {GL_RGBA, GL_BGRA, GL_UNSIGNED_BYTE},
};
+static const struct osd_fmt_entry osd_to_gles3_formats[SUBBITMAP_COUNT] = {
+ [SUBBITMAP_LIBASS] = {GL_R8, GL_RED, GL_UNSIGNED_BYTE},
+ [SUBBITMAP_RGBA] = {GL_RGBA8, GL_BGRA, 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},
@@ -61,8 +66,11 @@ struct mpgl_osd *mpgl_osd_init(GL *gl, struct mp_log *log, struct osd_state *osd
.scratch = talloc_zero_size(ctx, 1),
};
- if (!(gl->mpgl_caps & MPGL_CAP_TEX_RG))
+ if (gl->es) {
+ ctx->fmt_table = osd_to_gles3_formats;
+ } else if (!(gl->mpgl_caps & MPGL_CAP_TEX_RG)) {
ctx->fmt_table = osd_to_gl_legacy_formats;
+ }
for (int n = 0; n < MAX_OSD_PARTS; n++) {
struct mpgl_osd_part *p = talloc_ptrtype(ctx, p);