diff options
Diffstat (limited to 'sys/glsink/gstglbuffer.h')
-rw-r--r-- | sys/glsink/gstglbuffer.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/sys/glsink/gstglbuffer.h b/sys/glsink/gstglbuffer.h new file mode 100644 index 00000000..969f2161 --- /dev/null +++ b/sys/glsink/gstglbuffer.h @@ -0,0 +1,47 @@ + +#ifndef _GST_GL_BUFFER_H_ +#define _GST_GL_BUFFER_H_ + +#include <gst/gst.h> +#include <gst/video/video.h> +#include <xcb/xcb.h> +#include <glvideo.h> + +typedef struct _GstGLBuffer GstGLBuffer; + +#define GST_TYPE_GL_BUFFER (gst_gl_buffer_get_type()) + +#define GST_IS_GL_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GL_BUFFER)) +#define GST_GL_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GL_BUFFER, GstGLBuffer)) + +typedef enum { + GST_GL_BUFFER_UNKNOWN, + GST_GL_BUFFER_XIMAGE, + GST_GL_BUFFER_RBO +} GstGLBufferType; + +struct _GstGLBuffer { + GstBuffer buffer; + + GstGLDisplay *display; + + GstGLBufferType type; + + XID pixmap; + GC gc; + + GLuint rbo; + + int width; + int height; +}; + +GType gst_gl_buffer_get_type (void); + +GstGLBuffer * gst_gl_buffer_new (GstGLDisplay *display, GstVideoFormat format, + int width, int height); +void gst_gl_buffer_upload (GstGLBuffer *buffer, void *data); +void gst_gl_buffer_download (GstGLBuffer *buffer, void *data); + +#endif + |