[047/906] * sys/glsink/gltestsrc.c: * sys/glsink/gstglbuffer.c: * sys/glsink/gstglbuf...
[platform/upstream/gstreamer.git] / gst-libs / gst / gl / gstglbuffer.h
1
2 #ifndef _GST_GL_BUFFER_H_
3 #define _GST_GL_BUFFER_H_
4
5 #include <gst/gst.h>
6 #include <gst/video/video.h>
7 #include <gstgldisplay.h>
8
9 typedef struct _GstGLBuffer GstGLBuffer;
10
11 #define GST_TYPE_GL_BUFFER (gst_gl_buffer_get_type())
12
13 #define GST_IS_GL_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GL_BUFFER))
14 #define GST_GL_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GL_BUFFER, GstGLBuffer))
15
16 typedef enum {
17   GST_GL_BUFFER_FORMAT_RGBA,
18   GST_GL_BUFFER_FORMAT_RGB,
19   GST_GL_BUFFER_FORMAT_YUYV,
20   GST_GL_BUFFER_FORMAT_PLANAR444,
21   GST_GL_BUFFER_FORMAT_PLANAR422,
22   GST_GL_BUFFER_FORMAT_PLANAR420
23 } GstGLBufferFormat;
24
25 struct _GstGLBuffer {
26   GstBuffer buffer;
27
28   GstGLDisplay *display;
29
30   GstGLBufferFormat format;
31   gboolean is_yuv;
32
33   GLuint texture;
34   GLuint texture_u;
35   GLuint texture_v;
36
37   int width;
38   int height;
39 };
40
41 GType gst_gl_buffer_get_type (void);
42
43 GstGLBuffer * gst_gl_buffer_new (GstGLDisplay *display,
44     GstGLBufferFormat format, int width, int height);
45 GstGLBuffer * gst_gl_buffer_new_from_data (GstGLDisplay *display,
46     GstVideoFormat format, int width, int height, void *data);
47 void gst_gl_buffer_download (GstGLBuffer *buffer, GstVideoFormat format,
48     void *data);
49
50
51 #define GST_GL_VIDEO_CAPS \
52   "video/x-raw-gl," \
53   "format=(int)[0,10]," \
54   "width=(int)[1,2048]," \
55   "height=(int)[1,2048]," \
56   "pixel-aspect-ratio=(fraction)1/1," \
57   "framerate=(fraction)[0/1,100/1]"
58
59
60 #endif
61