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>
37 * GST_MAGIC_BINARY_REGISTRY_STR:
39 * A tag, written at the beginning of the file
41 #define GST_MAGIC_BINARY_REGISTRY_STR "\xc0\xde\xf0\x0d"
43 * GST_MAGIC_BINARY_REGISTRY_LEN:
45 * length of the header tag.
47 #define GST_MAGIC_BINARY_REGISTRY_LEN (4)
50 * GST_MAGIC_BINARY_VERSION_STR:
52 * The current version of the binary registry format.
53 * This _must_ be updated whenever the registry format changes,
54 * we currently use the core version where this change happened.
56 #define GST_MAGIC_BINARY_VERSION_STR ("0.10.23.1")
59 * GST_MAGIC_BINARY_VERSION_LEN:
61 * length of the version string.
63 #define GST_MAGIC_BINARY_VERSION_LEN (64)
65 typedef struct _GstBinaryRegistryMagic
67 gchar magic[GST_MAGIC_BINARY_REGISTRY_LEN];
68 gchar version[GST_MAGIC_BINARY_VERSION_LEN];
69 } GstBinaryRegistryMagic;
72 * we reference strings directly from the plugins and in this case set CONST to
76 GST_BINARY_REGISTRY_FLAG_NONE = 0,
77 GST_BINARY_REGISTRY_FLAG_CONST = 1
83 * Header for binary blobs
85 typedef struct _GstBinaryChunk
94 * GstBinaryPluginElement:
96 * @nfeatures: says how many binary plugin feature structures we will have
97 * right after the structure itself.
99 * A structure containing (staticely) every information needed for a plugin
102 typedef struct _GstBinaryPluginElement
110 } GstBinaryPluginElement;
114 typedef struct _GstBinaryDep
126 * GstBinaryPluginFeature:
127 * @rank: rank of the feature
129 * A structure containing the plugin features
131 typedef struct _GstBinaryPluginFeature
134 } GstBinaryPluginFeature;
137 * GstBinaryElementFactory:
138 * @npadtemplates: stores the number of GstBinaryPadTemplate structures
139 * following the structure
140 * @ninterfaces: stores the number of interface names following the structure
141 * @nuriprotocols: stores the number of protocol strings following the structure
143 * A structure containing the element factory fields
145 typedef struct _GstBinaryElementFactory
147 GstBinaryPluginFeature plugin_feature;
152 } GstBinaryElementFactory;
155 * GstBinaryTypeFindFactory:
156 * @nextensions: stores the number of typefind extensions
158 * A structure containing the element factory fields
160 typedef struct _GstBinaryTypeFindFactory
162 GstBinaryPluginFeature plugin_feature;
165 } GstBinaryTypeFindFactory;
168 * GstBinaryPadTemplate:
170 * A structure containing the static pad templates of a plugin feature
172 typedef struct _GstBinaryPadTemplate
174 guint direction; /* Either 0:"sink" or 1:"src" */
175 GstPadPresence presence;
176 } GstBinaryPadTemplate;
179 /* Function prototypes */
180 gboolean gst_registry_binary_write_cache(GstRegistry *registry, const char *location);
181 gboolean gst_registry_binary_read_cache(GstRegistry *registry, const char *location);
183 #endif /* !__GST_REGISTRYBINARY_H__ */