| 1 | /* | 
| 2 |  * GStreamer | 
| 3 |  * Copyright (C) 2012 Matthew Waters <ystreet00@gmail.com> | 
| 4 |  * Copyright (C) 2015 Matthew Waters <matthew@centricular.com> | 
| 5 |  * | 
| 6 |  * This library is free software; you can redistribute it and/or | 
| 7 |  * modify it under the terms of the GNU Library General Public | 
| 8 |  * License as published by the Free Software Foundation; either | 
| 9 |  * version 2 of the License, or (at your option) any later version. | 
| 10 |  * | 
| 11 |  * This library is distributed in the hope that it will be useful, | 
| 12 |  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
| 13 |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | 
| 14 |  * Library General Public License for more details. | 
| 15 |  * | 
| 16 |  * You should have received a copy of the GNU Library General Public | 
| 17 |  * License along with this library; if not, write to the | 
| 18 |  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, | 
| 19 |  * Boston, MA 02110-1301, USA. | 
| 20 |  */ | 
| 21 |  | 
| 22 | #ifndef _GST_GL_MEMORY_PBO_H_ | 
| 23 | #define _GST_GL_MEMORY_PBO_H_ | 
| 24 |  | 
| 25 | #include <gst/gl/gstglmemory.h> | 
| 26 |  | 
| 27 | G_BEGIN_DECLS | 
| 28 |  | 
| 29 | #define GST_TYPE_GL_MEMORY_PBO_ALLOCATOR (gst_gl_memory_pbo_allocator_get_type()) | 
| 30 | GST_GL_API | 
| 31 | GType gst_gl_memory_pbo_allocator_get_type(void); | 
| 32 |  | 
| 33 | #define GST_IS_GL_MEMORY_PBO_ALLOCATOR(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GL_MEMORY_PBO_ALLOCATOR)) | 
| 34 | #define GST_IS_GL_MEMORY_PBO_ALLOCATOR_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_GL_MEMORY_PBO_ALLOCATOR)) | 
| 35 | #define GST_GL_MEMORY_PBO_ALLOCATOR_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_GL_MEMORY_PBO_ALLOCATOR, GstGLMemoryPBOAllocatorClass)) | 
| 36 | #define GST_GL_MEMORY_PBO_ALLOCATOR(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GL_MEMORY_PBO_ALLOCATOR, GstGLMemoryPBOAllocator)) | 
| 37 | #define GST_GL_MEMORY_PBO_ALLOCATOR_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GL_MEMORY_PBO_ALLOCATOR, GstGLMemoryPBOAllocatorClass)) | 
| 38 | #define GST_GL_MEMORY_PBO_ALLOCATOR_CAST(obj)            ((GstGLMemoryPBOAllocator *)(obj)) | 
| 39 |  | 
| 40 | /** | 
| 41 |  * GstGLMemoryPBO: | 
| 42 |  * | 
| 43 |  * Private instance | 
| 44 |  */ | 
| 45 | struct _GstGLMemoryPBO | 
| 46 | { | 
| 47 |   /*< private >*/ | 
| 48 |   GstGLMemory      mem; | 
| 49 |  | 
| 50 |   GstGLBuffer          *pbo; | 
| 51 |  | 
| 52 |   gpointer                  _padding[GST_PADDING]; | 
| 53 | }; | 
| 54 |  | 
| 55 | /** | 
| 56 |  * GST_GL_MEMORY_PBO_ALLOCATOR_NAME: | 
| 57 |  * | 
| 58 |  * The name of the GL Memory PBO allocator | 
| 59 |  */ | 
| 60 | #define GST_GL_MEMORY_PBO_ALLOCATOR_NAME   "GLMemoryPBO" | 
| 61 |  | 
| 62 | /** | 
| 63 |  * GST_TYPE_GL_MEMORY_PBO | 
| 64 |  * | 
| 65 |  * Since: 1.20 | 
| 66 |  */ | 
| 67 | #define GST_TYPE_GL_MEMORY_PBO (gst_gl_memory_pbo_get_type()) | 
| 68 | GST_GL_API | 
| 69 | GType gst_gl_memory_pbo_get_type(void); | 
| 70 |  | 
| 71 | GST_GL_API | 
| 72 | void          gst_gl_memory_pbo_init_once               (void); | 
| 73 | GST_GL_API | 
| 74 | gboolean      gst_is_gl_memory_pbo                      (GstMemory * mem); | 
| 75 |  | 
| 76 | GST_GL_API | 
| 77 | void          gst_gl_memory_pbo_download_transfer       (GstGLMemoryPBO * gl_mem); | 
| 78 | GST_GL_API | 
| 79 | void          gst_gl_memory_pbo_upload_transfer         (GstGLMemoryPBO * gl_mem); | 
| 80 |  | 
| 81 | GST_GL_API | 
| 82 | gboolean      gst_gl_memory_pbo_copy_into_texture       (GstGLMemoryPBO *gl_mem, | 
| 83 |                                                          guint tex_id, | 
| 84 |                                                          GstGLTextureTarget target, | 
| 85 |                                                          GstGLFormat tex_format, | 
| 86 |                                                          gint width, | 
| 87 |                                                          gint height, | 
| 88 |                                                          gint stride, | 
| 89 |                                                          gboolean respecify); | 
| 90 |  | 
| 91 | /** | 
| 92 |  * GstGLMemoryPBOAllocator: | 
| 93 |  * | 
| 94 |  * Opaque #GstGLMemoryPBOAllocator struct | 
| 95 |  */ | 
| 96 | struct _GstGLMemoryPBOAllocator | 
| 97 | { | 
| 98 |   GstGLMemoryAllocator parent; | 
| 99 |  | 
| 100 |   /*< private >*/ | 
| 101 |   gpointer             _padding[GST_PADDING]; | 
| 102 | }; | 
| 103 |  | 
| 104 | /** | 
| 105 |  * GstGLMemoryPBOAllocatorClass: | 
| 106 |  * | 
| 107 |  * Only contains private data | 
| 108 |  */ | 
| 109 | struct _GstGLMemoryPBOAllocatorClass | 
| 110 | { | 
| 111 |   GstGLMemoryAllocatorClass parent_class; | 
| 112 |  | 
| 113 |   /*< private >*/ | 
| 114 |   gpointer                  _padding[GST_PADDING]; | 
| 115 | }; | 
| 116 |  | 
| 117 | G_END_DECLS | 
| 118 |  | 
| 119 | #endif /* _GST_GL_MEMORY_PBO_H_ */ | 
| 120 |  |