mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 15:08:53 +00:00
glfeature: remove GST_GL_API_GLES3
instead check the gl version using gst_gl_context_check_gl_version()
This commit is contained in:
parent
1334884a61
commit
da35876537
24 changed files with 233 additions and 149 deletions
|
@ -23,11 +23,11 @@
|
||||||
|
|
||||||
#include "../gstgleffects.h"
|
#include "../gstgleffects.h"
|
||||||
|
|
||||||
#define USING_OPENGL(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL)
|
#define USING_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
|
||||||
#define USING_OPENGL3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL3)
|
#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
|
||||||
#define USING_GLES(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES)
|
#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
|
||||||
#define USING_GLES2(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES2)
|
#define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
|
||||||
#define USING_GLES3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES3)
|
#define USING_GLES3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 3, 0))
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_gl_effects_identity_callback (gint width, gint height, guint texture,
|
gst_gl_effects_identity_callback (gint width, gint height, guint texture,
|
||||||
|
|
|
@ -23,11 +23,11 @@
|
||||||
|
|
||||||
#include "../gstgleffects.h"
|
#include "../gstgleffects.h"
|
||||||
|
|
||||||
#define USING_OPENGL(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL)
|
#define USING_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
|
||||||
#define USING_OPENGL3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL3)
|
#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
|
||||||
#define USING_GLES(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES)
|
#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
|
||||||
#define USING_GLES2(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES2)
|
#define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
|
||||||
#define USING_GLES3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES3)
|
#define USING_GLES3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 3, 0))
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_gl_effects_mirror_callback (gint width, gint height, guint texture,
|
gst_gl_effects_mirror_callback (gint width, gint height, guint texture,
|
||||||
|
|
|
@ -23,11 +23,11 @@
|
||||||
|
|
||||||
#include "../gstgleffects.h"
|
#include "../gstgleffects.h"
|
||||||
|
|
||||||
#define USING_OPENGL(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL)
|
#define USING_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
|
||||||
#define USING_OPENGL3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL3)
|
#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
|
||||||
#define USING_GLES(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES)
|
#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
|
||||||
#define USING_GLES2(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES2)
|
#define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
|
||||||
#define USING_GLES3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES3)
|
#define USING_GLES3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 3, 0))
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_gl_effects_squeeze_callback (gint width, gint height, guint texture,
|
gst_gl_effects_squeeze_callback (gint width, gint height, guint texture,
|
||||||
|
|
|
@ -101,11 +101,11 @@ GST_DEBUG_CATEGORY (gst_debug_glimage_sink);
|
||||||
#define GST_GLIMAGE_SINK_UNLOCK(glsink) \
|
#define GST_GLIMAGE_SINK_UNLOCK(glsink) \
|
||||||
(g_mutex_unlock(&GST_GLIMAGE_SINK_GET_LOCK (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_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
|
||||||
#define USING_OPENGL3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL3)
|
#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
|
||||||
#define USING_GLES(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES)
|
#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
|
||||||
#define USING_GLES2(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES2)
|
#define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
|
||||||
#define USING_GLES3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES3)
|
#define USING_GLES3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 3, 0))
|
||||||
|
|
||||||
#if GST_GL_HAVE_GLES2
|
#if GST_GL_HAVE_GLES2
|
||||||
static void gst_glimage_sink_thread_init_redisplay (GstGLImageSink * gl_sink);
|
static void gst_glimage_sink_thread_init_redisplay (GstGLImageSink * gl_sink);
|
||||||
|
|
|
@ -42,8 +42,10 @@
|
||||||
/* These are the core GL functions which we assume will always be
|
/* These are the core GL functions which we assume will always be
|
||||||
available */
|
available */
|
||||||
GST_GL_EXT_BEGIN (core,
|
GST_GL_EXT_BEGIN (core,
|
||||||
0, 0,
|
GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
|
||||||
GST_GL_API_GLES1 | GST_GL_API_GLES2,
|
GST_GL_API_GLES1 | GST_GL_API_GLES2,
|
||||||
|
1, 0,
|
||||||
|
1, 0,
|
||||||
"\0",
|
"\0",
|
||||||
"\0")
|
"\0")
|
||||||
GST_GL_EXT_FUNCTION (void, BindTexture,
|
GST_GL_EXT_FUNCTION (void, BindTexture,
|
||||||
|
@ -178,8 +180,10 @@ GST_GL_EXT_FUNCTION (void, LineWidth, (GLfloat width))
|
||||||
GST_GL_EXT_FUNCTION (void, PolygonOffset, (GLfloat factor, GLfloat units))
|
GST_GL_EXT_FUNCTION (void, PolygonOffset, (GLfloat factor, GLfloat units))
|
||||||
GST_GL_EXT_END ()
|
GST_GL_EXT_END ()
|
||||||
|
|
||||||
GST_GL_EXT_BEGIN (texture_3d, 1, 2,
|
GST_GL_EXT_BEGIN (texture_3d,
|
||||||
0, /* not in either GLES */
|
GST_GL_API_OPENGL | GST_GL_API_OPENGL3,
|
||||||
|
1, 2,
|
||||||
|
255, 255, /* not in either GLES */
|
||||||
"OES\0",
|
"OES\0",
|
||||||
"texture_3D\0")
|
"texture_3D\0")
|
||||||
GST_GL_EXT_FUNCTION (void, TexImage3D,
|
GST_GL_EXT_FUNCTION (void, TexImage3D,
|
||||||
|
@ -199,9 +203,10 @@ GST_GL_EXT_FUNCTION (void, TexSubImage3D,
|
||||||
GST_GL_EXT_END ()
|
GST_GL_EXT_END ()
|
||||||
|
|
||||||
GST_GL_EXT_BEGIN (only_in_both_gles_and_gl_1_3,
|
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,
|
1, 3,
|
||||||
GST_GL_API_GLES1 |
|
1, 0,
|
||||||
GST_GL_API_GLES2,
|
|
||||||
"\0",
|
"\0",
|
||||||
"\0")
|
"\0")
|
||||||
GST_GL_EXT_FUNCTION (void, CompressedTexImage2D,
|
GST_GL_EXT_FUNCTION (void, CompressedTexImage2D,
|
||||||
|
@ -228,18 +233,21 @@ GST_GL_EXT_FUNCTION (void, SampleCoverage,
|
||||||
GST_GL_EXT_END ()
|
GST_GL_EXT_END ()
|
||||||
|
|
||||||
GST_GL_EXT_BEGIN (only_in_both_gles_and_gl_1_5,
|
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,
|
1, 5,
|
||||||
GST_GL_API_GLES1 |
|
1, 0,
|
||||||
GST_GL_API_GLES2,
|
|
||||||
"\0",
|
"\0",
|
||||||
"\0")
|
"\0")
|
||||||
GST_GL_EXT_FUNCTION (void, GetBufferParameteriv,
|
GST_GL_EXT_FUNCTION (void, GetBufferParameteriv,
|
||||||
(GLenum target, GLenum pname, GLint* params))
|
(GLenum target, GLenum pname, GLint* params))
|
||||||
GST_GL_EXT_END ()
|
GST_GL_EXT_END ()
|
||||||
|
|
||||||
GST_GL_EXT_BEGIN (vbos, 1, 5,
|
GST_GL_EXT_BEGIN (vbos,
|
||||||
GST_GL_API_GLES1 |
|
GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
|
||||||
GST_GL_API_GLES2,
|
GST_GL_API_GLES1 | GST_GL_API_GLES2,
|
||||||
|
1, 5,
|
||||||
|
1, 0,
|
||||||
"ARB\0",
|
"ARB\0",
|
||||||
"vertex_buffer_object\0")
|
"vertex_buffer_object\0")
|
||||||
GST_GL_EXT_FUNCTION (void, GenBuffers,
|
GST_GL_EXT_FUNCTION (void, GenBuffers,
|
||||||
|
@ -267,11 +275,13 @@ GST_GL_EXT_END ()
|
||||||
|
|
||||||
/* Available in GL 1.3, the multitexture extension or GLES. These are
|
/* Available in GL 1.3, the multitexture extension or GLES. These are
|
||||||
required */
|
required */
|
||||||
GST_GL_EXT_BEGIN (multitexture_part0, 1, 3,
|
GST_GL_EXT_BEGIN (multitexture_part0,
|
||||||
GST_GL_API_GLES1 |
|
GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
|
||||||
GST_GL_API_GLES2,
|
GST_GL_API_GLES1 | GST_GL_API_GLES2,
|
||||||
"ARB\0",
|
1, 3,
|
||||||
"multitexture\0")
|
1, 0,
|
||||||
|
"ARB\0",
|
||||||
|
"multitexture\0")
|
||||||
GST_GL_EXT_FUNCTION (void, ActiveTexture,
|
GST_GL_EXT_FUNCTION (void, ActiveTexture,
|
||||||
(GLenum texture))
|
(GLenum texture))
|
||||||
GST_GL_EXT_END ()
|
GST_GL_EXT_END ()
|
||||||
|
@ -279,10 +289,12 @@ GST_GL_EXT_END ()
|
||||||
|
|
||||||
/* GLES doesn't support mapping buffers in core so this has to be a
|
/* GLES doesn't support mapping buffers in core so this has to be a
|
||||||
separate check */
|
separate check */
|
||||||
GST_GL_EXT_BEGIN (map_vbos, 1, 5,
|
GST_GL_EXT_BEGIN (map_vbos,
|
||||||
0, /* not in GLES core */
|
GST_GL_API_OPENGL | GST_GL_API_OPENGL3,
|
||||||
"ARB\0OES\0",
|
1, 5,
|
||||||
"vertex_buffer_object\0mapbuffer\0")
|
255, 255, /* not in GLES core */
|
||||||
|
"ARB\0OES\0",
|
||||||
|
"vertex_buffer_object\0mapbuffer\0")
|
||||||
GST_GL_EXT_FUNCTION (void *, MapBuffer,
|
GST_GL_EXT_FUNCTION (void *, MapBuffer,
|
||||||
(GLenum target,
|
(GLenum target,
|
||||||
GLenum access))
|
GLenum access))
|
||||||
|
@ -291,8 +303,10 @@ GST_GL_EXT_FUNCTION (GLboolean, UnmapBuffer,
|
||||||
GST_GL_EXT_END ()
|
GST_GL_EXT_END ()
|
||||||
|
|
||||||
GST_GL_EXT_BEGIN (gl3,
|
GST_GL_EXT_BEGIN (gl3,
|
||||||
|
GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
|
||||||
|
GST_GL_API_GLES2,
|
||||||
3, 1,
|
3, 1,
|
||||||
GST_GL_API_GLES3,
|
3, 0,
|
||||||
"\0",
|
"\0",
|
||||||
"\0")
|
"\0")
|
||||||
GST_GL_EXT_FUNCTION (const GLubyte*, GetStringi,
|
GST_GL_EXT_FUNCTION (const GLubyte*, GetStringi,
|
||||||
|
|
|
@ -38,8 +38,11 @@
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
* 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,
|
GST_GL_API_GLES2,
|
||||||
|
1, 2,
|
||||||
|
2, 0,
|
||||||
"\0",
|
"\0",
|
||||||
"\0")
|
"\0")
|
||||||
GST_GL_EXT_FUNCTION (void, BlendEquation,
|
GST_GL_EXT_FUNCTION (void, BlendEquation,
|
||||||
|
@ -52,8 +55,11 @@ GST_GL_EXT_FUNCTION (void, BlendColor,
|
||||||
GST_GL_EXT_END ()
|
GST_GL_EXT_END ()
|
||||||
|
|
||||||
/* Optional, declared in 1.4 or GLES 1.2 */
|
/* 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,
|
GST_GL_API_GLES2,
|
||||||
|
1, 4,
|
||||||
|
2, 0,
|
||||||
"EXT\0",
|
"EXT\0",
|
||||||
"blend_func_separate\0")
|
"blend_func_separate\0")
|
||||||
GST_GL_EXT_FUNCTION (void, BlendFuncSeparate,
|
GST_GL_EXT_FUNCTION (void, BlendFuncSeparate,
|
||||||
|
@ -64,8 +70,11 @@ GST_GL_EXT_FUNCTION (void, BlendFuncSeparate,
|
||||||
GST_GL_EXT_END ()
|
GST_GL_EXT_END ()
|
||||||
|
|
||||||
/* Optional, declared in 2.0 */
|
/* 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,
|
GST_GL_API_GLES2,
|
||||||
|
2, 0,
|
||||||
|
2, 0,
|
||||||
"EXT\0",
|
"EXT\0",
|
||||||
"blend_equation_separate\0")
|
"blend_equation_separate\0")
|
||||||
GST_GL_EXT_FUNCTION (void, BlendEquationSeparate,
|
GST_GL_EXT_FUNCTION (void, BlendEquationSeparate,
|
||||||
|
@ -75,8 +84,10 @@ GST_GL_EXT_END ()
|
||||||
|
|
||||||
/* GL and GLES 2.0 apis */
|
/* GL and GLES 2.0 apis */
|
||||||
GST_GL_EXT_BEGIN (two_point_zero_api,
|
GST_GL_EXT_BEGIN (two_point_zero_api,
|
||||||
2, 0,
|
GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
|
||||||
GST_GL_API_GLES2,
|
GST_GL_API_GLES2,
|
||||||
|
2, 0,
|
||||||
|
2, 0,
|
||||||
"\0",
|
"\0",
|
||||||
"\0")
|
"\0")
|
||||||
GST_GL_EXT_FUNCTION (void, StencilFuncSeparate,
|
GST_GL_EXT_FUNCTION (void, StencilFuncSeparate,
|
||||||
|
|
|
@ -38,8 +38,10 @@
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
GST_GL_EXT_BEGIN (EGL_image, 255, 255,
|
GST_GL_EXT_BEGIN (EGL_image,
|
||||||
0, /* not in either GLES */
|
GST_GL_API_NONE,
|
||||||
|
255, 255,
|
||||||
|
255, 255, /* not in either GLES */
|
||||||
"OES\0",
|
"OES\0",
|
||||||
"EGL_image\0")
|
"EGL_image\0")
|
||||||
GST_GL_EXT_FUNCTION (void, EGLImageTargetTexture2D,
|
GST_GL_EXT_FUNCTION (void, EGLImageTargetTexture2D,
|
||||||
|
|
|
@ -39,8 +39,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
GST_GL_EXT_BEGIN (offscreen,
|
GST_GL_EXT_BEGIN (offscreen,
|
||||||
3, 0,
|
GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
|
||||||
GST_GL_API_GLES2,
|
GST_GL_API_GLES2,
|
||||||
|
3, 0,
|
||||||
|
2, 0,
|
||||||
/* for some reason the ARB version of this
|
/* for some reason the ARB version of this
|
||||||
extension doesn't have an ARB suffix for the
|
extension doesn't have an ARB suffix for the
|
||||||
functions */
|
functions */
|
||||||
|
@ -99,8 +101,10 @@ GST_GL_EXT_FUNCTION (GLboolean, IsFramebuffer,
|
||||||
(GLuint framebuffer))
|
(GLuint framebuffer))
|
||||||
GST_GL_EXT_END ()
|
GST_GL_EXT_END ()
|
||||||
|
|
||||||
GST_GL_EXT_BEGIN (offscreen_blit, 255, 255,
|
GST_GL_EXT_BEGIN (offscreen_blit,
|
||||||
0, /* not in either GLES */
|
GST_GL_API_NONE,
|
||||||
|
255, 255,
|
||||||
|
255, 255, /* not in either GLES */
|
||||||
"EXT\0ANGLE\0",
|
"EXT\0ANGLE\0",
|
||||||
"framebuffer_blit\0")
|
"framebuffer_blit\0")
|
||||||
GST_GL_EXT_FUNCTION (void, BlitFramebuffer,
|
GST_GL_EXT_FUNCTION (void, BlitFramebuffer,
|
||||||
|
@ -116,8 +120,10 @@ GST_GL_EXT_FUNCTION (void, BlitFramebuffer,
|
||||||
GLenum filter))
|
GLenum filter))
|
||||||
GST_GL_EXT_END ()
|
GST_GL_EXT_END ()
|
||||||
|
|
||||||
GST_GL_EXT_BEGIN (framebuffer_discard, 255, 255,
|
GST_GL_EXT_BEGIN (framebuffer_discard,
|
||||||
0, /* not in either GLES */
|
GST_GL_API_NONE,
|
||||||
|
255, 255,
|
||||||
|
255, 255, /* not in either GLES */
|
||||||
"EXT\0",
|
"EXT\0",
|
||||||
"framebuffer_discard\0")
|
"framebuffer_discard\0")
|
||||||
GST_GL_EXT_FUNCTION (void, DiscardFramebuffer,
|
GST_GL_EXT_FUNCTION (void, DiscardFramebuffer,
|
||||||
|
@ -127,16 +133,22 @@ GST_GL_EXT_FUNCTION (void, DiscardFramebuffer,
|
||||||
GST_GL_EXT_END ()
|
GST_GL_EXT_END ()
|
||||||
|
|
||||||
|
|
||||||
GST_GL_EXT_BEGIN (read_buffer, 1, 0,
|
GST_GL_EXT_BEGIN (read_buffer,
|
||||||
GST_GL_API_GLES3,
|
GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
|
||||||
|
GST_GL_API_GLES2,
|
||||||
|
1, 0,
|
||||||
|
3, 0,
|
||||||
"NV\0",
|
"NV\0",
|
||||||
"read_buffer\0")
|
"read_buffer\0")
|
||||||
GST_GL_EXT_FUNCTION (void, ReadBuffer,
|
GST_GL_EXT_FUNCTION (void, ReadBuffer,
|
||||||
(GLenum mode))
|
(GLenum mode))
|
||||||
GST_GL_EXT_END ()
|
GST_GL_EXT_END ()
|
||||||
|
|
||||||
GST_GL_EXT_BEGIN (draw_buffers, 2, 1,
|
GST_GL_EXT_BEGIN (draw_buffers,
|
||||||
GST_GL_API_GLES3,
|
GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
|
||||||
|
GST_GL_API_GLES2,
|
||||||
|
2, 1,
|
||||||
|
3, 0,
|
||||||
"ARB\0ATI\0NV\0",
|
"ARB\0ATI\0NV\0",
|
||||||
"draw_buffers\0")
|
"draw_buffers\0")
|
||||||
GST_GL_EXT_FUNCTION (void, DrawBuffers,
|
GST_GL_EXT_FUNCTION (void, DrawBuffers,
|
||||||
|
|
|
@ -38,8 +38,11 @@
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
* 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,
|
GST_GL_API_GLES1,
|
||||||
|
1, 3,
|
||||||
|
1, 0,
|
||||||
"ARB\0",
|
"ARB\0",
|
||||||
"multitexture\0")
|
"multitexture\0")
|
||||||
GST_GL_EXT_FUNCTION (void, ClientActiveTexture,
|
GST_GL_EXT_FUNCTION (void, ClientActiveTexture,
|
||||||
|
@ -49,8 +52,10 @@ GST_GL_EXT_END ()
|
||||||
/* These are the core GL functions which are available when the API
|
/* These are the core GL functions which are available when the API
|
||||||
supports fixed-function (ie, GL and GLES1.1) */
|
supports fixed-function (ie, GL and GLES1.1) */
|
||||||
GST_GL_EXT_BEGIN (fixed_function_core,
|
GST_GL_EXT_BEGIN (fixed_function_core,
|
||||||
0, 0,
|
GST_GL_API_OPENGL |
|
||||||
GST_GL_API_GLES1,
|
GST_GL_API_GLES1,
|
||||||
|
0, 0,
|
||||||
|
1, 0,
|
||||||
"\0",
|
"\0",
|
||||||
"\0")
|
"\0")
|
||||||
GST_GL_EXT_FUNCTION (void, AlphaFunc,
|
GST_GL_EXT_FUNCTION (void, AlphaFunc,
|
||||||
|
@ -106,8 +111,9 @@ GST_GL_EXT_END ()
|
||||||
|
|
||||||
/* Eventually we want to remove this category */
|
/* Eventually we want to remove this category */
|
||||||
GST_GL_EXT_BEGIN (fixed_function_gl_only,
|
GST_GL_EXT_BEGIN (fixed_function_gl_only,
|
||||||
|
GST_GL_API_OPENGL,
|
||||||
|
0, 0,
|
||||||
0, 0,
|
0, 0,
|
||||||
0,
|
|
||||||
"\0",
|
"\0",
|
||||||
"\0")
|
"\0")
|
||||||
GST_GL_EXT_FUNCTION (void, PushAttrib,
|
GST_GL_EXT_FUNCTION (void, PushAttrib,
|
||||||
|
|
|
@ -39,9 +39,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
GST_GL_EXT_BEGIN (only_in_both_gles,
|
GST_GL_EXT_BEGIN (only_in_both_gles,
|
||||||
255, 255,
|
|
||||||
GST_GL_API_GLES1 |
|
GST_GL_API_GLES1 |
|
||||||
GST_GL_API_GLES2,
|
GST_GL_API_GLES2,
|
||||||
|
255, 255,
|
||||||
|
1, 0,
|
||||||
"\0",
|
"\0",
|
||||||
"\0")
|
"\0")
|
||||||
GST_GL_EXT_FUNCTION (void, DepthRangef,
|
GST_GL_EXT_FUNCTION (void, DepthRangef,
|
||||||
|
@ -51,16 +52,18 @@ GST_GL_EXT_FUNCTION (void, ClearDepthf,
|
||||||
GST_GL_EXT_END ()
|
GST_GL_EXT_END ()
|
||||||
|
|
||||||
GST_GL_EXT_BEGIN (only_in_gles1,
|
GST_GL_EXT_BEGIN (only_in_gles1,
|
||||||
255, 255,
|
|
||||||
GST_GL_API_GLES1,
|
GST_GL_API_GLES1,
|
||||||
|
255, 255,
|
||||||
|
1, 0,
|
||||||
"\0",
|
"\0",
|
||||||
"\0")
|
"\0")
|
||||||
GST_GL_EXT_FUNCTION (void, ClipPlanef, (GLenum plane, const GLfloat *equation))
|
GST_GL_EXT_FUNCTION (void, ClipPlanef, (GLenum plane, const GLfloat *equation))
|
||||||
GST_GL_EXT_END ()
|
GST_GL_EXT_END ()
|
||||||
|
|
||||||
GST_GL_EXT_BEGIN (gles2_only_api,
|
GST_GL_EXT_BEGIN (gles2_only_api,
|
||||||
255, 255,
|
|
||||||
GST_GL_API_GLES2,
|
GST_GL_API_GLES2,
|
||||||
|
255, 255,
|
||||||
|
2, 0,
|
||||||
"\0",
|
"\0",
|
||||||
"\0")
|
"\0")
|
||||||
GST_GL_EXT_FUNCTION (void, ReleaseShaderCompiler, (void))
|
GST_GL_EXT_FUNCTION (void, ReleaseShaderCompiler, (void))
|
||||||
|
@ -77,8 +80,10 @@ GST_GL_EXT_FUNCTION (void, ShaderBinary,
|
||||||
GLsizei length))
|
GLsizei length))
|
||||||
GST_GL_EXT_END ()
|
GST_GL_EXT_END ()
|
||||||
|
|
||||||
GST_GL_EXT_BEGIN (IMG_multisampled_render_to_texture, 255, 255,
|
GST_GL_EXT_BEGIN (IMG_multisampled_render_to_texture,
|
||||||
0, /* not in either GLES */
|
GST_GL_API_NONE,
|
||||||
|
255, 255,
|
||||||
|
255, 255, /* not in either GLES */
|
||||||
"\0",
|
"\0",
|
||||||
"IMG_multisampled_render_to_texture\0")
|
"IMG_multisampled_render_to_texture\0")
|
||||||
GST_GL_EXT_FUNCTION (void, RenderbufferStorageMultisampleIMG,
|
GST_GL_EXT_FUNCTION (void, RenderbufferStorageMultisampleIMG,
|
||||||
|
|
|
@ -41,8 +41,9 @@
|
||||||
/* These are the core GL functions which are only available in big
|
/* These are the core GL functions which are only available in big
|
||||||
GL */
|
GL */
|
||||||
GST_GL_EXT_BEGIN (only_in_big_gl,
|
GST_GL_EXT_BEGIN (only_in_big_gl,
|
||||||
0, 0,
|
GST_GL_API_OPENGL | GST_GL_API_OPENGL3,
|
||||||
0, /* not in GLES */
|
1, 0,
|
||||||
|
255, 255, /* not in GLES */
|
||||||
"\0",
|
"\0",
|
||||||
"\0")
|
"\0")
|
||||||
GST_GL_EXT_FUNCTION (void, GetTexLevelParameteriv,
|
GST_GL_EXT_FUNCTION (void, GetTexLevelParameteriv,
|
||||||
|
@ -52,10 +53,18 @@ GST_GL_EXT_FUNCTION (void, GetTexImage,
|
||||||
(GLenum target, GLint level,
|
(GLenum target, GLint level,
|
||||||
GLenum format, GLenum type,
|
GLenum format, GLenum type,
|
||||||
GLvoid *pixels))
|
GLvoid *pixels))
|
||||||
GST_GL_EXT_FUNCTION (void, ClipPlane,
|
|
||||||
(GLenum plane, const double *equation))
|
|
||||||
GST_GL_EXT_FUNCTION (void, DepthRange,
|
GST_GL_EXT_FUNCTION (void, DepthRange,
|
||||||
(double near_val, double far_val))
|
(double near_val, double far_val))
|
||||||
GST_GL_EXT_FUNCTION (void, DrawBuffer,
|
GST_GL_EXT_FUNCTION (void, DrawBuffer,
|
||||||
(GLenum mode))
|
(GLenum mode))
|
||||||
GST_GL_EXT_END ()
|
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 ()
|
||||||
|
|
|
@ -40,8 +40,11 @@
|
||||||
|
|
||||||
/* This lists functions that are unique to GL 2.0 or GLES 2.0 and are
|
/* This lists functions that are unique to GL 2.0 or GLES 2.0 and are
|
||||||
* not in the old GLSL extensions */
|
* 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,
|
GST_GL_API_GLES2,
|
||||||
|
2, 0,
|
||||||
|
2, 0,
|
||||||
"\0",
|
"\0",
|
||||||
"\0")
|
"\0")
|
||||||
GST_GL_EXT_FUNCTION (GLuint, CreateProgram,
|
GST_GL_EXT_FUNCTION (GLuint, CreateProgram,
|
||||||
|
@ -90,8 +93,11 @@ GST_GL_EXT_END ()
|
||||||
|
|
||||||
/* These functions are provided by GL_ARB_shader_objects or are in GL
|
/* These functions are provided by GL_ARB_shader_objects or are in GL
|
||||||
* 2.0 core */
|
* 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,
|
GST_GL_API_GLES2,
|
||||||
|
2, 0,
|
||||||
|
2, 0,
|
||||||
"ARB\0",
|
"ARB\0",
|
||||||
"shader_objects\0")
|
"shader_objects\0")
|
||||||
GST_GL_EXT_FUNCTION (void, ShaderSource,
|
GST_GL_EXT_FUNCTION (void, ShaderSource,
|
||||||
|
@ -216,8 +222,11 @@ GST_GL_EXT_END ()
|
||||||
|
|
||||||
/* These functions are provided by GL_ARB_vertex_shader or are in GL
|
/* These functions are provided by GL_ARB_vertex_shader or are in GL
|
||||||
* 2.0 core */
|
* 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,
|
GST_GL_API_GLES2,
|
||||||
|
2, 0,
|
||||||
|
2, 0,
|
||||||
"ARB\0",
|
"ARB\0",
|
||||||
"vertex_shader\0")
|
"vertex_shader\0")
|
||||||
GST_GL_EXT_FUNCTION (void, VertexAttribPointer,
|
GST_GL_EXT_FUNCTION (void, VertexAttribPointer,
|
||||||
|
@ -270,8 +279,10 @@ GST_GL_EXT_END ()
|
||||||
/* These only list functions that come from the old GLSL extensions.
|
/* These only list functions that come from the old GLSL extensions.
|
||||||
* Functions that are common to the extensions and GLSL 2.0 should
|
* Functions that are common to the extensions and GLSL 2.0 should
|
||||||
* instead be listed in cogl-glsl-functions.h */
|
* instead be listed in cogl-glsl-functions.h */
|
||||||
GST_GL_EXT_BEGIN (shader_objects, 255, 255,
|
GST_GL_EXT_BEGIN (shader_objects,
|
||||||
0, /* not in either GLES */
|
GST_GL_API_NONE,
|
||||||
|
255, 255,
|
||||||
|
255, 255, /* not in either GLES */
|
||||||
"ARB\0",
|
"ARB\0",
|
||||||
"shader_objects\0")
|
"shader_objects\0")
|
||||||
GST_GL_EXT_FUNCTION (GLuint, CreateProgramObject,
|
GST_GL_EXT_FUNCTION (GLuint, CreateProgramObject,
|
||||||
|
@ -303,8 +314,10 @@ GST_GL_EXT_FUNCTION (void, GetAttachedObjects,
|
||||||
GST_GL_EXT_END ()
|
GST_GL_EXT_END ()
|
||||||
|
|
||||||
/* ARB_fragment_program */
|
/* ARB_fragment_program */
|
||||||
GST_GL_EXT_BEGIN (arbfp, 255, 255,
|
GST_GL_EXT_BEGIN (arbfp,
|
||||||
0, /* not in either GLES */
|
GST_GL_API_NONE,
|
||||||
|
255, 255,
|
||||||
|
255, 255, /* not in either GLES */
|
||||||
"ARB\0",
|
"ARB\0",
|
||||||
"fragment_program\0")
|
"fragment_program\0")
|
||||||
GST_GL_EXT_FUNCTION (void, GenPrograms,
|
GST_GL_EXT_FUNCTION (void, GenPrograms,
|
||||||
|
@ -329,8 +342,11 @@ GST_GL_EXT_END ()
|
||||||
|
|
||||||
/* This lists functions that are unique to GL 2.1 or GLES 3.0 and are
|
/* This lists functions that are unique to GL 2.1 or GLES 3.0 and are
|
||||||
* not in the old GLSL extensions */
|
* not in the old GLSL extensions */
|
||||||
GST_GL_EXT_BEGIN (shaders_2_1, 2, 1,
|
GST_GL_EXT_BEGIN (shaders_2_1,
|
||||||
GST_GL_API_GLES3,
|
GST_GL_API_OPENGL | GST_GL_API_OPENGL3 |
|
||||||
|
GST_GL_API_GLES2,
|
||||||
|
2, 1,
|
||||||
|
3, 0,
|
||||||
"\0",
|
"\0",
|
||||||
"\0")
|
"\0")
|
||||||
GST_GL_EXT_FUNCTION (void, UniformMatrix2x3fv,
|
GST_GL_EXT_FUNCTION (void, UniformMatrix2x3fv,
|
||||||
|
|
|
@ -68,13 +68,6 @@ gst_gl_api_to_string (GstGLAPI api)
|
||||||
str = g_string_new (GST_GL_API_GLES2_NAME);
|
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:
|
out:
|
||||||
if (!str)
|
if (!str)
|
||||||
|
@ -117,9 +110,6 @@ gst_gl_api_from_string (const gchar * apis_s)
|
||||||
} else if (g_strstr_len (apis, 5, GST_GL_API_GLES2_NAME)) {
|
} else if (g_strstr_len (apis, 5, GST_GL_API_GLES2_NAME)) {
|
||||||
ret |= GST_GL_API_GLES2;
|
ret |= GST_GL_API_GLES2;
|
||||||
apis = &apis[5];
|
apis = &apis[5];
|
||||||
} else if (g_strstr_len (apis, 5, GST_GL_API_GLES3_NAME)) {
|
|
||||||
ret |= GST_GL_API_GLES3;
|
|
||||||
apis = &apis[5];
|
|
||||||
} else {
|
} else {
|
||||||
GST_ERROR ("Error parsing \'%s\'", apis);
|
GST_ERROR ("Error parsing \'%s\'", apis);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -97,7 +97,6 @@ typedef enum {
|
||||||
GST_GL_API_OPENGL3 = (1 << 1),
|
GST_GL_API_OPENGL3 = (1 << 1),
|
||||||
GST_GL_API_GLES1 = (1 << 15),
|
GST_GL_API_GLES1 = (1 << 15),
|
||||||
GST_GL_API_GLES2 = (1 << 16),
|
GST_GL_API_GLES2 = (1 << 16),
|
||||||
GST_GL_API_GLES3 = (1 << 17),
|
|
||||||
|
|
||||||
GST_GL_API_ANY = G_MAXUINT32
|
GST_GL_API_ANY = G_MAXUINT32
|
||||||
} GstGLAPI;
|
} GstGLAPI;
|
||||||
|
@ -106,7 +105,6 @@ typedef enum {
|
||||||
#define GST_GL_API_OPENGL3_NAME "opengl3"
|
#define GST_GL_API_OPENGL3_NAME "opengl3"
|
||||||
#define GST_GL_API_GLES1_NAME "gles1"
|
#define GST_GL_API_GLES1_NAME "gles1"
|
||||||
#define GST_GL_API_GLES2_NAME "gles2"
|
#define GST_GL_API_GLES2_NAME "gles2"
|
||||||
#define GST_GL_API_GLES3_NAME "gles3"
|
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
@ -120,7 +118,8 @@ typedef enum
|
||||||
GST_GL_PLATFORM_ANY = G_MAXUINT32
|
GST_GL_PLATFORM_ANY = G_MAXUINT32
|
||||||
} GstGLPlatform;
|
} 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) \
|
#define GST_GL_EXT_FUNCTION(ret, name, args) \
|
||||||
ret GSTGLAPI (*name) args;
|
ret GSTGLAPI (*name) args;
|
||||||
#define GST_GL_EXT_END()
|
#define GST_GL_EXT_END()
|
||||||
|
|
|
@ -41,11 +41,11 @@
|
||||||
* gst_gl_color_convert_set_texture_scaling().
|
* gst_gl_color_convert_set_texture_scaling().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define USING_OPENGL(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL)
|
#define USING_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
|
||||||
#define USING_OPENGL3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL3)
|
#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
|
||||||
#define USING_GLES(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES)
|
#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
|
||||||
#define USING_GLES2(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES2)
|
#define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
|
||||||
#define USING_GLES3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES3)
|
#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 void _do_convert (GstGLContext * context, GstGLColorConvert * convert);
|
||||||
static gboolean _init_convert (GstGLColorConvert * convert);
|
static gboolean _init_convert (GstGLColorConvert * convert);
|
||||||
|
|
|
@ -37,11 +37,11 @@
|
||||||
* A #GstGLDownload can be created with gst_gl_download_new()
|
* 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_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
|
||||||
#define USING_OPENGL3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL3)
|
#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
|
||||||
#define USING_GLES(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES)
|
#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
|
||||||
#define USING_GLES2(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES2)
|
#define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
|
||||||
#define USING_GLES3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES3)
|
#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,
|
static gboolean _do_download (GstGLDownload * download, guint texture_id,
|
||||||
gpointer data[GST_VIDEO_MAX_PLANES]);
|
gpointer data[GST_VIDEO_MAX_PLANES]);
|
||||||
|
|
|
@ -54,8 +54,9 @@ gst_gl_check_extension (const char *name, const gchar * ext)
|
||||||
/* Define a set of arrays containing the functions required from GL
|
/* Define a set of arrays containing the functions required from GL
|
||||||
for each feature */
|
for each feature */
|
||||||
#define GST_GL_EXT_BEGIN(name, \
|
#define GST_GL_EXT_BEGIN(name, \
|
||||||
|
gl_availability, \
|
||||||
min_gl_major, min_gl_minor, \
|
min_gl_major, min_gl_minor, \
|
||||||
gles_availability, \
|
min_gles_major, min_gles_minor, \
|
||||||
namespaces, extension_names) \
|
namespaces, extension_names) \
|
||||||
static const GstGLFeatureFunction gst_gl_ext_ ## name ## _funcs[] = {
|
static const GstGLFeatureFunction gst_gl_ext_ ## name ## _funcs[] = {
|
||||||
#define GST_GL_EXT_FUNCTION(ret, name, args) \
|
#define GST_GL_EXT_FUNCTION(ret, name, args) \
|
||||||
|
@ -66,16 +67,18 @@ gst_gl_check_extension (const char *name, const gchar * ext)
|
||||||
#include "glprototypes/all_functions.h"
|
#include "glprototypes/all_functions.h"
|
||||||
|
|
||||||
#undef GST_GL_EXT_BEGIN
|
#undef GST_GL_EXT_BEGIN
|
||||||
#define GST_GL_EXT_BEGIN(name, \
|
|
||||||
min_gl_major, min_gl_minor, \
|
|
||||||
gles_availability, \
|
|
||||||
namespaces, extension_names) \
|
|
||||||
{ min_gl_major, min_gl_minor, gles_availability, namespaces, \
|
|
||||||
extension_names, \
|
|
||||||
gst_gl_ext_ ## name ## _funcs },
|
|
||||||
#undef GST_GL_EXT_FUNCTION
|
#undef GST_GL_EXT_FUNCTION
|
||||||
#define GST_GL_EXT_FUNCTION(ret, name, args)
|
|
||||||
#undef GST_GL_EXT_END
|
#undef GST_GL_EXT_END
|
||||||
|
|
||||||
|
#define GST_GL_EXT_BEGIN(name, \
|
||||||
|
gl_availability, \
|
||||||
|
min_gl_major, min_gl_minor, \
|
||||||
|
min_gles_major, min_gles_minor, \
|
||||||
|
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 },
|
||||||
|
#define GST_GL_EXT_FUNCTION(ret, name, args)
|
||||||
#define GST_GL_EXT_END()
|
#define GST_GL_EXT_END()
|
||||||
|
|
||||||
static const GstGLFeatureData gst_gl_feature_ext_functions_data[] = {
|
static const GstGLFeatureData gst_gl_feature_ext_functions_data[] = {
|
||||||
|
@ -149,15 +152,25 @@ _gst_gl_feature_check (GstGLContext * context,
|
||||||
const char *suffix = NULL;
|
const char *suffix = NULL;
|
||||||
int func_num;
|
int func_num;
|
||||||
GstGLFuncs *gst_gl = context->gl_vtable;
|
GstGLFuncs *gst_gl = context->gl_vtable;
|
||||||
|
guint gl_min = 0, gl_maj = 0;
|
||||||
GstGLAPI gl_api = gst_gl_context_get_gl_api (context);
|
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
|
/* First check whether the functions should be directly provided by
|
||||||
GL */
|
GL */
|
||||||
if (((gl_api & GST_GL_API_OPENGL) &&
|
if (gst_gl_context_check_gl_version (context, data->gl_availability, gl_maj,
|
||||||
GST_GL_CHECK_GL_VERSION (gl_major, gl_minor,
|
gl_min)) {
|
||||||
data->min_gl_major, data->min_gl_minor)) ||
|
|
||||||
((gl_api & GST_GL_API_GLES2) &&
|
|
||||||
(data->gl_availability & GST_GL_API_GLES2))) {
|
|
||||||
in_core = TRUE;
|
in_core = TRUE;
|
||||||
suffix = "";
|
suffix = "";
|
||||||
} else {
|
} else {
|
||||||
|
@ -217,6 +230,7 @@ _gst_gl_feature_check (GstGLContext * context,
|
||||||
* then set all of the functions pointers to NULL so we can safely
|
* then set all of the functions pointers to NULL so we can safely
|
||||||
* do feature testing by just looking at the function pointers */
|
* do feature testing by just looking at the function pointers */
|
||||||
error:
|
error:
|
||||||
|
GST_DEBUG ("failed to find feature %s", data->feature_name);
|
||||||
|
|
||||||
for (func_num = 0; data->functions[func_num].name; func_num++) {
|
for (func_num = 0; data->functions[func_num].name; func_num++) {
|
||||||
*(void **) ((guint8 *) gst_gl +
|
*(void **) ((guint8 *) gst_gl +
|
||||||
|
@ -224,7 +238,7 @@ error:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (full_function_name) {
|
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);
|
g_free (full_function_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,13 +68,19 @@ typedef struct _GstGLFeatureData GstGLFeatureData;
|
||||||
|
|
||||||
struct _GstGLFeatureData
|
struct _GstGLFeatureData
|
||||||
{
|
{
|
||||||
/* A minimum GL version which the functions should be defined in
|
/* name of the feature */
|
||||||
without needing an extension. Set to 255,255 if it's only
|
const char *feature_name;
|
||||||
provided in an extension */
|
|
||||||
int min_gl_major, min_gl_minor;
|
|
||||||
/* Flags specifying which versions of GL the feature is available
|
/* Flags specifying which versions of GL the feature is available
|
||||||
in core in */
|
in core in */
|
||||||
GstGLAPI gl_availability;
|
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" */
|
/* \0 separated list of namespaces to try. Eg "EXT\0ARB\0" */
|
||||||
const char *namespaces;
|
const char *namespaces;
|
||||||
/* \0 separated list of required extension names without the GL_EXT
|
/* \0 separated list of required extension names without the GL_EXT
|
||||||
|
|
|
@ -42,11 +42,11 @@
|
||||||
* Data is uploaded or downloaded from the GPU as is necessary.
|
* 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_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
|
||||||
#define USING_OPENGL3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL3)
|
#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
|
||||||
#define USING_GLES(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES)
|
#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
|
||||||
#define USING_GLES2(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES2)
|
#define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
|
||||||
#define USING_GLES3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES3)
|
#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);
|
GST_DEBUG_CATEGORY_STATIC (GST_CAT_GL_MEMORY);
|
||||||
#define GST_CAT_DEFUALT GST_CAT_GL_MEMORY
|
#define GST_CAT_DEFUALT GST_CAT_GL_MEMORY
|
||||||
|
@ -438,7 +438,7 @@ _calculate_unpack_length (GstGLMemory * gl_mem)
|
||||||
#if GST_GL_HAVE_OPENGL || GST_GL_HAVE_GLES3
|
#if GST_GL_HAVE_OPENGL || GST_GL_HAVE_GLES3
|
||||||
if (USING_OPENGL (gl_mem->context) || USING_GLES3 (gl_mem->context)) {
|
if (USING_OPENGL (gl_mem->context) || USING_GLES3 (gl_mem->context)) {
|
||||||
gl_mem->unpack_length = gl_mem->stride / n_gl_bytes;
|
gl_mem->unpack_length = gl_mem->stride / n_gl_bytes;
|
||||||
}
|
} else
|
||||||
#endif
|
#endif
|
||||||
#if GST_GL_HAVE_GLES2
|
#if GST_GL_HAVE_GLES2
|
||||||
if (USING_GLES2 (gl_mem->context)) {
|
if (USING_GLES2 (gl_mem->context)) {
|
||||||
|
|
|
@ -59,11 +59,11 @@ static const gchar *simple_fragment_shader_str_gles2 =
|
||||||
#define GST_GL_SHADER_GET_PRIVATE(o) \
|
#define GST_GL_SHADER_GET_PRIVATE(o) \
|
||||||
(G_TYPE_INSTANCE_GET_PRIVATE((o), GST_GL_TYPE_SHADER, GstGLShaderPrivate))
|
(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_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
|
||||||
#define USING_OPENGL3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL3)
|
#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
|
||||||
#define USING_GLES(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES)
|
#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
|
||||||
#define USING_GLES2(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES2)
|
#define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
|
||||||
#define USING_GLES3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES3)
|
#define USING_GLES3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 3, 0))
|
||||||
|
|
||||||
typedef struct _GstGLShaderVTable
|
typedef struct _GstGLShaderVTable
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,11 +41,11 @@
|
||||||
* A #GstGLUpload can be created with gst_gl_upload_new()
|
* 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_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
|
||||||
#define USING_OPENGL3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL3)
|
#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
|
||||||
#define USING_GLES(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES)
|
#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
|
||||||
#define USING_GLES2(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES2)
|
#define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
|
||||||
#define USING_GLES3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES3)
|
#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 _upload_memory (GstGLUpload * upload);
|
||||||
static gboolean _init_upload (GstGLUpload * upload);
|
static gboolean _init_upload (GstGLUpload * upload);
|
||||||
|
|
|
@ -37,11 +37,11 @@
|
||||||
* A #GstGLUpload can be created with gst_gl_upload_new()
|
* 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_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
|
||||||
#define USING_OPENGL3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_OPENGL3)
|
#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
|
||||||
#define USING_GLES(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES)
|
#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
|
||||||
#define USING_GLES2(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES2)
|
#define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
|
||||||
#define USING_GLES3(context) (gst_gl_context_get_gl_api (context) & GST_GL_API_GLES3)
|
#define USING_GLES3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 3, 0))
|
||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
|
|
||||||
|
|
|
@ -48,11 +48,11 @@
|
||||||
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
|
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define USING_OPENGL(context) (gst_gl_context_get_gl_apie (context) & GST_GL_API_OPENGL)
|
#define USING_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
|
||||||
#define USING_OPENGL3(context) (gst_gl_context_get_gl_apie (context) & GST_GL_API_OPENGL3)
|
#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
|
||||||
#define USING_GLES(context) (gst_gl_context_get_gl_apie (context) & GST_GL_API_GLES)
|
#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
|
||||||
#define USING_GLES2(context) (gst_gl_context_get_gl_apie (context)->gl_api & GST_GL_API_GLES2)
|
#define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
|
||||||
#define USING_GLES3(context) (gst_gl_context_get_gl_apie (context) & GST_GL_API_GLES3)
|
#define USING_GLES3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 3, 0))
|
||||||
|
|
||||||
static gchar *error_message;
|
static gchar *error_message;
|
||||||
|
|
||||||
|
|
|
@ -62,11 +62,11 @@
|
||||||
#include "dispmanx/gstglwindow_dispmanx_egl.h"
|
#include "dispmanx/gstglwindow_dispmanx_egl.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define USING_OPENGL(display) (display->gl_api & GST_GL_API_OPENGL)
|
#define USING_OPENGL(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL, 1, 0))
|
||||||
#define USING_OPENGL3(display) (display->gl_api & GST_GL_API_OPENGL3)
|
#define USING_OPENGL3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 1))
|
||||||
#define USING_GLES(display) (display->gl_api & GST_GL_API_GLES)
|
#define USING_GLES(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES, 1, 0))
|
||||||
#define USING_GLES2(display) (display->gl_api & GST_GL_API_GLES2)
|
#define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
|
||||||
#define USING_GLES3(display) (display->gl_api & GST_GL_API_GLES3)
|
#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
|
#define GST_CAT_DEFAULT gst_gl_window_debug
|
||||||
GST_DEBUG_CATEGORY (GST_CAT_DEFAULT);
|
GST_DEBUG_CATEGORY (GST_CAT_DEFAULT);
|
||||||
|
|
Loading…
Reference in a new issue