From de3e26bc846eee938248c9be3a688091f0eab49c Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 19 Dec 2014 00:15:29 +0100 Subject: vo_opengl: disable some unavailable features under ES There are probably many more which I overlooked. --- video/out/gl_common.c | 5 ++++- video/out/gl_video.c | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/video/out/gl_common.c b/video/out/gl_common.c index 8d511bd13b..7389d90370 100644 --- a/video/out/gl_common.c +++ b/video/out/gl_common.c @@ -802,6 +802,8 @@ void glClearTex(GL *gl, GLenum target, GLenum format, GLenum type, void glDownloadTex(GL *gl, GLenum target, GLenum format, GLenum type, void *dataptr, int stride) { + if (!gl->GetTexImage) + abort(); // this is not always correct, but should work for MPlayer glAdjustAlignment(gl, stride); gl->PixelStorei(GL_PACK_ROW_LENGTH, stride / glFmt2bpp(format, type)); @@ -810,12 +812,13 @@ void glDownloadTex(GL *gl, GLenum target, GLenum format, GLenum type, mp_image_t *glGetWindowScreenshot(GL *gl) { + if (gl->es) + return NULL; // ES can't read from front buffer GLint vp[4]; //x, y, w, h gl->GetIntegerv(GL_VIEWPORT, vp); mp_image_t *image = mp_image_alloc(IMGFMT_RGB24, vp[2], vp[3]); if (!image) return NULL; - gl->BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); gl->PixelStorei(GL_PACK_ALIGNMENT, 1); gl->PixelStorei(GL_PACK_ROW_LENGTH, 0); gl->ReadBuffer(GL_FRONT); diff --git a/video/out/gl_video.c b/video/out/gl_video.c index 8541559b90..5fafcd04f1 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -1933,7 +1933,7 @@ struct mp_image *gl_video_download_image(struct gl_video *p) struct video_image *vimg = &p->image; - if (!p->have_image) + if (!p->have_image || !gl->GetTexImage) return NULL; if (p->hwdec_active && p->hwdec->driver->download_image) { @@ -2060,7 +2060,6 @@ static bool test_fbo(struct gl_video *p, GLenum format) GL *gl = p->gl; bool success = false; struct fbotex fbo = {0}; - gl->BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); gl->PixelStorei(GL_PACK_ALIGNMENT, 1); gl->PixelStorei(GL_PACK_ROW_LENGTH, 0); if (fbotex_init(p, &fbo, 16, 16, format)) { @@ -2145,6 +2144,10 @@ static void check_gl_features(struct gl_video *p) p->opts.scale_sep = false; p->opts.indirect = false; } + if (gl->es && p->opts.pbo) { + p->opts.pbo = 0; + disabled[n_disabled++] = "PBOs (GLES unsupported)"; + } if (n_disabled) { MP_ERR(p, "Some OpenGL extensions not detected, disabling: "); -- cgit v1.2.3