#else
gboolean texture_rg =
gst_gl_context_check_feature (context, "GL_EXT_texture_rg")
- || gst_gl_context_check_feature (context, "GL_ARB_texture_rg");
+ || gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 3, 0)
+ || gst_gl_context_check_feature (context, "GL_ARB_texture_rg")
+ || gst_gl_context_check_gl_version (context, GST_GL_API_OPENGL3, 3, 0);
#endif
guint n_plane_components;
}
static inline GLenum
-_sized_gl_format_from_gl_format_type (GLenum format, GLenum type)
+_sized_gl_format_from_gl_format_type (GstGLContext * context, GLenum format,
+ GLenum type)
{
+ gboolean ext_texture_rg =
+ gst_gl_context_check_feature (context, "GL_EXT_texture_rg");
+
switch (format) {
case GL_RGBA:
switch (type) {
case GL_RG:
switch (type) {
case GL_UNSIGNED_BYTE:
+ if (ext_texture_rg)
+ return GL_RG;
return GL_RG8;
break;
}
case GL_RED:
switch (type) {
case GL_UNSIGNED_BYTE:
+ if (ext_texture_rg)
+ return GL_RED;
return GL_R8;
break;
}
data->gl_format, data->gl_type, data->width, data->height);
internal_format =
- _sized_gl_format_from_gl_format_type (data->gl_format, data->gl_type);
+ _sized_gl_format_from_gl_format_type (context, data->gl_format,
+ data->gl_type);
gl->GenTextures (1, &data->result);
gl->BindTexture (data->gl_target, data->result);