• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * GStreamer
3  * Copyright (C) 2016 Matthew Waters <matthew@centricular.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 /**
22  * SECTION:gstegl
23  * @short_description: EGL helpers
24  * @title: GstEGL
25  * @see_also: #GstGLDisplayEGL, #GstEGLImage
26  */
27 
28 #ifdef HAVE_CONFIG_H
29 #include "config.h"
30 #endif
31 
32 #include <gst/gl/egl/gstegl.h>
33 
34 /**
35  * gst_egl_get_error_string:
36  * @err: (type gint32): an EGL error code
37  *
38  * Returns: the short string representation of @err
39  */
40 const gchar *
gst_egl_get_error_string(EGLint err)41 gst_egl_get_error_string (EGLint err)
42 {
43   switch (err) {
44     case EGL_SUCCESS:
45       return "EGL_SUCCESS";
46     case EGL_BAD_DISPLAY:
47       return "EGL_BAD_DISPLAY";
48     case EGL_NOT_INITIALIZED:
49       return "EGL_NOT_INITIALIZED";
50     case EGL_BAD_ACCESS:
51       return "EGL_BAD_ACCESS";
52     case EGL_BAD_ALLOC:
53       return "EGL_BAD_ALLOC";
54     case EGL_BAD_ATTRIBUTE:
55       return "EGL_BAD_ATTRIBUTE";
56     case EGL_BAD_CONFIG:
57       return "EGL_BAD_CONFIG";
58     case EGL_BAD_CONTEXT:
59       return "EGL_BAD_CONTEXT";
60     case EGL_BAD_CURRENT_SURFACE:
61       return "EGL_BAD_CURRENT_SURFACE";
62     case EGL_BAD_MATCH:
63       return "EGL_BAD_MATCH";
64     case EGL_BAD_NATIVE_PIXMAP:
65       return "EGL_BAD_NATIVE_PIXMAP";
66     case EGL_BAD_NATIVE_WINDOW:
67       return "EGL_BAD_NATIVE_WINDOW";
68     case EGL_BAD_PARAMETER:
69       return "EGL_BAD_PARAMETER";
70     case EGL_BAD_SURFACE:
71       return "EGL_BAD_SURFACE";
72     default:
73       return "unknown";
74   }
75 }
76