summaryrefslogtreecommitdiff
path: root/gst-libs/gst/gl/gstglcontext.c
diff options
context:
space:
mode:
authorMatthew Waters <ystreet00@gmail.com>2014-02-11 08:23:39 +1100
committerMatthew Waters <ystreet00@gmail.com>2014-03-15 18:37:06 +0100
commit767a3524aead4ca8a4f26058da015f4c3ff0f6d6 (patch)
tree370d917c6f2595a434822d8c912ff91a03a4764a /gst-libs/gst/gl/gstglcontext.c
parent49307fefd6c7737019cbc5a45db990ead34bd34b (diff)
downloadgstreamer-plugins-bad-767a3524aead4ca8a4f26058da015f4c3ff0f6d6.tar.gz
[883/906] api: provide from_string()
Also s/gst_gl_api_string/gst_gl_api_to_string/g
Diffstat (limited to 'gst-libs/gst/gl/gstglcontext.c')
-rw-r--r--gst-libs/gst/gl/gstglcontext.c45
1 files changed, 4 insertions, 41 deletions
diff --git a/gst-libs/gst/gl/gstglcontext.c b/gst-libs/gst/gl/gstglcontext.c
index 16a985b55..c385682cf 100644
--- a/gst-libs/gst/gl/gstglcontext.c
+++ b/gst-libs/gst/gl/gstglcontext.c
@@ -572,43 +572,6 @@ _compiled_api (void)
return ret;
}
-GstGLAPI
-_parse_gl_api (const gchar * apis_s)
-{
- GstGLAPI ret = GST_GL_API_NONE;
- gchar *apis = (gchar *) apis_s;
-
- while (apis) {
- if (apis[0] == '\0') {
- break;
- } else if (apis[0] == ' ' || apis[0] == ',') {
- apis = &apis[1];
- } else if (g_strstr_len (apis, 7, "opengl3")) {
- ret |= GST_GL_API_OPENGL3;
- apis = &apis[7];
- } else if (g_strstr_len (apis, 6, "opengl")) {
- ret |= GST_GL_API_OPENGL;
- apis = &apis[6];
- } else if (g_strstr_len (apis, 5, "gles1")) {
- ret |= GST_GL_API_GLES;
- apis = &apis[5];
- } else if (g_strstr_len (apis, 5, "gles2")) {
- ret |= GST_GL_API_GLES2;
- apis = &apis[5];
- } else if (g_strstr_len (apis, 5, "gles3")) {
- ret |= GST_GL_API_GLES3;
- apis = &apis[5];
- } else {
- break;
- }
- }
-
- if (ret == GST_GL_API_NONE)
- ret = GST_GL_API_ANY;
-
- return ret;
-}
-
static void
_unlock_create_thread (GstGLContext * context)
{
@@ -653,10 +616,10 @@ gst_gl_context_create_thread (GstGLContext * context)
user_choice = g_getenv ("GST_GL_API");
- user_api = _parse_gl_api (user_choice);
- user_api_string = gst_gl_api_string (user_api);
+ user_api = gst_gl_api_from_string (user_choice);
+ user_api_string = gst_gl_api_to_string (user_api);
- compiled_api_s = gst_gl_api_string (compiled_api);
+ compiled_api_s = gst_gl_api_to_string (compiled_api);
if ((user_api & compiled_api) == GST_GL_API_NONE) {
g_set_error (error, GST_GL_CONTEXT_ERROR, GST_GL_CONTEXT_ERROR_WRONG_API,
@@ -700,7 +663,7 @@ gst_gl_context_create_thread (GstGLContext * context)
g_assert (display->gl_api != GST_GL_API_NONE
&& display->gl_api != GST_GL_API_ANY);
- api_string = gst_gl_api_string (display->gl_api);
+ api_string = gst_gl_api_to_string (display->gl_api);
GST_INFO ("available GL APIs: %s", api_string);
if (((compiled_api & display->gl_api) & user_api) == GST_GL_API_NONE) {