#include "../gstgleffects.h"
-#define USING_OPENGL(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL)
-#define USING_OPENGL3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL3)
-#define USING_GLES(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES)
-#define USING_GLES2(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES2)
-#define USING_GLES3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES3)
+#define USING_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
+#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
+#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
+#define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
+#define USING_GLES3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 3, 0))
static void
gst_gl_effects_identity_callback (gint width, gint height, guint texture,
#include "../gstgleffects.h"
-#define USING_OPENGL(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL)
-#define USING_OPENGL3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL3)
-#define USING_GLES(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES)
-#define USING_GLES2(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES2)
-#define USING_GLES3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES3)
+#define USING_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
+#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
+#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
+#define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
+#define USING_GLES3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 3, 0))
static void
gst_gl_effects_mirror_callback (gint width, gint height, guint texture,
#include "../gstgleffects.h"
-#define USING_OPENGL(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL)
-#define USING_OPENGL3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL3)
-#define USING_GLES(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES)
-#define USING_GLES2(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES2)
-#define USING_GLES3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES3)
+#define USING_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
+#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
+#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
+#define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
+#define USING_GLES3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 3, 0))
static void
gst_gl_effects_squeeze_callback (gint width, gint height, guint texture,
#define GST_GLIMAGE_SINK_UNLOCK(glsink) \
(g_mutex_unlock(&GST_GLIMAGE_SINK_GET_LOCK (glsink)))
-#define USING_OPENGL(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL)
-#define USING_OPENGL3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL3)
-#define USING_GLES(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES)
-#define USING_GLES2(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES2)
-#define USING_GLES3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES3)
+#define USING_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
+#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
+#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
+#define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
+#define USING_GLES3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 3, 0))
#if GST_GL_HAVE_GLES2
static void gst_glimage_sink_thread_init_redisplay (GstGLImageSink * gl_sink);
/* These are the core GL functions which we assume will always be
available */
GST_GL_EXT_BEGIN (core,
- 0, 0,
+ GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
GST_GL_API_GLES1 | GST_GL_API_GLES2,
+ 1, 0,
+ 1, 0,
"\0",
"\0")
GST_GL_EXT_FUNCTION (void, BindTexture,
GST_GL_EXT_FUNCTION (void, PolygonOffset, (GLfloat factor, GLfloat units))
GST_GL_EXT_END ()
-GST_GL_EXT_BEGIN (texture_3d, 1, 2,
- 0, /* not in either GLES */
+GST_GL_EXT_BEGIN (texture_3d,
+ GST_GL_API_OPENGL | GST_GL_API_OPENGL3,
+ 1, 2,
+ 255, 255, /* not in either GLES */
"OES\0",
"texture_3D\0")
GST_GL_EXT_FUNCTION (void, TexImage3D,
GST_GL_EXT_END ()
GST_GL_EXT_BEGIN (only_in_both_gles_and_gl_1_3,
+ GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
+ GST_GL_API_GLES1 | GST_GL_API_GLES2,
1, 3,
- GST_GL_API_GLES1 |
- GST_GL_API_GLES2,
+ 1, 0,
"\0",
"\0")
GST_GL_EXT_FUNCTION (void, CompressedTexImage2D,
GST_GL_EXT_END ()
GST_GL_EXT_BEGIN (only_in_both_gles_and_gl_1_5,
+ GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
+ GST_GL_API_GLES1 | GST_GL_API_GLES2,
1, 5,
- GST_GL_API_GLES1 |
- GST_GL_API_GLES2,
+ 1, 0,
"\0",
"\0")
GST_GL_EXT_FUNCTION (void, GetBufferParameteriv,
(GLenum target, GLenum pname, GLint* params))
GST_GL_EXT_END ()
-GST_GL_EXT_BEGIN (vbos, 1, 5,
- GST_GL_API_GLES1 |
- GST_GL_API_GLES2,
+GST_GL_EXT_BEGIN (vbos,
+ GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
+ GST_GL_API_GLES1 | GST_GL_API_GLES2,
+ 1, 5,
+ 1, 0,
"ARB\0",
"vertex_buffer_object\0")
GST_GL_EXT_FUNCTION (void, GenBuffers,
/* Available in GL 1.3, the multitexture extension or GLES. These are
required */
-GST_GL_EXT_BEGIN (multitexture_part0, 1, 3,
- GST_GL_API_GLES1 |
- GST_GL_API_GLES2,
- "ARB\0",
- "multitexture\0")
+GST_GL_EXT_BEGIN (multitexture_part0,
+ GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
+ GST_GL_API_GLES1 | GST_GL_API_GLES2,
+ 1, 3,
+ 1, 0,
+ "ARB\0",
+ "multitexture\0")
GST_GL_EXT_FUNCTION (void, ActiveTexture,
(GLenum texture))
GST_GL_EXT_END ()
/* GLES doesn't support mapping buffers in core so this has to be a
separate check */
-GST_GL_EXT_BEGIN (map_vbos, 1, 5,
- 0, /* not in GLES core */
- "ARB\0OES\0",
- "vertex_buffer_object\0mapbuffer\0")
+GST_GL_EXT_BEGIN (map_vbos,
+ GST_GL_API_OPENGL | GST_GL_API_OPENGL3,
+ 1, 5,
+ 255, 255, /* not in GLES core */
+ "ARB\0OES\0",
+ "vertex_buffer_object\0mapbuffer\0")
GST_GL_EXT_FUNCTION (void *, MapBuffer,
(GLenum target,
GLenum access))
GST_GL_EXT_END ()
GST_GL_EXT_BEGIN (gl3,
+ GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
+ GST_GL_API_GLES2,
3, 1,
- GST_GL_API_GLES3,
+ 3, 0,
"\0",
"\0")
GST_GL_EXT_FUNCTION (const GLubyte*, GetStringi,
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-GST_GL_EXT_BEGIN (blending, 1, 2,
+GST_GL_EXT_BEGIN (blending,
+ GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
GST_GL_API_GLES2,
+ 1, 2,
+ 2, 0,
"\0",
"\0")
GST_GL_EXT_FUNCTION (void, BlendEquation,
GST_GL_EXT_END ()
/* Optional, declared in 1.4 or GLES 1.2 */
-GST_GL_EXT_BEGIN (blend_func_separate, 1, 4,
+GST_GL_EXT_BEGIN (blend_func_separate,
+ GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
GST_GL_API_GLES2,
+ 1, 4,
+ 2, 0,
"EXT\0",
"blend_func_separate\0")
GST_GL_EXT_FUNCTION (void, BlendFuncSeparate,
GST_GL_EXT_END ()
/* Optional, declared in 2.0 */
-GST_GL_EXT_BEGIN (blend_equation_separate, 2, 0,
+GST_GL_EXT_BEGIN (blend_equation_separate,
+ GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
GST_GL_API_GLES2,
+ 2, 0,
+ 2, 0,
"EXT\0",
"blend_equation_separate\0")
GST_GL_EXT_FUNCTION (void, BlendEquationSeparate,
/* GL and GLES 2.0 apis */
GST_GL_EXT_BEGIN (two_point_zero_api,
- 2, 0,
+ GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
GST_GL_API_GLES2,
+ 2, 0,
+ 2, 0,
"\0",
"\0")
GST_GL_EXT_FUNCTION (void, StencilFuncSeparate,
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-GST_GL_EXT_BEGIN (EGL_image, 255, 255,
- 0, /* not in either GLES */
+GST_GL_EXT_BEGIN (EGL_image,
+ GST_GL_API_NONE,
+ 255, 255,
+ 255, 255, /* not in either GLES */
"OES\0",
"EGL_image\0")
GST_GL_EXT_FUNCTION (void, EGLImageTargetTexture2D,
*/
GST_GL_EXT_BEGIN (offscreen,
- 3, 0,
+ GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
GST_GL_API_GLES2,
+ 3, 0,
+ 2, 0,
/* for some reason the ARB version of this
extension doesn't have an ARB suffix for the
functions */
(GLuint framebuffer))
GST_GL_EXT_END ()
-GST_GL_EXT_BEGIN (offscreen_blit, 255, 255,
- 0, /* not in either GLES */
+GST_GL_EXT_BEGIN (offscreen_blit,
+ GST_GL_API_NONE,
+ 255, 255,
+ 255, 255, /* not in either GLES */
"EXT\0ANGLE\0",
"framebuffer_blit\0")
GST_GL_EXT_FUNCTION (void, BlitFramebuffer,
GLenum filter))
GST_GL_EXT_END ()
-GST_GL_EXT_BEGIN (framebuffer_discard, 255, 255,
- 0, /* not in either GLES */
+GST_GL_EXT_BEGIN (framebuffer_discard,
+ GST_GL_API_NONE,
+ 255, 255,
+ 255, 255, /* not in either GLES */
"EXT\0",
"framebuffer_discard\0")
GST_GL_EXT_FUNCTION (void, DiscardFramebuffer,
GST_GL_EXT_END ()
-GST_GL_EXT_BEGIN (read_buffer, 1, 0,
- GST_GL_API_GLES3,
+GST_GL_EXT_BEGIN (read_buffer,
+ GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
+ GST_GL_API_GLES2,
+ 1, 0,
+ 3, 0,
"NV\0",
"read_buffer\0")
GST_GL_EXT_FUNCTION (void, ReadBuffer,
(GLenum mode))
GST_GL_EXT_END ()
-GST_GL_EXT_BEGIN (draw_buffers, 2, 1,
- GST_GL_API_GLES3,
+GST_GL_EXT_BEGIN (draw_buffers,
+ GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
+ GST_GL_API_GLES2,
+ 2, 1,
+ 3, 0,
"ARB\0ATI\0NV\0",
"draw_buffers\0")
GST_GL_EXT_FUNCTION (void, DrawBuffers,
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-GST_GL_EXT_BEGIN (multitexture_part1, 1, 3,
+GST_GL_EXT_BEGIN (multitexture_part1,
+ GST_GL_API_OPENGL |
GST_GL_API_GLES1,
+ 1, 3,
+ 1, 0,
"ARB\0",
"multitexture\0")
GST_GL_EXT_FUNCTION (void, ClientActiveTexture,
/* These are the core GL functions which are available when the API
supports fixed-function (ie, GL and GLES1.1) */
GST_GL_EXT_BEGIN (fixed_function_core,
- 0, 0,
+ GST_GL_API_OPENGL |
GST_GL_API_GLES1,
+ 0, 0,
+ 1, 0,
"\0",
"\0")
GST_GL_EXT_FUNCTION (void, AlphaFunc,
/* Eventually we want to remove this category */
GST_GL_EXT_BEGIN (fixed_function_gl_only,
+ GST_GL_API_OPENGL,
+ 0, 0,
0, 0,
- 0,
"\0",
"\0")
GST_GL_EXT_FUNCTION (void, PushAttrib,
*/
GST_GL_EXT_BEGIN (only_in_both_gles,
- 255, 255,
GST_GL_API_GLES1 |
GST_GL_API_GLES2,
+ 255, 255,
+ 1, 0,
"\0",
"\0")
GST_GL_EXT_FUNCTION (void, DepthRangef,
GST_GL_EXT_END ()
GST_GL_EXT_BEGIN (only_in_gles1,
- 255, 255,
GST_GL_API_GLES1,
+ 255, 255,
+ 1, 0,
"\0",
"\0")
GST_GL_EXT_FUNCTION (void, ClipPlanef, (GLenum plane, const GLfloat *equation))
GST_GL_EXT_END ()
GST_GL_EXT_BEGIN (gles2_only_api,
- 255, 255,
GST_GL_API_GLES2,
+ 255, 255,
+ 2, 0,
"\0",
"\0")
GST_GL_EXT_FUNCTION (void, ReleaseShaderCompiler, (void))
GLsizei length))
GST_GL_EXT_END ()
-GST_GL_EXT_BEGIN (IMG_multisampled_render_to_texture, 255, 255,
- 0, /* not in either GLES */
+GST_GL_EXT_BEGIN (IMG_multisampled_render_to_texture,
+ GST_GL_API_NONE,
+ 255, 255,
+ 255, 255, /* not in either GLES */
"\0",
"IMG_multisampled_render_to_texture\0")
GST_GL_EXT_FUNCTION (void, RenderbufferStorageMultisampleIMG,
/* These are the core GL functions which are only available in big
GL */
GST_GL_EXT_BEGIN (only_in_big_gl,
- 0, 0,
- 0, /* not in GLES */
+ GST_GL_API_OPENGL | GST_GL_API_OPENGL3,
+ 1, 0,
+ 255, 255, /* not in GLES */
"\0",
"\0")
GST_GL_EXT_FUNCTION (void, GetTexLevelParameteriv,
(GLenum target, GLint level,
GLenum format, GLenum type,
GLvoid *pixels))
-GST_GL_EXT_FUNCTION (void, ClipPlane,
- (GLenum plane, const double *equation))
GST_GL_EXT_FUNCTION (void, DepthRange,
(double near_val, double far_val))
GST_GL_EXT_FUNCTION (void, DrawBuffer,
(GLenum mode))
GST_GL_EXT_END ()
+
+GST_GL_EXT_BEGIN (only_in_big_gl_compat,
+ GST_GL_API_OPENGL,
+ 1, 0,
+ 255, 255, /* not in GLES */
+ "\0",
+ "\0")
+GST_GL_EXT_FUNCTION (void, ClipPlane,
+ (GLenum plane, const double *equation))
+GST_GL_EXT_END ()
/* This lists functions that are unique to GL 2.0 or GLES 2.0 and are
* not in the old GLSL extensions */
-GST_GL_EXT_BEGIN (shaders_glsl_2_only, 2, 0,
+GST_GL_EXT_BEGIN (shaders_glsl_2_only,
+ GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
GST_GL_API_GLES2,
+ 2, 0,
+ 2, 0,
"\0",
"\0")
GST_GL_EXT_FUNCTION (GLuint, CreateProgram,
/* These functions are provided by GL_ARB_shader_objects or are in GL
* 2.0 core */
-GST_GL_EXT_BEGIN (shader_objects_or_gl2, 2, 0,
+GST_GL_EXT_BEGIN (shader_objects_or_gl2,
+ GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
GST_GL_API_GLES2,
+ 2, 0,
+ 2, 0,
"ARB\0",
"shader_objects\0")
GST_GL_EXT_FUNCTION (void, ShaderSource,
/* These functions are provided by GL_ARB_vertex_shader or are in GL
* 2.0 core */
-GST_GL_EXT_BEGIN (vertex_shaders, 2, 0,
+GST_GL_EXT_BEGIN (vertex_shaders,
+ GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
GST_GL_API_GLES2,
+ 2, 0,
+ 2, 0,
"ARB\0",
"vertex_shader\0")
GST_GL_EXT_FUNCTION (void, VertexAttribPointer,
/* These only list functions that come from the old GLSL extensions.
* Functions that are common to the extensions and GLSL 2.0 should
* instead be listed in cogl-glsl-functions.h */
-GST_GL_EXT_BEGIN (shader_objects, 255, 255,
- 0, /* not in either GLES */
+GST_GL_EXT_BEGIN (shader_objects,
+ GST_GL_API_NONE,
+ 255, 255,
+ 255, 255, /* not in either GLES */
"ARB\0",
"shader_objects\0")
GST_GL_EXT_FUNCTION (GLuint, CreateProgramObject,
GST_GL_EXT_END ()
/* ARB_fragment_program */
-GST_GL_EXT_BEGIN (arbfp, 255, 255,
- 0, /* not in either GLES */
+GST_GL_EXT_BEGIN (arbfp,
+ GST_GL_API_NONE,
+ 255, 255,
+ 255, 255, /* not in either GLES */
"ARB\0",
"fragment_program\0")
GST_GL_EXT_FUNCTION (void, GenPrograms,
/* This lists functions that are unique to GL 2.1 or GLES 3.0 and are
* not in the old GLSL extensions */
-GST_GL_EXT_BEGIN (shaders_2_1, 2, 1,
- GST_GL_API_GLES3,
+GST_GL_EXT_BEGIN (shaders_2_1,
+ GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
+ GST_GL_API_GLES2,
+ 2, 1,
+ 3, 0,
"\0",
"\0")
GST_GL_EXT_FUNCTION (void, UniformMatrix2x3fv,
str = g_string_new (GST_GL_API_GLES2_NAME);
}
}
- if (api & GST_GL_API_GLES3) {
- if (str) {
- g_string_append (str, " " GST_GL_API_GLES3_NAME);
- } else {
- str = g_string_new (GST_GL_API_GLES3_NAME);
- }
- }
out:
if (!str)
} else if (g_strstr_len (apis, 5, GST_GL_API_GLES2_NAME)) {
ret |= GST_GL_API_GLES2;
apis = &apis[5];
- } else if (g_strstr_len (apis, 5, GST_GL_API_GLES3_NAME)) {
- ret |= GST_GL_API_GLES3;
- apis = &apis[5];
} else {
GST_ERROR ("Error parsing \'%s\'", apis);
break;
GST_GL_API_OPENGL3 = (1 << 1),
GST_GL_API_GLES1 = (1 << 15),
GST_GL_API_GLES2 = (1 << 16),
- GST_GL_API_GLES3 = (1 << 17),
GST_GL_API_ANY = G_MAXUINT32
} GstGLAPI;
#define GST_GL_API_OPENGL3_NAME "opengl3"
#define GST_GL_API_GLES1_NAME "gles1"
#define GST_GL_API_GLES2_NAME "gles2"
-#define GST_GL_API_GLES3_NAME "gles3"
typedef enum
{
GST_GL_PLATFORM_ANY = G_MAXUINT32
} GstGLPlatform;
-#define GST_GL_EXT_BEGIN(name, min_gl, maj_gl, in_gles, ext_suf, ext_name)
+#define GST_GL_EXT_BEGIN(name, gl_availability, min_gl, maj_gl, gles_maj, \
+ gles_min, ext_suf, ext_name)
#define GST_GL_EXT_FUNCTION(ret, name, args) \
ret GSTGLAPI (*name) args;
#define GST_GL_EXT_END()
* gst_gl_color_convert_set_texture_scaling().
*/
-#define USING_OPENGL(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL)
-#define USING_OPENGL3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL3)
-#define USING_GLES(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES)
-#define USING_GLES2(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES2)
-#define USING_GLES3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES3)
+#define USING_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
+#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
+#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
+#define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
+#define USING_GLES3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 3, 0))
static void _do_convert (GstGLContext * context, GstGLColorConvert * convert);
static gboolean _init_convert (GstGLColorConvert * convert);
* A #GstGLDownload can be created with gst_gl_download_new()
*/
-#define USING_OPENGL(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL)
-#define USING_OPENGL3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL3)
-#define USING_GLES(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES)
-#define USING_GLES2(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES2)
-#define USING_GLES3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES3)
+#define USING_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
+#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
+#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
+#define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
+#define USING_GLES3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 3, 0))
static gboolean _do_download (GstGLDownload * download, guint texture_id,
gpointer data[GST_VIDEO_MAX_PLANES]);
/* Define a set of arrays containing the functions required from GL
for each feature */
#define GST_GL_EXT_BEGIN(name, \
+ gl_availability, \
min_gl_major, min_gl_minor, \
- gles_availability, \
+ min_gles_major, min_gles_minor, \
namespaces, extension_names) \
static const GstGLFeatureFunction gst_gl_ext_ ## name ## _funcs[] = {
#define GST_GL_EXT_FUNCTION(ret, name, args) \
#include "glprototypes/all_functions.h"
#undef GST_GL_EXT_BEGIN
+#undef GST_GL_EXT_FUNCTION
+#undef GST_GL_EXT_END
+
#define GST_GL_EXT_BEGIN(name, \
+ gl_availability, \
min_gl_major, min_gl_minor, \
- gles_availability, \
+ min_gles_major, min_gles_minor, \
namespaces, extension_names) \
- { min_gl_major, min_gl_minor, gles_availability, namespaces, \
- extension_names, \
+ { G_STRINGIFY (name), gl_availability, min_gl_major, min_gl_minor, min_gles_major, \
+ min_gles_minor, namespaces, extension_names, \
gst_gl_ext_ ## name ## _funcs },
-#undef GST_GL_EXT_FUNCTION
#define GST_GL_EXT_FUNCTION(ret, name, args)
-#undef GST_GL_EXT_END
#define GST_GL_EXT_END()
static const GstGLFeatureData gst_gl_feature_ext_functions_data[] = {
const char *suffix = NULL;
int func_num;
GstGLFuncs *gst_gl = context->gl_vtable;
+ guint gl_min = 0, gl_maj = 0;
GstGLAPI gl_api = gst_gl_context_get_gl_api (context);
+ if (gl_api & (GST_GL_API_OPENGL | GST_GL_API_OPENGL3)) {
+ gl_maj = data->min_gl_major;
+ gl_min = data->min_gl_minor;
+ } else if (gl_api & (GST_GL_API_GLES1 | GST_GL_API_GLES2)) {
+ gl_maj = data->min_gles_major;
+ gl_min = data->min_gles_minor;
+ }
+
+ GST_DEBUG ("%s, 0x%x, %d.%d vs 0x%x, %d.%d", data->feature_name,
+ data->gl_availability, gl_maj, gl_min,
+ gst_gl_context_get_gl_api (context), gl_major, gl_minor);
+
/* First check whether the functions should be directly provided by
GL */
- if (((gl_api & GST_GL_API_OPENGL) &&
- GST_GL_CHECK_GL_VERSION (gl_major, gl_minor,
- data->min_gl_major, data->min_gl_minor)) ||
- ((gl_api & GST_GL_API_GLES2) &&
- (data->gl_availability & GST_GL_API_GLES2))) {
+ if (gst_gl_context_check_gl_version (context, data->gl_availability, gl_maj,
+ gl_min)) {
in_core = TRUE;
suffix = "";
} else {
* then set all of the functions pointers to NULL so we can safely
* do feature testing by just looking at the function pointers */
error:
+ GST_DEBUG ("failed to find feature %s", data->feature_name);
for (func_num = 0; data->functions[func_num].name; func_num++) {
*(void **) ((guint8 *) gst_gl +
}
if (full_function_name) {
- GST_TRACE ("failed to find function %s", full_function_name);
+ GST_DEBUG ("failed to find function %s", full_function_name);
g_free (full_function_name);
}
struct _GstGLFeatureData
{
- /* A minimum GL version which the functions should be defined in
- without needing an extension. Set to 255,255 if it's only
- provided in an extension */
- int min_gl_major, min_gl_minor;
+ /* name of the feature */
+ const char *feature_name;
/* Flags specifying which versions of GL the feature is available
in core in */
GstGLAPI gl_availability;
+ /* A minimum GL version which the functions should be defined in
+ without needing an extension. Set to 255, 255 if it's only
+ provided in an extension */
+ int min_gl_major, min_gl_minor;
+ /* A minimum GLES version which the functions should be defined in
+ without needing an extension. Set to 255, 255 if it's only
+ provided in an extension */
+ int min_gles_major, min_gles_minor;
/* \0 separated list of namespaces to try. Eg "EXT\0ARB\0" */
const char *namespaces;
/* \0 separated list of required extension names without the GL_EXT
* Data is uploaded or downloaded from the GPU as is necessary.
*/
-#define USING_OPENGL(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL)
-#define USING_OPENGL3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL3)
-#define USING_GLES(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES)
-#define USING_GLES2(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES2)
-#define USING_GLES3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES3)
+#define USING_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
+#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
+#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
+#define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
+#define USING_GLES3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 3, 0))
GST_DEBUG_CATEGORY_STATIC (GST_CAT_GL_MEMORY);
#define GST_CAT_DEFUALT GST_CAT_GL_MEMORY
#if GST_GL_HAVE_OPENGL || GST_GL_HAVE_GLES3
if (USING_OPENGL (gl_mem->context) || USING_GLES3 (gl_mem->context)) {
gl_mem->unpack_length = gl_mem->stride / n_gl_bytes;
- }
+ } else
#endif
#if GST_GL_HAVE_GLES2
if (USING_GLES2 (gl_mem->context)) {
#define GST_GL_SHADER_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), GST_GL_TYPE_SHADER, GstGLShaderPrivate))
-#define USING_OPENGL(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL)
-#define USING_OPENGL3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL3)
-#define USING_GLES(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES)
-#define USING_GLES2(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES2)
-#define USING_GLES3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES3)
+#define USING_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
+#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
+#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
+#define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
+#define USING_GLES3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 3, 0))
typedef struct _GstGLShaderVTable
{
* A #GstGLUpload can be created with gst_gl_upload_new()
*/
-#define USING_OPENGL(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL)
-#define USING_OPENGL3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL3)
-#define USING_GLES(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES)
-#define USING_GLES2(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES2)
-#define USING_GLES3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES3)
+#define USING_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
+#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
+#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
+#define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
+#define USING_GLES3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 3, 0))
static gboolean _upload_memory (GstGLUpload * upload);
static gboolean _init_upload (GstGLUpload * upload);
* A #GstGLUpload can be created with gst_gl_upload_new()
*/
-#define USING_OPENGL(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL)
-#define USING_OPENGL3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL3)
-#define USING_GLES(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES)
-#define USING_GLES2(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES2)
-#define USING_GLES3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES3)
+#define USING_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
+#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
+#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
+#define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
+#define USING_GLES3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 3, 0))
/* *INDENT-OFF* */
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
#endif
-#define USING_OPENGL(context) (gst_gl_context_get_gl_apie (context) & GST_GL_API_OPENGL)
-#define USING_OPENGL3(context) (gst_gl_context_get_gl_apie (context) & GST_GL_API_OPENGL3)
-#define USING_GLES(context) (gst_gl_context_get_gl_apie (context) & GST_GL_API_GLES)
-#define USING_GLES2(context) (gst_gl_context_get_gl_apie (context)->gl_api & GST_GL_API_GLES2)
-#define USING_GLES3(context) (gst_gl_context_get_gl_apie (context) & GST_GL_API_GLES3)
+#define USING_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
+#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
+#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
+#define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
+#define USING_GLES3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 3, 0))
static gchar *error_message;
#include "dispmanx/gstglwindow_dispmanx_egl.h"
#endif
-#define USING_OPENGL(display) (display->gl_api & GST_GL_API_OPENGL)
-#define USING_OPENGL3(display) (display->gl_api & GST_GL_API_OPENGL3)
-#define USING_GLES(display) (display->gl_api & GST_GL_API_GLES)
-#define USING_GLES2(display) (display->gl_api & GST_GL_API_GLES2)
-#define USING_GLES3(display) (display->gl_api & GST_GL_API_GLES3)
+#define USING_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
+#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
+#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
+#define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
+#define USING_GLES3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 3, 0))
#define GST_CAT_DEFAULT gst_gl_window_debug
GST_DEBUG_CATEGORY (GST_CAT_DEFAULT);