2007-12-12 02:33:12 +00:00
|
|
|
|
2007-12-16 22:57:22 +00:00
|
|
|
#ifndef __GST_GL_H__
|
|
|
|
#define __GST_GL_H__
|
2007-12-12 02:33:12 +00:00
|
|
|
|
|
|
|
#include <GL/glx.h>
|
|
|
|
#include <GL/gl.h>
|
2007-12-16 22:57:22 +00:00
|
|
|
#include <gst/gst.h>
|
2007-12-24 20:53:56 +00:00
|
|
|
#include <gst/video/video.h>
|
2007-12-12 02:33:12 +00:00
|
|
|
|
2007-12-21 00:03:11 +00:00
|
|
|
typedef struct _GstGLDisplay GstGLDisplay;
|
|
|
|
typedef struct _GstGLDisplayClass GstGLDisplayClass;
|
|
|
|
|
|
|
|
#define GST_TYPE_GL_DISPLAY \
|
|
|
|
(gst_gl_display_get_type())
|
|
|
|
#define GST_GL_DISPLAY(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_DISPLAY,GstGLDisplay))
|
|
|
|
#define GST_GL_DISPLAY_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_GL_DISPLAY,GstGLDisplayClass))
|
|
|
|
#define GST_IS_GL_DISPLAY(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GL_DISPLAY))
|
|
|
|
#define GST_IS_GL_DISPLAY_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GL_DISPLAY))
|
|
|
|
|
2007-12-12 02:33:12 +00:00
|
|
|
|
2007-12-16 22:57:22 +00:00
|
|
|
struct _GstGLDisplay {
|
2007-12-21 00:03:11 +00:00
|
|
|
GObject object;
|
|
|
|
|
2007-12-12 02:33:12 +00:00
|
|
|
Display *display;
|
2007-12-21 00:03:11 +00:00
|
|
|
GC gc;
|
2007-12-12 02:33:12 +00:00
|
|
|
XVisualInfo *visinfo;
|
|
|
|
GLXContext context;
|
|
|
|
GMutex *lock;
|
|
|
|
|
|
|
|
Screen *screen;
|
2007-12-21 00:03:11 +00:00
|
|
|
int screen_num;
|
|
|
|
Visual *visual;
|
2007-12-12 02:33:12 +00:00
|
|
|
Window root;
|
2007-12-21 00:03:11 +00:00
|
|
|
guint32 white;
|
|
|
|
guint32 black;
|
|
|
|
int depth;
|
2007-12-12 02:33:12 +00:00
|
|
|
|
|
|
|
int max_texture_size;
|
|
|
|
|
|
|
|
gboolean have_ycbcr_texture;
|
2007-12-15 19:31:23 +00:00
|
|
|
gboolean have_texture_rectangle;
|
|
|
|
gboolean have_color_matrix;
|
2007-12-12 02:33:12 +00:00
|
|
|
|
|
|
|
Window window;
|
2008-01-06 01:19:48 +00:00
|
|
|
gboolean visible;
|
2007-12-29 00:37:41 +00:00
|
|
|
Window parent_window;
|
2007-12-12 02:33:12 +00:00
|
|
|
|
|
|
|
int win_width;
|
|
|
|
int win_height;
|
2007-12-21 00:03:11 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _GstGLDisplayClass {
|
|
|
|
GObjectClass object_class;
|
2007-12-12 02:33:12 +00:00
|
|
|
};
|
|
|
|
|
2007-12-21 00:03:11 +00:00
|
|
|
GType gst_gl_display_get_type (void);
|
|
|
|
|
2007-12-12 02:33:12 +00:00
|
|
|
|
2007-12-21 00:03:11 +00:00
|
|
|
GstGLDisplay *gst_gl_display_new (void);
|
|
|
|
gboolean gst_gl_display_connect (GstGLDisplay *display,
|
|
|
|
const char *display_name);
|
2007-12-16 22:57:22 +00:00
|
|
|
gboolean gst_gl_display_can_handle_type (GstGLDisplay *display,
|
2007-12-24 20:53:56 +00:00
|
|
|
GstVideoFormat type);
|
2007-12-18 01:25:58 +00:00
|
|
|
void gst_gl_display_lock (GstGLDisplay *display);
|
|
|
|
void gst_gl_display_unlock (GstGLDisplay *display);
|
2007-12-21 00:03:11 +00:00
|
|
|
void gst_gl_display_set_window (GstGLDisplay *display, Window window);
|
|
|
|
void gst_gl_display_update_attributes (GstGLDisplay *display);
|
|
|
|
void gst_gl_display_clear (GstGLDisplay *display);
|
2007-12-24 20:53:56 +00:00
|
|
|
void gst_gl_display_draw_texture (GstGLDisplay * display, GLuint texture,
|
2008-01-06 03:01:39 +00:00
|
|
|
int width, int height, gboolean sync);
|
2007-12-22 05:01:58 +00:00
|
|
|
void gst_gl_display_check_error (GstGLDisplay *display, int line);
|
2007-12-24 20:53:56 +00:00
|
|
|
GLuint gst_gl_display_upload_texture_rectangle (GstGLDisplay *display,
|
|
|
|
GstVideoFormat type, void *data, int width, int height);
|
2008-01-06 01:19:48 +00:00
|
|
|
void gst_gl_display_set_visible (GstGLDisplay *display, gboolean visible);
|
2008-01-06 03:01:39 +00:00
|
|
|
void gst_gl_display_set_window_size (GstGLDisplay *display, int width,
|
|
|
|
int height);
|
|
|
|
void gst_gl_display_update_window (GstGLDisplay * display);
|
2007-12-12 02:33:12 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|