[vlc-devel] [PATCH] opengl: interop_android: disable if GL_OES_image_external is unavailable

Alexandre Janniaux ajanni at videolabs.io
Fri Nov 13 18:32:47 CET 2020


The necessary symbols are typically existing when running inside
renderdoc tracing environnement but the extension is not exposed in
renderdoc since it doesn't support it.
---
 modules/video_output/opengl/interop_android.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/modules/video_output/opengl/interop_android.c b/modules/video_output/opengl/interop_android.c
index 686ce5f981..abecb18354 100644
--- a/modules/video_output/opengl/interop_android.c
+++ b/modules/video_output/opengl/interop_android.c
@@ -30,6 +30,7 @@
 #include <vlc_plugin.h>
 #include "interop.h"
 #include "../android/utils.h"
+#include "gl_api.h"
 
 struct priv
 {
@@ -144,6 +145,14 @@ Open(vlc_object_t *obj)
      || !interop->vctx)
         return VLC_EGENERIC;
 
+    const char *extensions = interop->api->vt.GetString(GL_EXTENSIONS);
+    if (!vlc_gl_StrHasToken(extensions, "GL_OES_EGL_image_external"))
+    {
+        msg_Warn(&interop->obj, "GL_OES_EGL_image_external is not available,"
+                " disabling android interop.");
+        return VLC_EGENERIC;
+    }
+
     android_video_context_t *avctx =
         vlc_video_context_GetPrivate(interop->vctx, VLC_VIDEO_CONTEXT_AWINDOW);
 
-- 
2.29.2



More information about the vlc-devel mailing list