? gst/gstregistrybinary.c
? gst/gstregistrybinary.h
Index: configure.ac
===================================================================
RCS file: /cvs/gstreamer/gstreamer/configure.ac,v
retrieving revision 1.491
diff -u -r1.491 configure.ac
--- configure.ac	12 Dec 2006 13:53:04 -0000	1.491
+++ configure.ac	28 Dec 2006 17:20:22 -0000
@@ -191,6 +191,23 @@
     [Define if we should poison deallocated memory])
 fi
 
+dnl Use binary registry
+AC_ARG_ENABLE(binary-registry,
+  AC_HELP_STRING([--enable-binary-registry],
+    [enable experimental binary registry]),
+  [
+    case "${enableval}" in
+      yes) USE_BINARY_REGISTRY=yes ;;
+      no)  USE_BINARY_REGISTRY=no ;;
+      *)   AC_MSG_ERROR(bad value ${enableval} for --enable-binary-registry) ;;
+    esac
+  ], 
+  [USE_BINARY_REGISTRY=no]) dnl Default value
+if test "x$USE_BINARY_REGISTRY" = xyes; then
+  AC_DEFINE(USE_BINARY_REGISTRY, 1,
+    [Define if we should use binary registry instead xml registry])
+fi
+
 dnl *** checks for platform ***
 
 dnl * hardware/architecture *
Index: docs/gst/gstreamer-sections.txt
===================================================================
RCS file: /cvs/gstreamer/gstreamer/docs/gst/gstreamer-sections.txt,v
retrieving revision 1.279
diff -u -r1.279 gstreamer-sections.txt
--- docs/gst/gstreamer-sections.txt	6 Nov 2006 15:14:46 -0000	1.279
+++ docs/gst/gstreamer-sections.txt	28 Dec 2006 17:20:22 -0000
@@ -1650,6 +1650,8 @@
 gst_registry_scan_path
 gst_registry_xml_read_cache
 gst_registry_xml_write_cache
+gst_registry_binary_read_cache
+gst_registry_binary_write_cache
 gst_registry_lookup
 gst_registry_remove_feature
 gst_registry_add_feature
@@ -1672,6 +1674,9 @@
 GST_TYPE_REGISTRY
 <SUBSECTION Private>
 gst_registry_get_type
+GST_MAGIC_BINARY_REGISTRY_LEN
+GST_MAGIC_BINARY_REGISTRY_STR
+GST_MAGIC_BINARY_VERSION_LEN
 </SECTION>
 
 
Index: gst/Makefile.am
===================================================================
RCS file: /cvs/gstreamer/gstreamer/gst/Makefile.am,v
retrieving revision 1.219
diff -u -r1.219 Makefile.am
--- gst/Makefile.am	10 Oct 2006 12:12:44 -0000	1.219
+++ gst/Makefile.am	28 Dec 2006 17:20:22 -0000
@@ -9,7 +9,7 @@
 if GST_DISABLE_REGISTRY
 GST_REGISTRY_SRC = 
 else
-GST_REGISTRY_SRC = gstregistryxml.c
+GST_REGISTRY_SRC = gstregistryxml.c gstregistrybinary.c
 endif
 
 if GST_DISABLE_PARSE
@@ -210,6 +210,7 @@
 	gst-i18n-lib.h		\
 	gst-i18n-app.h		\
 	gstquark.h		\
+	gstregistrybinary.h     \
 	gst_private.h
 
 gstmarshal.h: gstmarshal.list
Index: gst/gst.c
===================================================================
RCS file: /cvs/gstreamer/gstreamer/gst/gst.c,v
retrieving revision 1.232
diff -u -r1.232 gst.c
--- gst/gst.c	19 Dec 2006 11:04:49 -0000	1.232
+++ gst/gst.c	28 Dec 2006 17:20:22 -0000
@@ -616,8 +616,11 @@
   GList *l;
 
   GST_DEBUG ("reading registry cache: %s", registry_file);
+#ifdef USE_BINARY_REGISTRY
+  gst_registry_binary_read_cache (default_registry, registry_file);
+#else
   gst_registry_xml_read_cache (default_registry, registry_file);
-
+#endif
   /* scan paths specified via --gst-plugin-path */
   GST_DEBUG ("scanning paths added via --gst-plugin-path");
   for (l = plugin_paths; l != NULL; l = l->next) {
@@ -690,7 +693,11 @@
   }
 
   GST_INFO ("Registry cache changed. Writing new registry cache");
+#ifdef USE_BINARY_REGISTRY
+  if (!gst_registry_binary_write_cache (default_registry, registry_file)) {
+#else
   if (!gst_registry_xml_write_cache (default_registry, registry_file)) {
+#endif
     g_set_error (error, GST_CORE_ERROR, GST_CORE_ERROR_FAILED,
         _("Error writing registry cache to %s: %s"),
         registry_file, g_strerror (errno));
@@ -805,7 +812,11 @@
 
     if (res_byte == '1') {
       GST_DEBUG ("Child succeeded. Parent reading registry cache");
+#ifdef USE_BINARY_REGISTRY
+      gst_registry_binary_read_cache (default_registry, registry_file);
+#else
       gst_registry_xml_read_cache (default_registry, registry_file);
+#endif
     } else {
       GST_DEBUG ("Child failed. Parent re-scanning registry, ignoring errors.");
       scan_and_update_registry (default_registry, registry_file, FALSE, NULL);
@@ -826,8 +837,13 @@
   default_registry = gst_registry_get_default ();
   registry_file = g_strdup (g_getenv ("GST_REGISTRY"));
   if (registry_file == NULL) {
+#ifdef USE_BINARY_REGISTRY
+    registry_file = g_build_filename (g_get_home_dir (),
+        ".gstreamer-" GST_MAJORMINOR, "registry." HOST_CPU ".bin", NULL);
+#else
     registry_file = g_build_filename (g_get_home_dir (),
         ".gstreamer-" GST_MAJORMINOR, "registry." HOST_CPU ".xml", NULL);
+#endif
   }
 
   /* first see if forking is enabled */
Index: gst/gstregistry.h
===================================================================
RCS file: /cvs/gstreamer/gstreamer/gst/gstregistry.h,v
retrieving revision 1.37
diff -u -r1.37 gstregistry.h
--- gst/gstregistry.h	28 Sep 2006 14:00:43 -0000	1.37
+++ gst/gstregistry.h	28 Dec 2006 17:20:22 -0000
@@ -106,8 +106,13 @@
 GstPlugin * 		gst_registry_lookup 		(GstRegistry *registry, const char *filename);
 GstPluginFeature * 	gst_registry_lookup_feature 	(GstRegistry *registry, const char *name);
 
+#ifdef USE_BINARY_REGISTRY
+gboolean 		gst_registry_binary_read_cache 	(GstRegistry * registry, const char *location);
+gboolean 		gst_registry_binary_write_cache	(GstRegistry * registry, const char *location);
+#else 
 gboolean 		gst_registry_xml_read_cache 	(GstRegistry * registry, const char *location);
 gboolean 		gst_registry_xml_write_cache 	(GstRegistry * registry, const char *location);
+#endif
 
 /* convinience defines for the default registry */
 
