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 gulong window_handle_signal; 71 72 GstStructure *requested_config; 73 }; 74 75 /** 76 * GstGLContextEGLCLass: 77 * 78 * Opaque #GstGLContextEGLClass struct 79 */ 80 struct _GstGLContextEGLClass 81 { 82 /*< private >*/ 83 GstGLContextClass parent; 84 }; 85 86 G_GNUC_INTERNAL 87 GstGLContextEGL * gst_gl_context_egl_new (GstGLDisplay * display); 88 89 G_GNUC_INTERNAL 90 guintptr gst_gl_context_egl_get_current_context (void); 91 92 G_GNUC_INTERNAL 93 gpointer gst_gl_context_egl_get_proc_address (GstGLAPI gl_api, const gchar * name); 94 95 G_GNUC_INTERNAL 96 gboolean gst_gl_context_egl_fill_info (GstGLContext * context, GError ** error); 97 98 G_END_DECLS 99 100 #endif /* __GST_GL_CONTEXT_EGL_H__ */ 101