1/*
2 * GStreamer
3 * Copyright (C) 2007 David Schleef <ds@schleef.org>
4 * Copyright (C) 2008 Julien Isorce <julien.isorce@gmail.com>
5 * Copyright (C) 2008 Filippo Argiolas <filippo.argiolas@gmail.com>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
16 *
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21 */
22
23#ifndef _GST_GL_BASE_FILTER_H_
24#define _GST_GL_BASE_FILTER_H_
25
26#include <gst/base/gstbasetransform.h>
27
28#include <gst/gl/gstgl_fwd.h>
29
30G_BEGIN_DECLS
31
32GST_GL_API
33GType gst_gl_base_filter_get_type(void);
34#define GST_TYPE_GL_BASE_FILTER (gst_gl_base_filter_get_type())
35#define GST_GL_BASE_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_BASE_FILTER,GstGLBaseFilter))
36#define GST_IS_GL_BASE_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GL_BASE_FILTER))
37#define GST_GL_BASE_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_GL_BASE_FILTER,GstGLBaseFilterClass))
38#define GST_IS_GL_BASE_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_GL_BASE_FILTER))
39#define GST_GL_BASE_FILTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_GL_BASE_FILTER,GstGLBaseFilterClass))
40
41/**
42 * GstGLBaseFilter:
43 * @display: the currently configured #GstGLDisplay
44 * @context: the currently configured #GstGLContext
45 * @in_caps: the currently configured input #GstCaps
46 * @out_caps: the currently configured output #GstCaps
47 *
48 * The parent instance type of a base GStreamer GL Filter.
49 */
50struct _GstGLBaseFilter
51{
52 GstBaseTransform parent;
53
54 /*< public >*/
55 GstGLDisplay *display;
56 GstGLContext *context;
57
58 GstCaps *in_caps;
59 GstCaps *out_caps;
60
61 /*< private >*/
62 gpointer _padding[GST_PADDING];
63
64 GstGLBaseFilterPrivate *priv;
65};
66
67/**
68 * GstGLBaseFilterClass:
69 * @supported_gl_api: the logical-OR of #GstGLAPI's supported by this element
70 * @gl_start: called in the GL thread to setup the element GL state.
71 * @gl_stop: called in the GL thread to setup the element GL state.
72 * @gl_set_caps: called in the GL thread when caps are set on @filter.
73 * Note: this will also be called when changing OpenGL contexts
74 * where #GstBaseTransform::set_caps may not.
75 *
76 * The base class for GStreamer GL Filter.
77 */
78struct _GstGLBaseFilterClass
79{
80 GstBaseTransformClass parent_class;
81
82 /*< public >*/
83 GstGLAPI supported_gl_api;
84
85 gboolean (*gl_start) (GstGLBaseFilter *filter);
86 void (*gl_stop) (GstGLBaseFilter *filter);
87 gboolean (*gl_set_caps) (GstGLBaseFilter *filter, GstCaps * incaps, GstCaps * outcaps);
88
89 /*< private >*/
90 gpointer _padding[GST_PADDING];
91};
92
93GST_GL_API
94gboolean gst_gl_base_filter_find_gl_context (GstGLBaseFilter * filter);
95GST_GL_API
96GstGLContext * gst_gl_base_filter_get_gl_context (GstGLBaseFilter * filter);
97
98G_END_DECLS
99
100#endif /* _GST_GL_BASE_FILTER_H_ */
101

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