1 /*
2  * GStreamer
3  * Copyright (C) 2008 Filippo Argiolas <filippo.argiolas@gmail.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef _GST_GL_OVERLAY_H_
22 #define _GST_GL_OVERLAY_H_
23 
24 #include <gst/gl/gstglfilter.h>
25 #include <gst/gl/gstglfuncs.h>
26 
27 G_BEGIN_DECLS
28 
29 #define GST_TYPE_GL_OVERLAY            (gst_gl_overlay_get_type())
30 #define GST_GL_OVERLAY(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_GL_OVERLAY,GstGLOverlay))
31 #define GST_IS_GL_OVERLAY(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_GL_OVERLAY))
32 #define GST_GL_OVERLAY_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass) , GST_TYPE_GL_OVERLAY,GstGLOverlayClass))
33 #define GST_IS_GL_OVERLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) , GST_TYPE_GL_OVERLAY))
34 #define GST_GL_OVERLAY_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj) , GST_TYPE_GL_OVERLAY,GstGLOverlayClass))
35 
36 typedef struct _GstGLOverlay GstGLOverlay;
37 typedef struct _GstGLOverlayClass GstGLOverlayClass;
38 
39 struct _GstGLOverlay
40 {
41   GstGLFilter  filter;
42 
43   /* properties */
44   gchar        *location;
45   gint          offset_x;
46   gint          offset_y;
47 
48   gdouble       relative_x;
49   gdouble       relative_y;
50 
51   gint          overlay_width;
52   gint          overlay_height;
53 
54   gdouble       alpha;
55 
56   /* <private> */
57   GstGLShader  *shader;
58   GstGLMemory  *image_memory;
59 
60   gboolean      location_has_changed;
61   gint          window_width, window_height;
62   gint          image_width, image_height;
63 
64   gboolean      geometry_change;
65 
66   GLuint        vao;
67   GLuint        overlay_vao;
68   GLuint        vbo;
69   GLuint        overlay_vbo;
70   GLuint        vbo_indices;
71   GLuint        attr_position;
72   GLuint        attr_texture;
73 };
74 
75 struct _GstGLOverlayClass
76 {
77   GstGLFilterClass filter_class;
78 };
79 
80 GType gst_gl_overlay_get_type (void);
81 
82 G_END_DECLS
83 
84 #endif /* _GST_GL_OVERLAY_H_ */
85