• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_BASE_MIXER_H__
22 #define __GST_GL_BASE_MIXER_H__
23 
24 #include <gst/gst.h>
25 #include <gst/video/video.h>
26 #include <gst/gl/gl.h>
27 #include <gst/video/gstvideoaggregator.h>
28 
29 G_BEGIN_DECLS
30 
31 #define GST_TYPE_GL_BASE_MIXER_PAD (gst_gl_base_mixer_pad_get_type())
32 #define GST_GL_BASE_MIXER_PAD(obj) \
33         (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_BASE_MIXER_PAD, GstGLBaseMixerPad))
34 #define GST_GL_BASE_MIXER_PAD_CLASS(klass) \
35         (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_GL_BASE_MIXER_PAD, GstGLBaseMixerPadClass))
36 #define GST_IS_GL_BASE_MIXER_PAD(obj) \
37         (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GL_BASE_MIXER_PAD))
38 #define GST_IS_GL_BASE_MIXER_PAD_CLASS(klass) \
39         (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GL_BASE_MIXER_PAD))
40 #define GST_GL_BASE_MIXER_PAD_GET_CLASS(obj) \
41         (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_GL_BASE_MIXER_PAD,GstGLBaseMixerPadClass))
42 
43 typedef struct _GstGLBaseMixerPad GstGLBaseMixerPad;
44 typedef struct _GstGLBaseMixerPadClass GstGLBaseMixerPadClass;
45 
46 /* all information needed for one video stream */
47 struct _GstGLBaseMixerPad
48 {
49   GstVideoAggregatorPad parent;                /* subclass the pad */
50 };
51 
52 struct _GstGLBaseMixerPadClass
53 {
54   GstVideoAggregatorPadClass parent_class;
55 };
56 
57 GType gst_gl_base_mixer_pad_get_type (void);
58 
59 #define GST_TYPE_GL_BASE_MIXER (gst_gl_base_mixer_get_type())
60 #define GST_GL_BASE_MIXER(obj) \
61         (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_BASE_MIXER, GstGLBaseMixer))
62 #define GST_GL_BASE_MIXER_CLASS(klass) \
63         (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_GL_BASE_MIXER, GstGLBaseMixerClass))
64 #define GST_IS_GL_BASE_MIXER(obj) \
65         (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GL_BASE_MIXER))
66 #define GST_IS_GL_BASE_MIXER_CLASS(klass) \
67         (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GL_BASE_MIXER))
68 #define GST_GL_BASE_MIXER_GET_CLASS(obj) \
69         (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_GL_BASE_MIXER,GstGLBaseMixerClass))
70 
71 typedef struct _GstGLBaseMixer GstGLBaseMixer;
72 typedef struct _GstGLBaseMixerClass GstGLBaseMixerClass;
73 typedef struct _GstGLBaseMixerPrivate GstGLBaseMixerPrivate;
74 
75 struct _GstGLBaseMixer
76 {
77   GstVideoAggregator     vaggregator;
78 
79   GstGLDisplay          *display;
80   GstGLContext          *context;
81 
82   gpointer _padding[GST_PADDING];
83 
84   GstGLBaseMixerPrivate *priv;
85 };
86 
87 struct _GstGLBaseMixerClass
88 {
89   GstVideoAggregatorClass parent_class;
90   GstGLAPI supported_gl_api;
91 
92   gboolean      (*gl_start)     (GstGLBaseMixer * mix);
93   void          (*gl_stop)      (GstGLBaseMixer * mix);
94 
95   gpointer _padding[GST_PADDING];
96 };
97 
98 GType gst_gl_base_mixer_get_type(void);
99 
100 GstGLContext *      gst_gl_base_mixer_get_gl_context        (GstGLBaseMixer * mix);
101 
102 G_END_DECLS
103 #endif /* __GST_GL_BASE_MIXER_H__ */
104