tee: Check for the removed pad flag also in the slow pushing path
[platform/upstream/gstreamer.git] / gst / gstregistrychunks.h
1 /* GStreamer
2  * Copyright (C) 2006 Josep Torra <josep@fluendo.com>
3  * Copyright (C) 2006 Mathieu Garcia  <matthieu@fluendo.com>
4  * Copyright (C) 2006 Stefan Kost <ensonic@sonicpulse.de>
5  *
6  * gstregistrybinary.h: Header for registry handling
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  */
23 #ifndef __GST_REGISTRYCHUNKS_H__
24 #define __GST_REGISTRYCHUNKS_H__
25
26 #include <gst/gstpad.h>
27 #include <gst/gstregistry.h>
28
29 /*
30  * we reference strings directly from the plugins and in this case set CONST to
31  * avoid freeing them. If g_free() should be used, the MALLOC flag is set,
32  * otherwise g_slice_free1() will be used!
33  */
34 enum {
35   GST_REGISTRY_CHUNK_FLAG_NONE = 0,
36   GST_REGISTRY_CHUNK_FLAG_CONST = 1,
37   GST_REGISTRY_CHUNK_FLAG_MALLOC = 2,
38 };
39
40 /*
41  * GstRegistryChunk:
42  *
43  * Header for binary blobs
44  */
45 typedef struct _GstRegistryChunk
46 {
47   gpointer data;
48   guint size;
49   guint flags;
50   gboolean align;
51 } GstRegistryChunk;
52
53 typedef struct _GstRegistryChunkGlobalHeader
54 {
55   guint32  filter_env_hash;
56 } GstRegistryChunkGlobalHeader;
57
58 /*
59  * GstRegistryChunkPluginElement:
60  *
61  * @n_deps: Says how many dependency structures follows.
62  *
63  * @nfeatures: says how many binary plugin feature structures we will have
64  * right after the structure itself.
65  *
66  * A structure containing (staticely) every information needed for a plugin
67  */
68
69 typedef struct _GstRegistryChunkPluginElement
70 {
71   gulong file_size;
72   gulong file_mtime;
73
74   guint n_deps;
75
76   guint nfeatures;
77 } GstRegistryChunkPluginElement;
78
79 /* GstRegistryChunkDep:
80  */
81 typedef struct _GstRegistryChunkDep
82 {
83   guint flags;
84   guint n_env_vars;
85   guint n_paths;
86   guint n_names;
87
88   guint env_hash;
89   guint stat_hash;
90 } GstRegistryChunkDep;
91
92 /*
93  * GstRegistryChunkPluginFeature:
94  * @rank: rank of the feature
95  *
96  * A structure containing the plugin features
97  */
98 typedef struct _GstRegistryChunkPluginFeature
99 {
100   gulong rank;
101 } GstRegistryChunkPluginFeature;
102
103 /*
104  * GstRegistryChunkElementFactory:
105  * @npadtemplates: stores the number of GstRegistryChunkPadTemplate structures
106  * following the structure
107  * @ninterfaces: stores the number of interface names following the structure
108  * @nuriprotocols: stores the number of protocol strings following the structure
109  *
110  * A structure containing the element factory fields
111  */
112 typedef struct _GstRegistryChunkElementFactory
113 {
114   GstRegistryChunkPluginFeature plugin_feature;
115
116   guint npadtemplates;
117   guint ninterfaces;
118   guint nuriprotocols;
119 } GstRegistryChunkElementFactory;
120
121 /*
122  * GstRegistryChunkTypeFindFactory:
123  * @nextensions: stores the number of typefind extensions
124  *
125  * A structure containing the type find factory fields
126  */
127 typedef struct _GstRegistryChunkTypeFindFactory
128 {
129   GstRegistryChunkPluginFeature plugin_feature;
130
131   guint nextensions;
132 } GstRegistryChunkTypeFindFactory;
133
134 /*
135  * GstRegistryChunkDeviceProviderFactory:
136  *
137  * A structure containing the device provider factory fields
138  */
139 typedef struct _GstRegistryChunkDeviceProviderFactory
140 {
141   GstRegistryChunkPluginFeature plugin_feature;
142
143 } GstRegistryChunkDeviceProviderFactory;
144
145 /*
146  * GstRegistryChunkDynamicTypeFactory:
147  *
148  * A structure containing the dynamic type factory flags field
149  */
150 typedef struct _GstRegistryChunkDynamicTypeFactory
151 {
152   GstRegistryChunkPluginFeature plugin_feature;
153
154   guint type_flags;
155 } GstRegistryChunkDynamicTypeFactory;
156
157 /*
158  * GstRegistryChunkPadTemplate:
159  *
160  * A structure containing the static pad templates of a plugin feature
161  */
162 typedef struct _GstRegistryChunkPadTemplate
163 {
164   guint direction;                     /* Either 0:"sink" or 1:"src" */
165   GstPadPresence presence;
166 } GstRegistryChunkPadTemplate;
167
168 G_BEGIN_DECLS
169
170 gboolean
171 _priv_gst_registry_chunks_save_plugin (GList ** list, GstRegistry * registry,
172     GstPlugin * plugin);
173
174 gboolean
175 _priv_gst_registry_chunks_load_plugin (GstRegistry * registry, gchar ** in,
176     gchar *end, GstPlugin **out_plugin);
177
178 void
179 _priv_gst_registry_chunks_save_global_header (GList ** list,
180     GstRegistry * registry, guint32 filter_env_hash);
181
182 gboolean
183 _priv_gst_registry_chunks_load_global_header (GstRegistry * registry,
184     gchar ** in, gchar *end, guint32 * filter_env_hash);
185
186 void
187 _priv_gst_registry_chunk_free (GstRegistryChunk *chunk);
188
189 G_END_DECLS
190
191 #endif /* __GST_REGISTRYCHUNKS_H__ */