2008-11-05 01:06:33 +00:00
|
|
|
/*
|
2008-10-22 23:40:52 +00:00
|
|
|
* GStreamer
|
|
|
|
* Copyright (C) 2008 Julien Isorce <julien.isorce@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., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GST_GL_WINDOW_H__
|
|
|
|
#define __GST_GL_WINDOW_H__
|
|
|
|
|
2009-03-15 13:48:19 +00:00
|
|
|
/* OpenGL 2.0 for Embedded Systems */
|
|
|
|
#ifdef OPENGL_ES2
|
|
|
|
#undef UNICODE
|
|
|
|
#include <EGL/egl.h>
|
|
|
|
#define UNICODE
|
|
|
|
#include <GLES2/gl2.h>
|
|
|
|
#include "gstgles2.h"
|
|
|
|
/* OpenGL for usual systems */
|
|
|
|
#else
|
2009-04-13 05:24:06 +00:00
|
|
|
#if __APPLE__
|
|
|
|
#include <GL/glew.h>
|
2009-02-26 00:06:58 +00:00
|
|
|
#include <OpenGL/OpenGL.h>
|
|
|
|
#include <OpenGL/gl.h>
|
|
|
|
#else
|
2008-10-22 23:40:52 +00:00
|
|
|
#include <GL/glew.h>
|
|
|
|
#include <GL/gl.h>
|
2009-02-26 00:06:58 +00:00
|
|
|
#endif
|
2009-03-15 13:48:19 +00:00
|
|
|
#endif
|
2009-02-26 00:06:58 +00:00
|
|
|
|
2008-10-22 23:40:52 +00:00
|
|
|
#include <gst/gst.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
#define GST_GL_TYPE_WINDOW (gst_gl_window_get_type())
|
|
|
|
#define GST_GL_WINDOW(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_GL_TYPE_WINDOW, GstGLWindow))
|
|
|
|
#define GST_GL_WINDOW_CLASS(k) (G_TYPE_CHECK_CLASS((k), GST_GL_TYPE_WINDOW, GstGLWindowClass))
|
|
|
|
#define GST_GL_IS_WINDOW(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_GL_TYPE_WINDOW))
|
|
|
|
#define GST_GL_IS_WINDOW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), GST_GL_TYPE_WINDOW))
|
|
|
|
#define GST_GL_WINDOW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_GL_TYPE_WINDOW, GstGLWindowClass))
|
|
|
|
|
|
|
|
#define GST_GL_WINDOW_ERROR (gst_gl_window_error_quark ())
|
|
|
|
|
|
|
|
typedef void (* GstGLWindowCB) ( gpointer );
|
|
|
|
typedef void (* GstGLWindowCB2) ( gpointer, gint, gint );
|
|
|
|
|
2008-11-05 01:06:33 +00:00
|
|
|
#define GST_GL_WINDOW_CB(f) ((GstGLWindowCB) (f))
|
|
|
|
#define GST_GL_WINDOW_CB2(f) ((GstGLWindowCB2) (f))
|
|
|
|
|
2008-10-22 23:40:52 +00:00
|
|
|
typedef struct _GstGLWindow GstGLWindow;
|
|
|
|
typedef struct _GstGLWindowPrivate GstGLWindowPrivate;
|
|
|
|
typedef struct _GstGLWindowClass GstGLWindowClass;
|
|
|
|
|
|
|
|
struct _GstGLWindow {
|
|
|
|
/*< private >*/
|
|
|
|
GObject parent;
|
|
|
|
GstGLWindowPrivate *priv;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _GstGLWindowClass {
|
|
|
|
/*< private >*/
|
|
|
|
GObjectClass parent_class;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* methods */
|
|
|
|
|
|
|
|
GQuark gst_gl_window_error_quark (void);
|
|
|
|
GType gst_gl_window_get_type (void);
|
|
|
|
|
2012-05-20 15:45:06 +00:00
|
|
|
GstGLWindow * gst_gl_window_new (guintptr external_gl_context);
|
2009-10-22 23:11:27 +00:00
|
|
|
|
2012-05-20 15:45:06 +00:00
|
|
|
guintptr gst_gl_window_get_internal_gl_context (GstGLWindow *window);
|
2009-10-22 23:11:27 +00:00
|
|
|
void gst_gl_window_activate_gl_context (GstGLWindow *window, gboolean activate);
|
2008-10-22 23:40:52 +00:00
|
|
|
|
2012-05-20 15:45:06 +00:00
|
|
|
void gst_gl_window_set_external_window_id (GstGLWindow *window, guintptr id);
|
2008-10-22 23:40:52 +00:00
|
|
|
void gst_gl_window_set_draw_callback (GstGLWindow *window, GstGLWindowCB callback, gpointer data);
|
|
|
|
void gst_gl_window_set_resize_callback (GstGLWindow *window, GstGLWindowCB2 callback, gpointer data);
|
|
|
|
void gst_gl_window_set_close_callback (GstGLWindow *window, GstGLWindowCB callback, gpointer data);
|
|
|
|
|
2009-10-22 23:11:27 +00:00
|
|
|
void gst_gl_window_draw_unlocked (GstGLWindow *window, gint width, gint height);
|
|
|
|
void gst_gl_window_draw (GstGLWindow *window, gint width, gint height);
|
2008-10-22 23:40:52 +00:00
|
|
|
void gst_gl_window_run_loop (GstGLWindow *window);
|
2008-11-21 18:11:11 +00:00
|
|
|
void gst_gl_window_quit_loop (GstGLWindow *window, GstGLWindowCB callback, gpointer data);
|
2008-10-22 23:40:52 +00:00
|
|
|
|
|
|
|
void gst_gl_window_send_message (GstGLWindow *window, GstGLWindowCB callback, gpointer data);
|
|
|
|
|
2010-01-05 23:13:46 +00:00
|
|
|
/* helper */
|
|
|
|
void gst_gl_window_init_platform ();
|
|
|
|
|
2008-10-22 23:40:52 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GST_GL_WINDOW_H__ */
|