| 1 | /* |
| 2 | * GStreamer |
| 3 | * Copyright (C) 2013 Matthew Waters <ystreet00@gmail.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 | #ifndef __GST_GL_FRAMEBUFFER_H__ |
| 22 | #define __GST_GL_FRAMEBUFFER_H__ |
| 23 | |
| 24 | #include <gst/gl/gstgl_fwd.h> |
| 25 | |
| 26 | G_BEGIN_DECLS |
| 27 | |
| 28 | GST_GL_API |
| 29 | GType gst_gl_framebuffer_get_type (void); |
| 30 | |
| 31 | #define GST_TYPE_GL_FRAMEBUFFER (gst_gl_framebuffer_get_type()) |
| 32 | #define GST_GL_FRAMEBUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_FRAMEBUFFER,GstGLFramebuffer)) |
| 33 | #define GST_GL_FRAMEBUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_GL_FRAMEBUFFER,GstGLFramebufferClass)) |
| 34 | #define GST_IS_GL_FRAMEBUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GL_FRAMEBUFFER)) |
| 35 | #define GST_IS_GL_FRAMEBUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_GL_FRAMEBUFFER)) |
| 36 | #define GST_GL_FRAMEBUFFER_CAST(obj) ((GstGLFramebuffer*)(obj)) |
| 37 | |
| 38 | typedef struct _GstGLFramebufferPrivate GstGLFramebufferPrivate; |
| 39 | |
| 40 | /** |
| 41 | * GstGLFramebufferFunc: |
| 42 | * @stuff: user data |
| 43 | * |
| 44 | * callback definition for operating through a #GstGLFramebuffer object |
| 45 | */ |
| 46 | typedef gboolean (*GstGLFramebufferFunc) (gpointer stuff); |
| 47 | |
| 48 | /** |
| 49 | * GstGLFramebuffer: |
| 50 | * |
| 51 | * Opaque #GstGLFramebuffer struct |
| 52 | */ |
| 53 | struct _GstGLFramebuffer |
| 54 | { |
| 55 | /*< private >*/ |
| 56 | GstObject object; |
| 57 | |
| 58 | GstGLContext *context; |
| 59 | |
| 60 | guint fbo_id; |
| 61 | GArray *attachments; |
| 62 | |
| 63 | gpointer _padding[GST_PADDING]; |
| 64 | |
| 65 | GstGLFramebufferPrivate *priv; |
| 66 | }; |
| 67 | |
| 68 | /** |
| 69 | * GstGLFramebufferClass: |
| 70 | * |
| 71 | * Opaque #GstGLFramebufferClass struct |
| 72 | */ |
| 73 | struct _GstGLFramebufferClass |
| 74 | { |
| 75 | /*< private >*/ |
| 76 | GstObjectClass object_class; |
| 77 | |
| 78 | gpointer _padding[GST_PADDING]; |
| 79 | }; |
| 80 | |
| 81 | GST_GL_API |
| 82 | GstGLFramebuffer * gst_gl_framebuffer_new (GstGLContext *context); |
| 83 | GST_GL_API |
| 84 | GstGLFramebuffer * gst_gl_framebuffer_new_with_default_depth (GstGLContext *context, |
| 85 | guint width, |
| 86 | guint height); |
| 87 | |
| 88 | GST_GL_API |
| 89 | guint gst_gl_framebuffer_get_id (GstGLFramebuffer * fb); |
| 90 | |
| 91 | GST_GL_API |
| 92 | void gst_gl_framebuffer_attach (GstGLFramebuffer * fb, |
| 93 | guint attachment_point, |
| 94 | GstGLBaseMemory * mem); |
| 95 | GST_GL_API |
| 96 | void gst_gl_framebuffer_bind (GstGLFramebuffer * fb); |
| 97 | GST_GL_API |
| 98 | void gst_gl_context_clear_framebuffer (GstGLContext * context); |
| 99 | |
| 100 | GST_GL_API |
| 101 | void gst_gl_framebuffer_get_effective_dimensions (GstGLFramebuffer * fb, |
| 102 | guint * width, |
| 103 | guint * height); |
| 104 | |
| 105 | GST_GL_API |
| 106 | gboolean gst_gl_context_check_framebuffer_status (GstGLContext * context, |
| 107 | guint fbo_target); |
| 108 | |
| 109 | GST_GL_API |
| 110 | gboolean gst_gl_framebuffer_draw_to_texture (GstGLFramebuffer * fb, |
| 111 | GstGLMemory * mem, |
| 112 | GstGLFramebufferFunc func, |
| 113 | gpointer user_data); |
| 114 | |
| 115 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstGLFramebuffer, gst_object_unref) |
| 116 | |
| 117 | G_END_DECLS |
| 118 | |
| 119 | #endif |
| 120 | |