gl/context: fill a GError on platform-specific fill_info() error
[platform/upstream/gst-plugins-base.git] / gst-libs / gst / gl / egl / gstglcontext_egl.h
1 /*
2  * GStreamer
3  * Copyright (C) 2013 Sebastian Dröge <slomo@circular-chaos.org>
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 #ifndef __GST_GL_CONTEXT_EGL_H__
22 #define __GST_GL_CONTEXT_EGL_H__
23
24 #include <gst/gl/gstglcontext.h>
25 #include <gst/gl/egl/gstgldisplay_egl.h>
26
27 G_BEGIN_DECLS
28
29 typedef struct _GstGLContextEGL GstGLContextEGL;
30 typedef struct _GstGLContextEGLClass GstGLContextEGLClass;
31
32 G_GNUC_INTERNAL GType gst_gl_context_egl_get_type (void);
33 #define GST_TYPE_GL_CONTEXT_EGL         (gst_gl_context_egl_get_type())
34
35 #define GST_GL_CONTEXT_EGL(o)           (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_GL_CONTEXT_EGL, GstGLContextEGL))
36 #define GST_GL_CONTEXT_EGL_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), GST_TYPE_GL_CONTEXT_EGL, GstGLContextEGLClass))
37 #define GST_IS_GL_CONTEXT_EGL(o)        (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_GL_CONTEXT_EGL))
38 #define GST_IS_GL_CONTEXT_EGL_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE((k), GST_TYPE_GL_CONTEXT_EGL))
39 #define GST_GL_CONTEXT_EGL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_TYPE_GL_CONTEXT_EGL, GstGLContextEGLClass))
40
41 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstGLContextEGL, gst_object_unref)
42
43
44 /**
45  * GstGLContextEGL:
46  *
47  * Opaque #GstGLContextEGL struct
48  */
49 struct _GstGLContextEGL
50 {
51   /*< private >*/
52   GstGLContext context;
53
54   GstGLDisplayEGL *display_egl;
55
56   gpointer egl_context;
57   gpointer egl_display;
58   gpointer egl_surface;
59   gpointer egl_config;
60
61   gint egl_major;
62   gint egl_minor;
63
64   GstGLAPI gl_api;
65
66   const gchar *egl_exts;
67
68   /* Cached handle */
69   guintptr window_handle;
70
71   GstStructure *requested_config;
72 };
73
74 /**
75  * GstGLContextEGLCLass:
76  *
77  * Opaque #GstGLContextEGLClass struct
78  */
79 struct _GstGLContextEGLClass
80 {
81   /*< private >*/
82   GstGLContextClass parent;
83 };
84
85 G_GNUC_INTERNAL
86 GstGLContextEGL *   gst_gl_context_egl_new                  (GstGLDisplay * display);
87
88 G_GNUC_INTERNAL
89 guintptr            gst_gl_context_egl_get_current_context  (void);
90
91 G_GNUC_INTERNAL
92 gpointer            gst_gl_context_egl_get_proc_address     (GstGLAPI gl_api, const gchar * name);
93
94 G_GNUC_INTERNAL
95 gboolean            gst_gl_context_egl_fill_info            (GstGLContext * context, GError ** error);
96
97 G_END_DECLS
98
99 #endif /* __GST_GL_CONTEXT_EGL_H__ */