• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * GStreamer
3  * Copyright (C) 2020 Matthew Waters <matthew@centricular.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_CONTEXT_CONFIG_H__
22 #define __GST_GL_CONTEXT_CONFIG_H__
23 
24 #include <gst/gst.h>
25 
26 #include <gst/gl/gstgl_fwd.h>
27 
28 G_BEGIN_DECLS
29 
30 /**
31  * GST_GL_CONFIG_STRUCTURE_NAME:
32  *
33  * The canonical name of a #GstStructure that contains a configuration for a
34  * #GstGLContext.
35  *
36  * Since: 1.20
37  */
38 #define GST_GL_CONFIG_STRUCTURE_NAME "gst-gl-context-config"
39 
40 /**
41  * GST_GL_CONFIG_ATTRIB_NAME:
42  *
43  * Get a reference to the variable name of a particular configuration field.
44  *
45  * e.g. for `CONFIG_ID`: `GST_GL_CONFIG_ATTRIB_NAME (CONFIG_ID)`
46  *
47  * Since: 1.20
48  */
49 #define GST_GL_CONFIG_ATTRIB_NAME(UPPER_NAME) \
50   G_PASTE(G_PASTE(GST_GL_CONFIG_ATTRIB_,UPPER_NAME),_NAME)
51 /**
52  * GST_GL_CONFIG_ATTRIB_GTYPE:
53  *
54  * Get a reference to the #GType of a particular configuration field.
55  *
56  * e.g. for `CONFIG_ID`: `GST_GL_CONFIG_ATTRIB_GTYPE (CONFIG_ID)`
57  *
58  * Since: 1.20
59  */
60 #define GST_GL_CONFIG_ATTRIB_GTYPE(UPPER_NAME) \
61   G_PASTE(G_PASTE(GST_GL_CONFIG_ATTRIB_,UPPER_NAME),_GTYPE)
62 
63 GST_GL_API const char * GST_GL_CONFIG_ATTRIB_CONFIG_ID_NAME;
64 #define GST_GL_CONFIG_ATTRIB_CONFIG_ID_GTYPE G_TYPE_UINT
65 GST_GL_API const char * GST_GL_CONFIG_ATTRIB_PLATFORM_NAME;
66 #define GST_GL_CONFIG_ATTRIB_PLATFORM_GTYPE GST_TYPE_GL_PLATFORM
67 GST_GL_API const char * GST_GL_CONFIG_ATTRIB_CAVEAT_NAME;
68 #define GST_GL_CONFIG_ATTRIB_CAVEAT_GTYPE GST_TYPE_GL_CONFIG_CAVEAT
69 GST_GL_API const char * GST_GL_CONFIG_ATTRIB_SURFACE_TYPE_NAME;
70 #define GST_GL_CONFIG_ATTRIB_SURFACE_TYPE_GTYPE GST_TYPE_GL_CONFIG_SURFACE_TYPE
71 GST_GL_API const char * GST_GL_CONFIG_ATTRIB_CONFORMANT_API_NAME;
72 #define GST_GL_CONFIG_ATTRIB_CONFORMANT_API_GTYPE GST_TYPE_GL_API
73 GST_GL_API const char * GST_GL_CONFIG_ATTRIB_RENDERABLE_API_NAME;
74 #define GST_GL_CONFIG_ATTRIB_RENDERABLE_API_GTYPE GST_TYPE_GL_API
75 GST_GL_API const char * GST_GL_CONFIG_ATTRIB_RED_SIZE_NAME;
76 #define GST_GL_CONFIG_ATTRIB_RED_SIZE_GTYPE G_TYPE_INT
77 GST_GL_API const char * GST_GL_CONFIG_ATTRIB_GREEN_SIZE_NAME;
78 #define GST_GL_CONFIG_ATTRIB_GREEN_SIZE_GTYPE G_TYPE_INT
79 GST_GL_API const char * GST_GL_CONFIG_ATTRIB_BLUE_SIZE_NAME;
80 #define GST_GL_CONFIG_ATTRIB_BLUE_SIZE_GTYPE G_TYPE_INT
81 GST_GL_API const char * GST_GL_CONFIG_ATTRIB_ALPHA_SIZE_NAME;
82 #define GST_GL_CONFIG_ATTRIB_ALPHA_SIZE_GTYPE G_TYPE_INT
83 GST_GL_API const char * GST_GL_CONFIG_ATTRIB_LUMINANCE_SIZE_NAME;
84 #define GST_GL_CONFIG_ATTRIB_LUMINANCE_SIZE_GTYPE G_TYPE_INT
85 GST_GL_API const char * GST_GL_CONFIG_ATTRIB_DEPTH_SIZE_NAME;
86 #define GST_GL_CONFIG_ATTRIB_DEPTH_SIZE_GTYPE G_TYPE_INT
87 GST_GL_API const char * GST_GL_CONFIG_ATTRIB_STENCIL_SIZE_NAME;
88 #define GST_GL_CONFIG_ATTRIB_STENCIL_SIZE_GTYPE G_TYPE_INT
89 GST_GL_API const char * GST_GL_CONFIG_ATTRIB_MAX_PBUFFER_WIDTH_NAME;
90 #define GST_GL_CONFIG_ATTRIB_MAX_PBUFFER_WIDTH_GTYPE G_TYPE_INT
91 GST_GL_API const char * GST_GL_CONFIG_ATTRIB_MAX_PBUFFER_HEIGHT_NAME;
92 #define GST_GL_CONFIG_ATTRIB_MAX_PBUFFER_HEIGHT_GTYPE G_TYPE_INT
93 GST_GL_API const char * GST_GL_CONFIG_ATTRIB_MAX_PBUFFER_PIXELS_NAME;
94 #define GST_GL_CONFIG_ATTRIB_MAX_PBUFFER_PIXELS_GTYPE G_TYPE_INT
95 GST_GL_API const char * GST_GL_CONFIG_ATTRIB_SAMPLE_BUFFERS_NAME;
96 #define GST_GL_CONFIG_ATTRIB_SAMPLE_BUFFERS_GTYPE G_TYPE_INT
97 GST_GL_API const char * GST_GL_CONFIG_ATTRIB_SAMPLES_NAME;
98 #define GST_GL_CONFIG_ATTRIB_SAMPLES_GTYPE G_TYPE_INT
99 GST_GL_API const char * GST_GL_CONFIG_ATTRIB_NATIVE_RENDERABLE_NAME;
100 #define GST_GL_CONFIG_ATTRIB_NATIVE_RENDERABLE_GTYPE G_TYPE_BOOLEAN
101 GST_GL_API const char * GST_GL_CONFIG_ATTRIB_NATIVE_VISUAL_ID_NAME;
102 #define GST_GL_CONFIG_ATTRIB_NATIVE_VISUAL_ID_GTYPE G_TYPE_UINT
103 GST_GL_API const char * GST_GL_CONFIG_ATTRIB_LEVEL_NAME;
104 #define GST_GL_CONFIG_ATTRIB_LEVEL_GTYPE G_TYPE_INT
105 GST_GL_API const char * GST_GL_CONFIG_ATTRIB_MIN_SWAP_INTERVAL_NAME;
106 #define GST_GL_CONFIG_ATTRIB_MIN_SWAP_INTERVAL_GTYPE G_TYPE_INT
107 GST_GL_API const char * GST_GL_CONFIG_ATTRIB_MAX_SWAP_INTERVAL_NAME;
108 #define GST_GL_CONFIG_ATTRIB_MAX_SWAP_INTERVAL_GTYPE G_TYPE_INT
109 
110 /**
111  * GST_GL_CONFIG_STRUCTURE_SET_ARGS:
112  *
113  * Since: 1.20
114  */
115 #define GST_GL_CONFIG_STRUCTURE_SET_ARGS(def_name,ctype,val) \
116     GST_GL_CONFIG_ATTRIB_NAME(def_name), \
117     GST_GL_CONFIG_ATTRIB_GTYPE(def_name), \
118     (ctype) (val)
119 
120 /**
121  * GstGLConfigCaveat:
122  * @GST_GL_CONFIG_CAVEAT_NONE: none
123  * @GST_GL_CONFIG_CAVEAT_SLOW: slow
124  * @GST_GL_CONFIG_CAVEAT_NON_CONFORMANT: non-conformant
125  *
126  * Since: 1.20
127  */
128 typedef enum
129 {
130   GST_GL_CONFIG_CAVEAT_NONE,
131   GST_GL_CONFIG_CAVEAT_SLOW,
132   GST_GL_CONFIG_CAVEAT_NON_CONFORMANT,
133 } GstGLConfigCaveat;
134 
135 GST_GL_API
136 const gchar * gst_gl_config_caveat_to_string (GstGLConfigCaveat caveat);
137 
138 /**
139  * GstGLConfigSurfaceType:
140  * @GST_GL_CONFIG_SURFACE_TYPE_NONE: none
141  * @GST_GL_CONFIG_SURFACE_TYPE_WINDOW: window
142  * @GST_GL_CONFIG_SURFACE_TYPE_PBUFFER: pbuffer
143  * @GST_GL_CONFIG_SURFACE_TYPE_PIXMAP: pixmap
144  *
145  * Since: 1.20
146  */
147 typedef enum
148 {
149   GST_GL_CONFIG_SURFACE_TYPE_NONE = 0,
150   GST_GL_CONFIG_SURFACE_TYPE_WINDOW = (1 << 0),
151   GST_GL_CONFIG_SURFACE_TYPE_PBUFFER = (1 << 1),
152   GST_GL_CONFIG_SURFACE_TYPE_PIXMAP = (1 << 2),
153 } GstGLConfigSurfaceType;
154 
155 GST_GL_API
156 const gchar * gst_gl_config_surface_type_to_string (GstGLConfigSurfaceType surface_type);
157 
158 G_END_DECLS
159 
160 #endif /* __GST_GL_CONTEXT_CONFIG_H__ */
161