opengl: interop: handle GLES2 case during runtime
Fix a future issue when using the code against a GLES2 provider, where the detection was done at build time instead of runtime. The build time check is needed to prevent using non-existant function and defines, but the runtime check will be needed whenever OpenGL headers are available.
With the work allowing to use the opengl filter with a gles2 provider on Linux with OpenGL available (not merged), it leads to:
$ MESA_DEBUG=1 ./vlc -vv ~/Video/dog_meme.mp4 --video-filter='opengl{filter=mock{mask},gles=any}'
Mesa: User error: GL_INVALID_ENUM in glTexParameter(pname=GL_TEXTURE_PRIORITY)
Mesa: User error: GL_INVALID_OPERATION in unsupported function called (unsupported extension or deprecated function?)
-> GL_ASSERT_NOERROR triggers
Oddly, it was not reproduced with -V gles2
, but only because the
interop code is built into the convenience libvlc_opengles.la with the
USE_OPENGL_ES2 define, which is what is currently disabling this code.