2007-12-21 00:03:10 +00:00
|
|
|
|
|
|
|
#ifndef _GST_GL_BUFFER_H_
|
|
|
|
#define _GST_GL_BUFFER_H_
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
|
|
|
#include <gst/video/video.h>
|
2007-12-24 21:04:45 +00:00
|
|
|
#include <gstgldisplay.h>
|
2007-12-21 00:03:10 +00:00
|
|
|
|
|
|
|
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 {
|
2007-12-27 00:52:22 +00:00
|
|
|
GST_GL_BUFFER_FORMAT_RGBA,
|
|
|
|
GST_GL_BUFFER_FORMAT_RGB,
|
|
|
|
GST_GL_BUFFER_FORMAT_YUYV,
|
|
|
|
GST_GL_BUFFER_FORMAT_PLANAR444,
|
|
|
|
GST_GL_BUFFER_FORMAT_PLANAR422,
|
|
|
|
GST_GL_BUFFER_FORMAT_PLANAR420
|
|
|
|
} GstGLBufferFormat;
|
2007-12-21 00:03:10 +00:00
|
|
|
|
|
|
|
struct _GstGLBuffer {
|
|
|
|
GstBuffer buffer;
|
|
|
|
|
|
|
|
GstGLDisplay *display;
|
|
|
|
|
2007-12-27 00:52:22 +00:00
|
|
|
GstGLBufferFormat format;
|
|
|
|
gboolean is_yuv;
|
2007-12-21 00:03:10 +00:00
|
|
|
|
2007-12-24 20:53:55 +00:00
|
|
|
GLuint texture;
|
2007-12-27 00:52:22 +00:00
|
|
|
GLuint texture_u;
|
|
|
|
GLuint texture_v;
|
2007-12-21 00:03:10 +00:00
|
|
|
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
};
|
|
|
|
|
|
|
|
GType gst_gl_buffer_get_type (void);
|
|
|
|
|
2007-12-27 00:52:22 +00:00
|
|
|
GstGLBuffer * gst_gl_buffer_new (GstGLDisplay *display,
|
|
|
|
GstGLBufferFormat format, int width, int height);
|
|
|
|
GstGLBuffer * gst_gl_buffer_new_from_data (GstGLDisplay *display,
|
|
|
|
GstVideoFormat format, int width, int height, void *data);
|
2007-12-21 00:03:10 +00:00
|
|
|
void gst_gl_buffer_download (GstGLBuffer *buffer, void *data);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|