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.2")
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];
74 } GstBinaryRegistryMagic;
77 * we reference strings directly from the plugins and in this case set CONST to
81 GST_BINARY_REGISTRY_FLAG_NONE = 0,
82 GST_BINARY_REGISTRY_FLAG_CONST = 1
88 * Header for binary blobs
90 typedef struct _GstBinaryChunk
99 * GstBinaryPluginElement:
101 * @nfeatures: says how many binary plugin feature structures we will have
102 * right after the structure itself.
104 * A structure containing (staticely) every information needed for a plugin
107 typedef struct _GstBinaryPluginElement
113 } GstBinaryPluginElement;
117 * GstBinaryPluginFeature:
118 * @rank: rank of the feature
120 * A structure containing the plugin features
122 typedef struct _GstBinaryPluginFeature
125 } GstBinaryPluginFeature;
128 * GstBinaryElementFactory:
129 * @npadtemplates: stores the number of GstBinaryPadTemplate structures
130 * following the structure
131 * @ninterfaces: stores the number of interface names following the structure
132 * @nuriprotocols: stores the number of protocol strings following the structure
134 * A structure containing the element factory fields
136 typedef struct _GstBinaryElementFactory
138 GstBinaryPluginFeature plugin_feature;
143 } GstBinaryElementFactory;
146 * GstBinaryTypeFindFactory:
147 * @nextensions: stores the number of typefind extensions
149 * A structure containing the element factory fields
151 typedef struct _GstBinaryTypeFindFactory
153 GstBinaryPluginFeature plugin_feature;
156 } GstBinaryTypeFindFactory;
159 * GstBinaryPadTemplate:
161 * A structure containing the static pad templates of a plugin feature
163 typedef struct _GstBinaryPadTemplate
165 guint direction; /* Either 0:"sink" or 1:"src" */
166 GstPadPresence presence;
167 } GstBinaryPadTemplate;
170 /* Function prototypes */
171 gboolean gst_registry_binary_write_cache(GstRegistry *registry, const char *location);
172 gboolean gst_registry_binary_read_cache(GstRegistry *registry, const char *location);
174 #endif /* !__GST_REGISTRYBINARY_H__ */