mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 02:00:33 +00:00
gl/context: add check_gl_version
This commit is contained in:
parent
2ee94d606c
commit
babef3069b
2 changed files with 32 additions and 0 deletions
|
@ -1041,6 +1041,37 @@ gst_gl_context_get_gl_version (GstGLContext * context, gint * maj, gint * min)
|
|||
*min = context->priv->gl_minor;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_gl_context_check_gl_version:
|
||||
* @context: a #GstGLContext
|
||||
* @api: api type required
|
||||
* @maj: major version required
|
||||
* @min: minor version required
|
||||
*
|
||||
* Returns: whether OpenGL context implements the required api and specified
|
||||
* version.
|
||||
*/
|
||||
gboolean
|
||||
gst_gl_context_check_gl_version (GstGLContext * context, GstGLAPI api,
|
||||
gint maj, gint min)
|
||||
{
|
||||
g_return_if_fail (GST_GL_IS_CONTEXT (context));
|
||||
|
||||
if (maj > context->priv->gl_major)
|
||||
return FALSE;
|
||||
|
||||
if ((gst_gl_context_get_gl_api (context) & api) == GST_GL_API_NONE)
|
||||
return FALSE;
|
||||
|
||||
if (maj < context->priv->gl_major)
|
||||
return TRUE;
|
||||
|
||||
if (min > context->priv->gl_minor)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_gl_context_check_feature:
|
||||
* @context: a #GstGLContext
|
||||
|
|
|
@ -135,6 +135,7 @@ gboolean gst_gl_context_set_window (GstGLContext *context, GstGLWindow *win
|
|||
GstGLWindow * gst_gl_context_get_window (GstGLContext *context);
|
||||
|
||||
void gst_gl_context_get_gl_version (GstGLContext *context, gint *maj, gint *min);
|
||||
gboolean gst_gl_context_check_gl_version (GstGLContext * context, GstGLAPI api, gint maj, gint min);
|
||||
gboolean gst_gl_context_check_feature (GstGLContext *context, const gchar *feature);
|
||||
|
||||
/* FIXME: remove */
|
||||
|
|
Loading…
Reference in a new issue