2013-06-16 10:44:47 +00:00
|
|
|
/*
|
|
|
|
* GStreamer
|
|
|
|
* Copyright (C) 2013 Matthew Waters <ystreet00@gmail.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GST_GL_FRAMEBUFFER_H__
|
|
|
|
#define __GST_GL_FRAMEBUFFER_H__
|
|
|
|
|
2013-07-11 09:03:31 +00:00
|
|
|
#include <gst/gl/gstgl_fwd.h>
|
2013-06-16 10:44:47 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2016-10-27 02:47:58 +00:00
|
|
|
GST_EXPORT
|
2013-06-16 10:44:47 +00:00
|
|
|
GType gst_gl_framebuffer_get_type (void);
|
|
|
|
|
|
|
|
#define GST_TYPE_GL_FRAMEBUFFER (gst_gl_framebuffer_get_type())
|
|
|
|
#define GST_GL_FRAMEBUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_FRAMEBUFFER,GstGLFramebuffer))
|
|
|
|
#define GST_GL_FRAMEBUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_GL_FRAMEBUFFER,GstGLFramebufferClass))
|
|
|
|
#define GST_IS_GL_FRAMEBUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GL_FRAMEBUFFER))
|
|
|
|
#define GST_IS_GL_FRAMEBUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_GL_FRAMEBUFFER))
|
|
|
|
#define GST_GL_FRAMEBUFFER_CAST(obj) ((GstGLFramebuffer*)(obj))
|
|
|
|
|
|
|
|
typedef struct _GstGLFramebufferPrivate GstGLFramebufferPrivate;
|
|
|
|
|
2016-07-12 02:59:57 +00:00
|
|
|
/**
|
|
|
|
* GstGLFramebufferFunc:
|
2016-11-02 10:21:33 +00:00
|
|
|
* @stuff: user data
|
2016-07-12 02:59:57 +00:00
|
|
|
*
|
2016-11-02 10:21:33 +00:00
|
|
|
* callback definition for operating through a #GstGLFramebuffer object
|
2016-07-12 02:59:57 +00:00
|
|
|
*/
|
|
|
|
typedef gboolean (*GstGLFramebufferFunc) (gpointer stuff);
|
|
|
|
|
2016-11-02 10:21:33 +00:00
|
|
|
/**
|
|
|
|
* GstGLFramebuffer:
|
|
|
|
*
|
|
|
|
* Opaque #GstGLFramebuffer struct
|
|
|
|
*/
|
2013-06-16 10:44:47 +00:00
|
|
|
struct _GstGLFramebuffer
|
|
|
|
{
|
2016-11-02 10:21:33 +00:00
|
|
|
/* <private> */
|
2016-07-12 02:59:57 +00:00
|
|
|
GstObject object;
|
2013-06-16 10:44:47 +00:00
|
|
|
|
2013-09-15 04:23:43 +00:00
|
|
|
GstGLContext *context;
|
2013-06-16 10:44:47 +00:00
|
|
|
|
2016-07-12 02:59:57 +00:00
|
|
|
guint fbo_id;
|
|
|
|
GArray *attachments;
|
|
|
|
|
2016-09-28 05:20:25 +00:00
|
|
|
gpointer _padding[GST_PADDING];
|
|
|
|
|
2013-06-16 10:44:47 +00:00
|
|
|
GstGLFramebufferPrivate *priv;
|
|
|
|
};
|
|
|
|
|
2016-11-02 10:21:33 +00:00
|
|
|
/**
|
|
|
|
* GstGLFramebufferClass:
|
|
|
|
*
|
|
|
|
* Opaque #GstGLFramebufferClass struct
|
|
|
|
*/
|
2013-06-16 10:44:47 +00:00
|
|
|
struct _GstGLFramebufferClass
|
|
|
|
{
|
2016-11-02 10:21:33 +00:00
|
|
|
/* <private> */
|
2016-07-12 02:59:57 +00:00
|
|
|
GstObjectClass object_class;
|
2016-09-28 05:20:25 +00:00
|
|
|
|
|
|
|
gpointer _padding[GST_PADDING];
|
2013-06-16 10:44:47 +00:00
|
|
|
};
|
|
|
|
|
2016-10-27 02:47:58 +00:00
|
|
|
GST_EXPORT
|
2016-07-12 02:59:57 +00:00
|
|
|
GstGLFramebuffer * gst_gl_framebuffer_new (GstGLContext *context);
|
2016-10-27 02:47:58 +00:00
|
|
|
GST_EXPORT
|
2016-07-12 02:59:57 +00:00
|
|
|
GstGLFramebuffer * gst_gl_framebuffer_new_with_default_depth (GstGLContext *context,
|
|
|
|
guint width,
|
|
|
|
guint height);
|
|
|
|
|
2016-10-27 02:47:58 +00:00
|
|
|
GST_EXPORT
|
2016-07-12 02:59:57 +00:00
|
|
|
guint gst_gl_framebuffer_get_id (GstGLFramebuffer * fb);
|
|
|
|
|
2016-10-27 02:47:58 +00:00
|
|
|
GST_EXPORT
|
2016-07-12 02:59:57 +00:00
|
|
|
void gst_gl_framebuffer_attach (GstGLFramebuffer * fb,
|
|
|
|
guint attachment_point,
|
|
|
|
GstGLBaseMemory * mem);
|
2016-10-27 02:47:58 +00:00
|
|
|
GST_EXPORT
|
2016-07-12 02:59:57 +00:00
|
|
|
void gst_gl_framebuffer_bind (GstGLFramebuffer * fb);
|
2016-10-27 02:47:58 +00:00
|
|
|
GST_EXPORT
|
2016-07-12 02:59:57 +00:00
|
|
|
void gst_gl_context_clear_framebuffer (GstGLContext * context);
|
2013-06-16 10:44:47 +00:00
|
|
|
|
2016-10-27 02:47:58 +00:00
|
|
|
GST_EXPORT
|
2016-07-12 02:59:57 +00:00
|
|
|
void gst_gl_framebuffer_get_effective_dimensions (GstGLFramebuffer * fb,
|
|
|
|
guint * width,
|
|
|
|
guint * height);
|
2013-06-16 10:44:47 +00:00
|
|
|
|
2016-10-27 02:47:58 +00:00
|
|
|
GST_EXPORT
|
2017-05-25 02:09:04 +00:00
|
|
|
gboolean gst_gl_context_check_framebuffer_status (GstGLContext * context,
|
2017-07-07 15:15:12 +00:00
|
|
|
guint fbo_target);
|
2013-06-16 10:44:47 +00:00
|
|
|
|
2016-10-27 02:47:58 +00:00
|
|
|
GST_EXPORT
|
2016-07-12 02:59:57 +00:00
|
|
|
gboolean gst_gl_framebuffer_draw_to_texture (GstGLFramebuffer * fb,
|
|
|
|
GstGLMemory * mem,
|
2016-11-03 01:03:24 +00:00
|
|
|
GstGLFramebufferFunc func,
|
2016-07-12 02:59:57 +00:00
|
|
|
gpointer user_data);
|
2013-06-16 10:44:47 +00:00
|
|
|
|
2015-12-14 19:44:31 +00:00
|
|
|
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
|
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstGLFramebuffer, gst_object_unref)
|
|
|
|
#endif
|
|
|
|
|
2013-06-16 10:44:47 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif
|