/* GStreamer
- * Copyright (C) 2006 Josep Torra <josep@fluendo.com>
- * 2006 Mathieu Garcia <matthieu@fluendo.com>
- * 2006 Stefan Kost <ensonic@sonicpulse.de>
+ * Copyright (C) 2006 Josep Torra <josep@fluendo.com>
+ * Copyright (C) 2006 Mathieu Garcia <matthieu@fluendo.com>
+ * Copyright (C) 2006 Stefan Kost <ensonic@sonicpulse.de>
*
* gstregistrybinary.h: Header for registry handling
*
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
*/
/* SUGGESTIONS AND TODO :
** ====================
** - Use a compressed registry, but would induce performance loss
** - Encrypt the registry, for security purpose, but would also reduce performances
-** - Also have a non-mmap based cache reading (work with file descriptors)
*/
#ifndef __GST_REGISTRYBINARY_H__
#define __GST_REGISTRYBINARY_H__
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <stdio.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <dirent.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include <gst/gstconfig.h>
-#include <gst/gst_private.h>
-#include <gst/gstelement.h>
-#include <gst/gsttypefind.h>
-#include <gst/gsttypefindfactory.h>
-#include <gst/gsturi.h>
-#include <gst/gstinfo.h>
-#include <gst/gstenumtypes.h>
+#include <gst/gstpad.h>
#include <gst/gstregistry.h>
-#include <gst/gstpadtemplate.h>
-#include "glib-compat-private.h"
-#include <glib/gstdio.h>
+G_BEGIN_DECLS
/*
* GST_MAGIC_BINARY_REGISTRY_STR:
*
* A tag, written at the beginning of the file
- */
+ */
#define GST_MAGIC_BINARY_REGISTRY_STR "\xc0\xde\xf0\x0d"
/*
* GST_MAGIC_BINARY_REGISTRY_LEN:
*
* length of the header tag.
- */
+ */
#define GST_MAGIC_BINARY_REGISTRY_LEN (4)
-/*
- * GST_MAGIC_BINARY_VERSION_LEN:
- *
- * length of the version string.
- */
-#define GST_MAGIC_BINARY_VERSION_LEN (64)
-
-typedef struct _GstBinaryRegistryMagic
-{
- char magic[GST_MAGIC_BINARY_REGISTRY_LEN];
- char version[GST_MAGIC_BINARY_VERSION_LEN];
-} GstBinaryRegistryMagic;
/*
- * we reference strings directly from the plugins and in this case set CONST to
- * avoid freeing them
- */
-enum {
- GST_BINARY_REGISTRY_FLAG_NONE = 0,
- GST_BINARY_REGISTRY_FLAG_CONST = 1
-};
-
-/* GstBinaryChunk:
+ * GST_MAGIC_BINARY_VERSION_STR:
*
- * Header for binary blobs
+ * The current version of the binary registry format.
+ * This _must_ be updated whenever the registry format changes,
+ * we currently use the core version where this change happened.
*/
-typedef struct _GstBinaryChunk
-{
- void *data;
- unsigned int size;
- unsigned int flags;
- gboolean align;
-} GstBinaryChunk;
-
-/* A structure containing (staticely) every information needed for a plugin
-**
-** Notes :
-** "nfeatures" is used to say how many GstBinaryPluginFeature structures we will have
-** right after the structure itself.
-*/
-
-typedef struct _GstBinaryPluginElement
-{
- unsigned long file_size;
- unsigned long file_mtime;
-
- unsigned int nfeatures;
-} GstBinaryPluginElement;
-
-
-/* A structure containing the plugin features
-**
-** Note :
-** "npadtemplates" is used to store the number of GstBinaryPadTemplate structures following the structure itself.
-** "ninterfaces" is used to store the number of GstBinaryInterface structures following the structure itself.
-** "nuritypes" is used to store the number of GstBinaryUriType structures following the structure itself.
-*/
-typedef struct _GstBinaryPluginFeature
-{
- unsigned long rank;
-
- unsigned int npadtemplates;
- unsigned int ninterfaces;
- unsigned int nuritypes;
-} GstBinaryPluginFeature;
-
-
-/*
-** A structure containing the static pad templates of a plugin feature
-*/
-typedef struct _GstBinaryPadTemplate
-{
- int direction; /* Either 0:"sink" or 1:"src" */
- GstPadPresence presence;
-} GstBinaryPadTemplate;
+#define GST_MAGIC_BINARY_VERSION_STR "1.3.0"
/*
-** A very simple structure defining the plugin feature interface string
-*/
-//#define GST_BINARY_REGISTRY_INTERFACE_INTERFACE_LEN (512)
-typedef struct _GstBinaryInterface
-{
- //char interface[GST_BINARY_REGISTRY_INTERFACE_INTERFACE_LEN];
- unsigned long size;
-} GstBinaryInterface;
+ * GST_MAGIC_BINARY_VERSION_LEN:
+ *
+ * Maximum length of the version string in the header.
+ */
+#define GST_MAGIC_BINARY_VERSION_LEN (64)
-/* Uri Type */
-typedef struct _GstBinaryUriType
+typedef struct _GstBinaryRegistryMagic
{
- GstURIType type; /* GST_URI_SINK / GST_URI_SRC */
- unsigned long nuriprotocols;
-} GstBinaryUriType;
+ gchar magic[GST_MAGIC_BINARY_REGISTRY_LEN];
+ gchar version[GST_MAGIC_BINARY_VERSION_LEN];
+} GstBinaryRegistryMagic;
-/* Function prototypes */
-gboolean gst_registry_binary_write_cache(GstRegistry *registry, const char *location);
-gboolean gst_registry_binary_read_cache(GstRegistry *registry, const char *location);
+G_END_DECLS
#endif /* !__GST_REGISTRYBINARY_H__ */