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>
6 * gstregistrybinary.h: Header for registry handling
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.
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.
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., 59 Temple Place - Suite 330,
21 * Boston, MA 02111-1307, USA.
24 /* SUGGESTIONS AND TODO :
25 ** ====================
26 ** - Use a compressed registry, but would induce performance loss
27 ** - Encrypt the registry, for security purpose, but would also reduce performances
30 #ifndef __GST_REGISTRYBINARY_H__
31 #define __GST_REGISTRYBINARY_H__
33 #include <gst/gstpad.h>
34 #include <gst/gstregistry.h>
41 * GST_MAGIC_BINARY_REGISTRY_STR:
43 * A tag, written at the beginning of the file
45 #define GST_MAGIC_BINARY_REGISTRY_STR "\xc0\xde\xf0\x0d"
47 * GST_MAGIC_BINARY_REGISTRY_LEN:
49 * length of the header tag.
51 #define GST_MAGIC_BINARY_REGISTRY_LEN (4)
54 * GST_MAGIC_BINARY_VERSION_STR:
56 * The current version of the binary registry format.
57 * This _must_ be updated whenever the registry format changes,
58 * we currently use the core version where this change happened.
60 #define GST_MAGIC_BINARY_VERSION_STR ("0.10.18.1")
63 * GST_MAGIC_BINARY_VERSION_LEN:
65 * length of the version string.
67 #define GST_MAGIC_BINARY_VERSION_LEN (64)
69 typedef struct _GstBinaryRegistryMagic
71 gchar magic[GST_MAGIC_BINARY_REGISTRY_LEN];
72 gchar version[GST_MAGIC_BINARY_VERSION_LEN];
73 } GstBinaryRegistryMagic;
76 * we reference strings directly from the plugins and in this case set CONST to
80 GST_BINARY_REGISTRY_FLAG_NONE = 0,
81 GST_BINARY_REGISTRY_FLAG_CONST = 1
87 * Header for binary blobs
89 typedef struct _GstBinaryChunk
98 * GstBinaryPluginElement:
100 * @nfeatures: says how many binary plugin feature structures we will have
101 * right after the structure itself.
103 * A structure containing (staticely) every information needed for a plugin
106 typedef struct _GstBinaryPluginElement
112 } GstBinaryPluginElement;
116 * GstBinaryPluginFeature:
117 * @rank: rank of the feature
119 * A structure containing the plugin features
121 typedef struct _GstBinaryPluginFeature
124 } GstBinaryPluginFeature;
127 * GstBinaryElementFactory:
128 * @npadtemplates: stores the number of GstBinaryPadTemplate structures
129 * following the structure
130 * @ninterfaces: stores the number of interface names following the structure
131 * @nuriprotocols: stores the number of protocol strings following the structure
133 * A structure containing the element factory fields
135 typedef struct _GstBinaryElementFactory
137 GstBinaryPluginFeature plugin_feature;
142 } GstBinaryElementFactory;
145 * GstBinaryTypeFindFactory:
146 * @nextensions: stores the number of typefind extensions
148 * A structure containing the element factory fields
150 typedef struct _GstBinaryTypeFindFactory
152 GstBinaryPluginFeature plugin_feature;
155 } GstBinaryTypeFindFactory;
158 * GstBinaryPadTemplate:
160 * A structure containing the static pad templates of a plugin feature
162 typedef struct _GstBinaryPadTemplate
164 guint direction; /* Either 0:"sink" or 1:"src" */
165 GstPadPresence presence;
166 } GstBinaryPadTemplate;
169 /* Function prototypes */
170 gboolean gst_registry_binary_write_cache(GstRegistry *registry, const char *location);
171 gboolean gst_registry_binary_read_cache(GstRegistry *registry, const char *location);
173 #endif /* !__GST_REGISTRYBINARY_H__ */