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 
30 G_BEGIN_DECLS
31 
32 GST_GL_API
33 GType 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  */
50 struct _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  *
74  * The base class for GStreamer GL Filter.
75  */
76 struct _GstGLBaseFilterClass
77 {
78   GstBaseTransformClass parent_class;
79 
80   /*< public >*/
81   GstGLAPI supported_gl_api;
82 
83   gboolean (*gl_start)          (GstGLBaseFilter *filter);
84   void     (*gl_stop)           (GstGLBaseFilter *filter);
85   gboolean (*gl_set_caps)       (GstGLBaseFilter *filter, GstCaps * incaps, GstCaps * outcaps);
86 
87   /*< private >*/
88   gpointer _padding[GST_PADDING];
89 };
90 
91 GST_GL_API
92 gboolean        gst_gl_base_filter_find_gl_context          (GstGLBaseFilter * filter);
93 
94 G_END_DECLS
95 
96 #endif /* _GST_GL_BASE_FILTER_H_ */
97