1/*
2 * GStreamer
3 * Copyright (C) 2009 Julien Isorce <julien.isorce@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_MIXER_H__
22#define __GST_GL_MIXER_H__
23
24#include <gst/gst.h>
25#include <gst/video/video.h>
26#include <gst/gl/gstglbasemixer.h>
27
28G_BEGIN_DECLS
29
30typedef struct _GstGLMixer GstGLMixer;
31typedef struct _GstGLMixerClass GstGLMixerClass;
32typedef struct _GstGLMixerPrivate GstGLMixerPrivate;
33
34#define GST_TYPE_GL_MIXER_PAD (gst_gl_mixer_pad_get_type())
35#define GST_GL_MIXER_PAD(obj) \
36 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_MIXER_PAD, GstGLMixerPad))
37#define GST_GL_MIXER_PAD_CLASS(klass) \
38 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_GL_MIXER_PAD, GstGLMixerPadClass))
39#define GST_IS_GL_MIXER_PAD(obj) \
40 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GL_MIXER_PAD))
41#define GST_IS_GL_MIXER_PAD_CLASS(klass) \
42 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GL_MIXER_PAD))
43#define GST_GL_MIXER_PAD_GET_CLASS(obj) \
44 (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_GL_MIXER_PAD,GstGLMixerPadClass))
45
46typedef struct _GstGLMixerPad GstGLMixerPad;
47typedef struct _GstGLMixerPadClass GstGLMixerPadClass;
48
49/**
50 * GstGLMixerPad:
51 *
52 * Since: 1.24
53 */
54struct _GstGLMixerPad
55{
56 /**
57 * GstGLMixerPad.parent:
58 *
59 * parent #GstGLBaseMixerPad
60 *
61 * Since: 1.24
62 */
63 GstGLBaseMixerPad parent;
64
65 /**
66 * GstGLMixerPad.current_texture:
67 *
68 * the current input texture for this pad
69 *
70 * Since: 1.24
71 */
72 guint current_texture;
73
74 /*< private >*/
75 gpointer _padding[GST_PADDING];
76};
77
78/**
79 * GstGLMixerPadClass:
80 *
81 * Since: 1.24
82 */
83struct _GstGLMixerPadClass
84{
85 /**
86 * GstGLMixerPadClass.parent_class:
87 *
88 * parent #GstGLBaseMixerPadClass
89 *
90 * Since: 1.24
91 */
92 GstGLBaseMixerPadClass parent_class;
93
94 /*< private >*/
95 gpointer _padding[GST_PADDING];
96};
97
98G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstGLMixerPad, gst_object_unref);
99
100GST_GL_API
101GType gst_gl_mixer_pad_get_type (void);
102
103#define GST_TYPE_GL_MIXER (gst_gl_mixer_get_type())
104#define GST_GL_MIXER(obj) \
105 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_MIXER, GstGLMixer))
106#define GST_GL_MIXER_CLASS(klass) \
107 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_GL_MIXER, GstGLMixerClass))
108#define GST_IS_GL_MIXER(obj) \
109 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GL_MIXER))
110#define GST_IS_GL_MIXER_CLASS(klass) \
111 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GL_MIXER))
112#define GST_GL_MIXER_GET_CLASS(obj) \
113 (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_GL_MIXER,GstGLMixerClass))
114
115/**
116 * GstGLMixer:
117 *
118 * Since: 1.24
119 */
120struct _GstGLMixer
121{
122 /**
123 * GstGLMixer.parent:
124 *
125 * Since: 1.24
126 */
127 GstGLBaseMixer parent;
128
129 /**
130 * GstGLMixer.out_caps:
131 *
132 * the configured output #GstCaps
133 *
134 * Since: 1.24
135 */
136 GstCaps *out_caps;
137
138 /*< private >*/
139 GstGLMixerPrivate *priv;
140
141 /*< private >*/
142 gpointer _padding[GST_PADDING];
143};
144
145/**
146 * GstGLMixerClass:
147 *
148 * Since: 1.24
149 */
150struct _GstGLMixerClass
151{
152 /**
153 * GstGLMixerClass.parent_class:
154 *
155 * Since: 1.24
156 */
157 GstGLBaseMixerClass parent_class;
158
159 /**
160 * GstGLMixerClass::process_buffers:
161 *
162 * Perform operations on the input buffers to produce an
163 * output buffer.
164 *
165 * Since: 1.24
166 */
167 gboolean (*process_buffers) (GstGLMixer * mix, GstBuffer *outbuf);
168 /**
169 * GstGLMixerClass::process_textures:
170 *
171 * perform operations with the input and output buffers mapped
172 * as textures. Will not be called if @process_buffers is overriden.
173 *
174 * Since: 1.24
175 */
176 gboolean (*process_textures) (GstGLMixer * mix, GstGLMemory *out_tex);
177
178 /*< private >*/
179 gpointer _padding[GST_PADDING];
180};
181
182G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstGLMixer, gst_object_unref);
183
184GST_GL_API
185GType gst_gl_mixer_get_type(void);
186
187GST_GL_API
188void gst_gl_mixer_class_add_rgba_pad_templates (GstGLMixerClass * klass);
189
190GST_GL_API
191gboolean gst_gl_mixer_process_textures (GstGLMixer * mix, GstBuffer * outbuf);
192
193GST_GL_API
194GstGLFramebuffer * gst_gl_mixer_get_framebuffer (GstGLMixer * mix);
195
196G_END_DECLS
197#endif /* __GST_GL_MIXER_H__ */
198

source code of include/gstreamer-1.0/gst/gl/gstglmixer.h