diff options
author | David Schleef <ds@schleef.org> | 2007-12-12 02:33:12 +0000 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2007-12-12 02:33:12 +0000 |
commit | ddea6c306e8e4f59829afe1fb92ec7ed4d567890 (patch) | |
tree | d66ea414f26dda94dfae8db1f359cc25d18c8a70 /sys/glsink/glvideo.h | |
parent | a1ced2746d972aa541d906238102987f7d6a7798 (diff) | |
download | gst-plugins-bad-ddea6c306e8e4f59829afe1fb92ec7ed4d567890.tar.gz gst-plugins-bad-ddea6c306e8e4f59829afe1fb92ec7ed4d567890.tar.bz2 gst-plugins-bad-ddea6c306e8e4f59829afe1fb92ec7ed4d567890.zip |
sys/glsink/: Split out gl-related code into a separate file with a sensible API. Major cleanup. Still crashes occas...
Original commit message from CVS:
* sys/glsink/Makefile.am:
* sys/glsink/glimagesink.c:
* sys/glsink/glvideo.c:
* sys/glsink/glvideo.h:
Split out gl-related code into a separate file with a
sensible API. Major cleanup. Still crashes occasionally
due to different threads touching bits at the same time.
Diffstat (limited to 'sys/glsink/glvideo.h')
-rw-r--r-- | sys/glsink/glvideo.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/sys/glsink/glvideo.h b/sys/glsink/glvideo.h new file mode 100644 index 00000000..7e2f6b13 --- /dev/null +++ b/sys/glsink/glvideo.h @@ -0,0 +1,64 @@ + +#ifndef __GLVIDEO_H__ +#define __GLVIDEO_H__ + +#include <GL/glx.h> +#include <GL/gl.h> +#include <glib.h> + +typedef struct _GLVideoDisplay GLVideoDisplay; +typedef struct _GLVideoDrawable GLVideoDrawable; + +typedef enum { + GLVIDEO_IMAGE_TYPE_RGBA, + GLVIDEO_IMAGE_TYPE_BGRA, + GLVIDEO_IMAGE_TYPE_YUY2, + GLVIDEO_IMAGE_TYPE_UYVY, +} GLVideoImageType; + + +struct _GLVideoDisplay { + Display *display; + XVisualInfo *visinfo; + GLXContext context; + GMutex *lock; + + Screen *screen; + int scrnum; + Window root; + + int max_texture_size; + + gboolean have_ycbcr_texture; +}; + +struct _GLVideoDrawable { + GLVideoDisplay *display; + + Window window; + + gboolean destroy_on_free; + + int win_width; + int win_height; +}; + + +GLVideoDisplay *glv_display_new (const char *display_name); +void glv_display_free (GLVideoDisplay *display); + +/* drawable */ + +GLVideoDrawable * glv_drawable_new_window (GLVideoDisplay *display); +GLVideoDrawable * glv_drawable_new_root_window (GLVideoDisplay *display); +GLVideoDrawable * glv_drawable_new_from_window (GLVideoDisplay *display, Window window); +void glv_drawable_free (GLVideoDrawable *drawable); +void glv_drawable_lock (GLVideoDrawable *drawable); +void glv_drawable_unlock (GLVideoDrawable *drawable); +void glv_drawable_update_attributes (GLVideoDrawable *drawable); +void glv_drawable_clear (GLVideoDrawable *drawable); +void glv_drawable_draw_image (GLVideoDrawable *drawable, GLVideoImageType type, void *data, int width, int height); + + +#endif + |