• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * GStreamer
3  * Copyright (C) 2012 Collabora Ltd.
4  *   @author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
5  * Copyright (C) 2014 Julien Isorce <julien.isorce@gmail.com>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef _GST_GL_MEMORY_EGL_H_
24 #define _GST_GL_MEMORY_EGL_H_
25 
26 #include <gst/gl/gstglmemory.h>
27 #include <gst/gl/egl/gsteglimage.h>
28 #include <gst/gl/egl/gstgldisplay_egl.h>
29 
30 G_BEGIN_DECLS
31 
32 #define GST_TYPE_GL_MEMORY_EGL_ALLOCATOR (gst_gl_memory_egl_allocator_get_type())
33 GST_GL_API GType gst_gl_memory_egl_allocator_get_type(void);
34 
35 #define GST_IS_GL_MEMORY_EGL_ALLOCATOR(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GL_MEMORY_EGL_ALLOCATOR))
36 #define GST_IS_GL_MEMORY_EGL_ALLOCATOR_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_GL_MEMORY_EGL_ALLOCATOR))
37 #define GST_GL_MEMORY_EGL_ALLOCATOR_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_GL_MEMORY_EGL_ALLOCATOR, GstGLMemoryEGLAllocatorClass))
38 #define GST_GL_MEMORY_EGL_ALLOCATOR(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GL_MEMORY_EGL_ALLOCATOR, GstGLMemoryEGLAllocator))
39 #define GST_GL_MEMORY_EGL_ALLOCATOR_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GL_MEMORY_EGL_ALLOCATOR, GstGLMemoryEGLAllocatorClass))
40 #define GST_GL_MEMORY_EGL_ALLOCATOR_CAST(obj)            ((GstGLMemoryEGLAllocator *)(obj))
41 
42 typedef struct _GstGLMemoryEGL GstGLMemoryEGL;
43 typedef struct _GstGLMemoryEGLAllocator GstGLMemoryEGLAllocator;
44 typedef struct _GstGLMemoryEGLAllocatorClass GstGLMemoryEGLAllocatorClass;
45 
46 /**
47  * GstGLMemoryEGL:
48  *
49  * Private instance
50  */
51 struct _GstGLMemoryEGL
52 {
53   /*< private >*/
54   GstGLMemory mem;
55 
56   GstEGLImage *image;
57 
58   gpointer _padding[GST_PADDING];
59 };
60 
61 /**
62  * GST_GL_MEMORY_EGL_ALLOCATOR_NAME:
63  *
64  * The name of the GL Memory EGL allocator
65  */
66 #define GST_GL_MEMORY_EGL_ALLOCATOR_NAME "GLMemoryEGL"
67 
68 /**
69  * GST_TYPE_GL_MEMORY_EGL:
70  *
71  * Since: 1.20
72  */
73 #define GST_TYPE_GL_MEMORY_EGL (gst_gl_memory_egl_get_type())
74 GST_GL_API
75 GType gst_gl_memory_egl_get_type(void);
76 
77 GST_GL_API
78 void          gst_gl_memory_egl_init_once               (void);
79 
80 GST_GL_API
81 gboolean      gst_is_gl_memory_egl                      (GstMemory * mem);
82 
83 GST_GL_API
84 gpointer      gst_gl_memory_egl_get_image               (GstGLMemoryEGL * mem);
85 
86 GST_GL_API
87 gpointer      gst_gl_memory_egl_get_display             (GstGLMemoryEGL * mem);
88 
89 /**
90  * GstGLMemoryEGLAllocator:
91  *
92  * Opaque #GstGLMemoryEGLAllocator struct
93  */
94 struct _GstGLMemoryEGLAllocator
95 {
96   /*< private >*/
97 
98   GstGLMemoryAllocator parent;
99 
100   gpointer _padding[GST_PADDING];
101 };
102 
103 /**
104  * GstGLMemoryEGLAllocatorClass:
105  *
106  * The #GstGLMemoryEGLAllocatorClass only contains private data
107  */
108 struct _GstGLMemoryEGLAllocatorClass
109 {
110   /*< private >*/
111   GstGLMemoryAllocatorClass parent_class;
112 
113   gpointer _padding[GST_PADDING];
114 };
115 
116 G_END_DECLS
117 
118 #endif /* _GST_GL_MEMORY_EGL_H_ */
119