gstreamer_core/gst/gst.c
branchRCL_3
changeset 29 567bb019e3e3
parent 0 0e761a78d257
child 30 7e817e7e631c
equal deleted inserted replaced
6:9b2c3c7a1a9c 29:567bb019e3e3
   102  *
   102  *
   103  * Last reviewed on 2006-08-11 (0.10.10)
   103  * Last reviewed on 2006-08-11 (0.10.10)
   104  */
   104  */
   105 
   105 
   106 #include "gst_private.h"
   106 #include "gst_private.h"
       
   107 #include "gstconfig.h"
   107 #include <stdlib.h>
   108 #include <stdlib.h>
   108 #include <stdio.h>
   109 #include <stdio.h>
   109 #include <sys/types.h>
   110 #include <sys/types.h>
   110 #ifdef HAVE_FORK
   111 #ifdef HAVE_FORK
   111 #include <sys/wait.h>
   112 #include <sys/wait.h>
   114 #include <sys/utsname.h>
   115 #include <sys/utsname.h>
   115 #endif
   116 #endif
   116 #ifdef HAVE_UNISTD_H
   117 #ifdef HAVE_UNISTD_H
   117 #include <unistd.h>
   118 #include <unistd.h>
   118 #endif
   119 #endif
       
   120 #ifdef G_OS_WIN32
       
   121 #define WIN32_LEAN_AND_MEAN     /* prevents from including too many things */
       
   122 #include <windows.h>            /* GetStdHandle, windows console */
       
   123 #endif
   119 
   124 
   120 #include "gst-i18n-lib.h"
   125 #include "gst-i18n-lib.h"
   121 #include <locale.h>             /* for LC_ALL */
   126 #include <locale.h>             /* for LC_ALL */
   122 
   127 
   123 #include "gst.h"
   128 #include "gst.h"
   124 
   129 
   125 #ifdef __SYMBIAN32__
   130 #ifdef __SYMBIAN32__
   126 #include <glib_global.h>
   131 #include <glib_global.h>
       
   132 #include <gst_global.h>
   127 #include <config.h>
   133 #include <config.h>
   128 #include <string.h>
       
   129 #endif
   134 #endif
   130 
   135 
   131 #define GST_CAT_DEFAULT GST_CAT_GST_INIT
   136 #define GST_CAT_DEFAULT GST_CAT_GST_INIT
   132 
   137 
   133 #define MAX_PATH_SPLIT  16
   138 #define MAX_PATH_SPLIT  16
   134 #define GST_PLUGIN_SEPARATOR ","
   139 #define GST_PLUGIN_SEPARATOR ","
   135 
   140 
   136 static gboolean gst_initialized = FALSE;
   141 static gboolean gst_initialized = FALSE;
   137 static gboolean gst_deinitialized = FALSE;
   142 static gboolean gst_deinitialized = FALSE;
   138 
   143 
       
   144 #ifdef G_OS_WIN32
       
   145 static HMODULE gst_dll_handle = NULL;
       
   146 #endif
       
   147 
   139 #ifndef GST_DISABLE_REGISTRY
   148 #ifndef GST_DISABLE_REGISTRY
   140 static GList *plugin_paths = NULL;      /* for delayed processing in post_init */
   149 static GList *plugin_paths = NULL;      /* for delayed processing in post_init */
   141 #endif
   150 #endif
   142 
   151 
   143 #ifndef GST_DISABLE_GST_DEBUG
   152 #ifndef GST_DISABLE_GST_DEBUG
   144 extern const gchar *priv_gst_dump_dot_dir;
   153 extern const gchar *priv_gst_dump_dot_dir;
   145 #endif
   154 #endif
   146 
   155 
   147 /* defaults */
   156 /* defaults */
   148 #ifdef HAVE_FORK
   157 #if defined(HAVE_FORK) && !defined(GST_HAVE_UNSAFE_FORK)
   149 #define DEFAULT_FORK TRUE
   158 #define DEFAULT_FORK TRUE
   150 #else
   159 #else
   151 #define DEFAULT_FORK FALSE
   160 #define DEFAULT_FORK FALSE
   152 #endif /* HAVE_FORK */
   161 #endif /* HAVE_FORK */
   153 
   162 
   155 static gboolean _gst_disable_segtrap = FALSE;
   164 static gboolean _gst_disable_segtrap = FALSE;
   156 
   165 
   157 /* control the behaviour of registry rebuild */
   166 /* control the behaviour of registry rebuild */
   158 static gboolean _gst_enable_registry_fork = DEFAULT_FORK;
   167 static gboolean _gst_enable_registry_fork = DEFAULT_FORK;
   159 
   168 
   160 #ifdef __SYMBIAN32__
       
   161 /*set to TRUE when registry needn't to be updated */
   169 /*set to TRUE when registry needn't to be updated */
   162 static gboolean _gst_disable_registry_update = FALSE;
   170 static gboolean _gst_disable_registry_update = FALSE;
   163 #endif
       
   164 
   171 
   165 static void load_plugin_func (gpointer data, gpointer user_data);
   172 static void load_plugin_func (gpointer data, gpointer user_data);
   166 static gboolean init_pre (GOptionContext * context, GOptionGroup * group,
   173 static gboolean init_pre (GOptionContext * context, GOptionGroup * group,
   167     gpointer data, GError ** error);
   174     gpointer data, GError ** error);
   168 static gboolean init_post (GOptionContext * context, GOptionGroup * group,
   175 static gboolean init_post (GOptionContext * context, GOptionGroup * group,
   199 #endif
   206 #endif
   200   ARG_PLUGIN_SPEW,
   207   ARG_PLUGIN_SPEW,
   201   ARG_PLUGIN_PATH,
   208   ARG_PLUGIN_PATH,
   202   ARG_PLUGIN_LOAD,
   209   ARG_PLUGIN_LOAD,
   203   ARG_SEGTRAP_DISABLE,
   210   ARG_SEGTRAP_DISABLE,
   204 #ifdef __SYMBIAN32__
       
   205   ARG_REGISTRY_UPDATE_DISABLE,
   211   ARG_REGISTRY_UPDATE_DISABLE,
   206 #endif
       
   207   ARG_REGISTRY_FORK_DISABLE
   212   ARG_REGISTRY_FORK_DISABLE
   208 };
   213 };
   209 
   214 
   210 /* debug-spec ::= category-spec [, category-spec]*
   215 /* debug-spec ::= category-spec [, category-spec]*
   211  * category-spec ::= category:val | val
   216  * category-spec ::= category:val | val
   287 
   292 
   288   g_strfreev (split);
   293   g_strfreev (split);
   289 }
   294 }
   290 #endif
   295 #endif
   291 
   296 
       
   297 #ifdef G_OS_WIN32
       
   298 BOOL WINAPI
       
   299 DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
       
   300 {
       
   301   if (fdwReason == DLL_PROCESS_ATTACH)
       
   302     gst_dll_handle = (HMODULE) hinstDLL;
       
   303   return TRUE;
       
   304 }
       
   305 
       
   306 #endif
       
   307 
   292 /**
   308 /**
   293  * gst_init_get_option_group:
   309  * gst_init_get_option_group:
   294  *
   310  *
   295  * Returns a #GOptionGroup with GStreamer's argument specifications. The
   311  * Returns a #GOptionGroup with GStreamer's argument specifications. The
   296  * group is set up to use standard GOption callbacks, so when using this
   312  * group is set up to use standard GOption callbacks, so when using this
   314 GOptionGroup *
   330 GOptionGroup *
   315 gst_init_get_option_group (void)
   331 gst_init_get_option_group (void)
   316 {
   332 {
   317 #ifndef GST_DISABLE_OPTION_PARSING
   333 #ifndef GST_DISABLE_OPTION_PARSING
   318   GOptionGroup *group;
   334   GOptionGroup *group;
   319   const static GOptionEntry gst_args[] = {
   335   static const GOptionEntry gst_args[] = {
   320     {"gst-version", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
   336     {"gst-version", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
   321         (gpointer) parse_goption_arg, N_("Print the GStreamer version"), NULL},
   337         (gpointer) parse_goption_arg, N_("Print the GStreamer version"), NULL},
   322     {"gst-fatal-warnings", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
   338     {"gst-fatal-warnings", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
   323         (gpointer) parse_goption_arg, N_("Make all warnings fatal"), NULL},
   339         (gpointer) parse_goption_arg, N_("Make all warnings fatal"), NULL},
   324 #ifndef GST_DISABLE_GST_DEBUG
   340 #ifndef GST_DISABLE_GST_DEBUG
   356         N_("PLUGINS")},
   372         N_("PLUGINS")},
   357     {"gst-disable-segtrap", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
   373     {"gst-disable-segtrap", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
   358           (gpointer) parse_goption_arg,
   374           (gpointer) parse_goption_arg,
   359           N_("Disable trapping of segmentation faults during plugin loading"),
   375           N_("Disable trapping of segmentation faults during plugin loading"),
   360         NULL},
   376         NULL},
   361 #ifdef __SYMBIAN32__		
       
   362     {"gst-disable-registry-update", 0, G_OPTION_FLAG_NO_ARG,
   377     {"gst-disable-registry-update", 0, G_OPTION_FLAG_NO_ARG,
   363           G_OPTION_ARG_CALLBACK,
   378           G_OPTION_ARG_CALLBACK,
   364           (gpointer) parse_goption_arg,
   379           (gpointer) parse_goption_arg,
   365           N_("Disable updating the registry"),
   380           N_("Disable updating the registry"),
   366         NULL},
   381         NULL},
   367 #endif		
       
   368     {"gst-disable-registry-fork", 0, G_OPTION_FLAG_NO_ARG,
   382     {"gst-disable-registry-fork", 0, G_OPTION_FLAG_NO_ARG,
   369           G_OPTION_ARG_CALLBACK,
   383           G_OPTION_ARG_CALLBACK,
   370           (gpointer) parse_goption_arg,
   384           (gpointer) parse_goption_arg,
   371           N_("Disable the use of fork() while scanning the registry"),
   385           N_("Disable the use of fork() while scanning the registry"),
   372         NULL},
   386         NULL},
   433   GOptionGroup *group;
   447   GOptionGroup *group;
   434   GOptionContext *ctx;
   448   GOptionContext *ctx;
   435 #endif
   449 #endif
   436   gboolean res;
   450   gboolean res;
   437 
   451 
   438 #ifdef __SYMBIAN32__
       
   439 	char* checkexe,*temp;
       
   440 	/// registry will be updated only if gst_init is called from GSTRegistryGenerator.exe
       
   441 	if( argv )
       
   442 	{
       
   443 		checkexe = *argv[0];
       
   444 		temp = checkexe+strlen(checkexe);
       
   445 		while(temp!=checkexe && *temp!='\\')
       
   446 		    {
       
   447 		    temp--;
       
   448 		    }
       
   449 
       
   450 		checkexe = ++temp;
       
   451 		
       
   452 		if( strcmp(checkexe,GST_REGISTRY_GENERATOR) == 0 )
       
   453 		{
       
   454 			/// setting flag for update registry if called from GSTRegistryGenerator.exe
       
   455 			setenv("GST_REGISTRY_UPDATE", "yes", 1);
       
   456 		}
       
   457 		else
       
   458 		{
       
   459 			/// setting flag for disable update registry
       
   460 			setenv("GST_REGISTRY_UPDATE", "no", 0);
       
   461 		}
       
   462 	}
       
   463 	else
       
   464 	{
       
   465 		/// setting flag for disable update registry
       
   466 	  setenv("GST_REGISTRY_UPDATE", "no", 0);
       
   467 	}
       
   468 #endif
       
   469 
       
   470   if (!g_thread_supported ())
   452   if (!g_thread_supported ())
   471     g_thread_init (NULL);
   453     g_thread_init (NULL);
   472 
   454 
   473   if (gst_initialized) {
   455   if (gst_initialized) {
   474     GST_DEBUG ("already initialized gst");
   456     GST_DEBUG ("already initialized gst");
   637   _gst_debug_init ();
   619   _gst_debug_init ();
   638 
   620 
   639 #ifdef ENABLE_NLS
   621 #ifdef ENABLE_NLS
   640   setlocale (LC_ALL, "");
   622   setlocale (LC_ALL, "");
   641   bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
   623   bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
       
   624   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
   642 #endif /* ENABLE_NLS */
   625 #endif /* ENABLE_NLS */
   643 
   626 
   644 #ifndef GST_DISABLE_GST_DEBUG
   627 #ifndef GST_DISABLE_GST_DEBUG
   645   {
   628   {
   646     const gchar *debug_list;
   629     const gchar *debug_list;
   719 {
   702 {
   720   const gchar *plugin_path;
   703   const gchar *plugin_path;
   721   gboolean changed = FALSE;
   704   gboolean changed = FALSE;
   722   GList *l;
   705   GList *l;
   723 
   706 
       
   707   GST_INFO ("Validating registry cache: %s", registry_file);
       
   708   /* It sounds tempting to just compare the mtime of directories with the mtime
       
   709    * of the registry cache, but it does not work. It would not catch updated
       
   710    * plugins, which might bring more or less features.
       
   711    */
       
   712 
   724   /* scan paths specified via --gst-plugin-path */
   713   /* scan paths specified via --gst-plugin-path */
   725   GST_DEBUG ("scanning paths added via --gst-plugin-path");
   714   GST_DEBUG ("scanning paths added via --gst-plugin-path");
   726   for (l = plugin_paths; l != NULL; l = l->next) {
   715   for (l = plugin_paths; l != NULL; l = l->next) {
   727     GST_INFO ("Scanning plugin path: \"%s\"", (gchar *) l->data);
   716     GST_INFO ("Scanning plugin path: \"%s\"", (gchar *) l->data);
   728     /* CHECKME: add changed |= here as well? */
   717     changed |= gst_registry_scan_path (default_registry, (gchar *) l->data);
   729     gst_registry_scan_path (default_registry, (gchar *) l->data);
       
   730   }
   718   }
   731   /* keep plugin_paths around in case a re-scan is forced later on */
   719   /* keep plugin_paths around in case a re-scan is forced later on */
   732 
   720 
   733   /* GST_PLUGIN_PATH specifies a list of directories to scan for
   721   /* GST_PLUGIN_PATH specifies a list of directories to scan for
   734    * additional plugins.  These take precedence over the system plugins */
   722    * additional plugins.  These take precedence over the system plugins */
   751    * loaded by default.  If not set, this defaults to the system-installed
   739    * loaded by default.  If not set, this defaults to the system-installed
   752    * path, and the plugins installed in the user's home directory */
   740    * path, and the plugins installed in the user's home directory */
   753   plugin_path = g_getenv ("GST_PLUGIN_SYSTEM_PATH");
   741   plugin_path = g_getenv ("GST_PLUGIN_SYSTEM_PATH");
   754   if (plugin_path == NULL) {
   742   if (plugin_path == NULL) {
   755     char *home_plugins;
   743     char *home_plugins;
   756 
   744 #ifdef __SYMBIAN32__
       
   745     
       
   746     GST_DEBUG ("scanning main plugins %s", PLUGIN_LIST_TXT_FILE_PATH_IN_ROM);
       
   747     changed |= gst_registry_scan_path (default_registry, PLUGIN_LIST_TXT_FILE_PATH_IN_ROM);
       
   748     
       
   749     GST_DEBUG ("scanning main plugins %s", PLUGIN_LIST_TXT_FILE_PATH);
       
   750     changed |= gst_registry_scan_path (default_registry, PLUGIN_LIST_TXT_FILE_PATH);
       
   751     
       
   752 #else
   757     GST_DEBUG ("GST_PLUGIN_SYSTEM_PATH not set");
   753     GST_DEBUG ("GST_PLUGIN_SYSTEM_PATH not set");
   758 
   754 
   759     /* plugins in the user's home directory take precedence over
   755     /* plugins in the user's home directory take precedence over
   760      * system-installed ones */
   756      * system-installed ones */
   761     home_plugins = g_build_filename (g_get_home_dir (),
   757     home_plugins = g_build_filename (g_get_home_dir (),
   762         ".gstreamer-" GST_MAJORMINOR, "plugins", NULL);
   758         ".gstreamer-" GST_MAJORMINOR, "plugins", NULL);
   763     GST_DEBUG ("scanning home plugins %s", home_plugins);
   759     GST_DEBUG ("scanning home plugins %s", home_plugins);
   764     changed |= gst_registry_scan_path (default_registry, home_plugins);
   760     changed |= gst_registry_scan_path (default_registry, home_plugins);
   765     g_free (home_plugins);
   761     g_free (home_plugins);
   766 
   762 
       
   763 
       
   764     
   767     /* add the main (installed) library path */
   765     /* add the main (installed) library path */
   768     GST_DEBUG ("scanning main plugins %s", PLUGINDIR);
   766     GST_DEBUG ("scanning main plugins %s", PLUGINDIR);
   769     changed |= gst_registry_scan_path (default_registry, PLUGINDIR);
   767     changed |= gst_registry_scan_path (default_registry, PLUGINDIR);
       
   768 #endif
       
   769 #ifdef G_OS_WIN32
       
   770     {
       
   771       char *base_dir;
       
   772       char *dir;
       
   773 
       
   774       base_dir =
       
   775           g_win32_get_package_installation_directory_of_module (gst_dll_handle);
       
   776 
       
   777       dir = g_build_filename (base_dir, "lib", "gstreamer-0.10", NULL);
       
   778       GST_DEBUG ("scanning DLL dir %s", dir);
       
   779 
       
   780       changed |= gst_registry_scan_path (default_registry, dir);
       
   781 
       
   782       g_free (dir);
       
   783       g_free (base_dir);
       
   784     }
       
   785 #endif
   770   } else {
   786   } else {
   771     gchar **list;
   787     gchar **list;
   772     gint i;
   788     gint i;
   773 
   789 
   774     GST_DEBUG ("GST_PLUGIN_SYSTEM_PATH set to %s", plugin_path);
   790     GST_DEBUG ("GST_PLUGIN_SYSTEM_PATH set to %s", plugin_path);
   786     GST_INFO ("Registry cache has not changed");
   802     GST_INFO ("Registry cache has not changed");
   787     return REGISTRY_SCAN_AND_UPDATE_SUCCESS_NOT_CHANGED;
   803     return REGISTRY_SCAN_AND_UPDATE_SUCCESS_NOT_CHANGED;
   788   }
   804   }
   789 
   805 
   790   if (!write_changes) {
   806   if (!write_changes) {
   791     GST_INFO ("Registry cached changed, but writing is disabled. Not writing.");
   807     GST_INFO ("Registry cache changed, but writing is disabled. Not writing.");
   792     return REGISTRY_SCAN_AND_UPDATE_FAILURE;
   808     return REGISTRY_SCAN_AND_UPDATE_FAILURE;
   793   }
   809   }
   794 
   810 
   795   GST_INFO ("Registry cache changed. Writing new registry cache");
   811   GST_INFO ("Registry cache changed. Writing new registry cache");
   796 #ifdef USE_BINARY_REGISTRY
       
   797   if (!gst_registry_binary_write_cache (default_registry, registry_file)) {
   812   if (!gst_registry_binary_write_cache (default_registry, registry_file)) {
   798 #else
       
   799   if (!gst_registry_xml_write_cache (default_registry, registry_file)) {
       
   800 #endif
       
   801     g_set_error (error, GST_CORE_ERROR, GST_CORE_ERROR_FAILED,
   813     g_set_error (error, GST_CORE_ERROR, GST_CORE_ERROR_FAILED,
   802         _("Error writing registry cache to %s: %s"),
   814         _("Error writing registry cache to %s: %s"),
   803         registry_file, g_strerror (errno));
   815         registry_file, g_strerror (errno));
   804     return REGISTRY_SCAN_AND_UPDATE_FAILURE;
   816     return REGISTRY_SCAN_AND_UPDATE_FAILURE;
   805   }
   817   }
   811 static gboolean
   823 static gboolean
   812 ensure_current_registry_nonforking (GstRegistry * default_registry,
   824 ensure_current_registry_nonforking (GstRegistry * default_registry,
   813     const gchar * registry_file, GError ** error)
   825     const gchar * registry_file, GError ** error)
   814 {
   826 {
   815   /* fork() not available */
   827   /* fork() not available */
   816   GST_INFO ("reading registry cache: %s", registry_file);
       
   817 #ifdef USE_BINARY_REGISTRY
       
   818   gst_registry_binary_read_cache (default_registry, registry_file);
       
   819 #else
       
   820   gst_registry_xml_read_cache (default_registry, registry_file);
       
   821 #endif
       
   822   GST_DEBUG ("Updating registry cache in-process");
   828   GST_DEBUG ("Updating registry cache in-process");
   823   scan_and_update_registry (default_registry, registry_file, TRUE, error);
   829   scan_and_update_registry (default_registry, registry_file, TRUE, error);
   824   return TRUE;
   830   return TRUE;
   825 }
   831 }
   826 
   832 
   843     g_set_error (error, GST_CORE_ERROR, GST_CORE_ERROR_FAILED,
   849     g_set_error (error, GST_CORE_ERROR, GST_CORE_ERROR_FAILED,
   844         _("Error re-scanning registry %s: %s"),
   850         _("Error re-scanning registry %s: %s"),
   845         ", could not create pipes. Error", g_strerror (errno));
   851         ", could not create pipes. Error", g_strerror (errno));
   846     return FALSE;
   852     return FALSE;
   847   }
   853   }
   848 
       
   849   GST_INFO ("reading registry cache: %s", registry_file);
       
   850 #ifdef USE_BINARY_REGISTRY
       
   851   gst_registry_binary_read_cache (default_registry, registry_file);
       
   852 #else
       
   853   gst_registry_xml_read_cache (default_registry, registry_file);
       
   854 #endif
       
   855 
   854 
   856   pid = fork ();
   855   pid = fork ();
   857   if (pid == -1) {
   856   if (pid == -1) {
   858     GST_ERROR ("Failed to fork()");
   857     GST_ERROR ("Failed to fork()");
   859     g_set_error (error, GST_CORE_ERROR, GST_CORE_ERROR_FAILED,
   858     g_set_error (error, GST_CORE_ERROR, GST_CORE_ERROR_FAILED,
   922     }
   921     }
   923 
   922 
   924     if (result_code == REGISTRY_SCAN_AND_UPDATE_SUCCESS_UPDATED) {
   923     if (result_code == REGISTRY_SCAN_AND_UPDATE_SUCCESS_UPDATED) {
   925       GST_DEBUG ("Child succeeded. Parent reading registry cache");
   924       GST_DEBUG ("Child succeeded. Parent reading registry cache");
   926       _priv_gst_registry_remove_cache_plugins (default_registry);
   925       _priv_gst_registry_remove_cache_plugins (default_registry);
   927 #ifdef USE_BINARY_REGISTRY
       
   928       gst_registry_binary_read_cache (default_registry, registry_file);
   926       gst_registry_binary_read_cache (default_registry, registry_file);
   929 #else
       
   930       gst_registry_xml_read_cache (default_registry, registry_file);
       
   931 #endif
       
   932     } else if (result_code == REGISTRY_SCAN_AND_UPDATE_FAILURE) {
   927     } else if (result_code == REGISTRY_SCAN_AND_UPDATE_FAILURE) {
   933       GST_DEBUG ("Child failed. Parent re-scanning registry, ignoring errors.");
   928       GST_DEBUG ("Child failed. Parent re-scanning registry, ignoring errors.");
   934       scan_and_update_registry (default_registry, registry_file, FALSE, NULL);
   929       scan_and_update_registry (default_registry, registry_file, FALSE, NULL);
   935     }
   930     }
   936   }
   931   }
   939 }
   934 }
   940 
   935 
   941 static gboolean
   936 static gboolean
   942 ensure_current_registry (GError ** error)
   937 ensure_current_registry (GError ** error)
   943 {
   938 {
   944   char *registry_file;
   939   gchar *registry_file;
   945   GstRegistry *default_registry;
   940   GstRegistry *default_registry;
   946   gboolean ret = TRUE;
   941   gboolean ret = TRUE;
   947   gboolean do_fork;
   942   gboolean do_fork;
   948 #ifdef __SYMBIAN32__  
       
   949   gboolean do_update;
   943   gboolean do_update;
   950   char *temp;
   944   gboolean have_cache;
   951   gboolean have_cache = FALSE;
       
   952   
       
   953 #endif
       
   954 
   945 
   955   default_registry = gst_registry_get_default ();
   946   default_registry = gst_registry_get_default ();
   956   registry_file = g_strdup (g_getenv ("GST_REGISTRY"));
   947   registry_file = g_strdup (g_getenv ("GST_REGISTRY"));
   957   if (registry_file == NULL) {
   948   if (registry_file == NULL) {
   958 #ifdef USE_BINARY_REGISTRY
       
   959 #ifdef __SYMBIAN32__  
   949 #ifdef __SYMBIAN32__  
   960     registry_file = g_build_filename (GSTREAMER_REGISTERY_PATH,
   950     registry_file = g_build_filename (GSTREAMER_REGISTERY_PATH,
   961         ".gstreamer-" GST_MAJORMINOR, "registry." HOST_CPU ".bin", NULL);
   951         ".gstreamer-" GST_MAJORMINOR, "registry." HOST_CPU ".bin", NULL);
   962     
   952     
   963     if (!g_file_test (registry_file, G_FILE_TEST_EXISTS))
   953     if (!g_file_test (registry_file, G_FILE_TEST_EXISTS))
   968 
   958 
   969 #else
   959 #else
   970     registry_file = g_build_filename (g_get_home_dir (),
   960     registry_file = g_build_filename (g_get_home_dir (),
   971         ".gstreamer-" GST_MAJORMINOR, "registry." HOST_CPU ".bin", NULL);
   961         ".gstreamer-" GST_MAJORMINOR, "registry." HOST_CPU ".bin", NULL);
   972 #endif    
   962 #endif    
   973 #else
   963   }
   974     registry_file = g_build_filename (g_get_home_dir (),
   964 
   975         ".gstreamer-" GST_MAJORMINOR, "registry." HOST_CPU ".xml", NULL);
       
   976 #endif
       
   977   }
       
   978 
       
   979 #ifdef __SYMBIAN32__
       
   980   GST_INFO ("reading registry cache: %s", registry_file);
   965   GST_INFO ("reading registry cache: %s", registry_file);
   981 #ifdef USE_BINARY_REGISTRY
       
   982   have_cache = gst_registry_binary_read_cache (default_registry, registry_file);
   966   have_cache = gst_registry_binary_read_cache (default_registry, registry_file);
   983 #else
       
   984   have_cache = gst_registry_xml_read_cache (default_registry, registry_file);
       
   985 #endif
       
   986 
   967 
   987   if (have_cache) {
   968   if (have_cache) {
   988     do_update = !_gst_disable_registry_update;
   969     do_update = !_gst_disable_registry_update;
   989     if (do_update) {
   970     if (do_update) {
   990       const gchar *update_env;
   971       const gchar *update_env;
   991 
   972 #if ((defined(__SYMBIAN32__))  && (!defined(__WINSCW__)))  
       
   973       // if GST_REGISTRY_UPDATE is not set, do_update should be FALSE, 
       
   974       // not to update by default.
       
   975       do_update = FALSE;
       
   976 #endif      
   992       if ((update_env = g_getenv ("GST_REGISTRY_UPDATE"))) {
   977       if ((update_env = g_getenv ("GST_REGISTRY_UPDATE"))) {
   993 #ifndef __WINSCW__
       
   994         /* do update for any value different from "no" */
   978         /* do update for any value different from "no" */
   995         do_update = (strcmp (update_env, "yes") == 0);
   979         do_update = (strcmp (update_env, "no") != 0);
   996 #endif
       
   997       }
   980       }
   998     }
   981     }
   999   } else {
   982   } else {
  1000     do_update = TRUE;
   983     do_update = TRUE;
  1001   }
   984   }
  1002 
   985 
  1003   if (do_update) 
   986   if (do_update) {
  1004 #endif  
       
  1005   {
       
  1006 #ifdef __SYMBIAN32__
   987 #ifdef __SYMBIAN32__
  1007     /// registry can't be created in ROM, so fixed it to GSTREAMER_REGISTERY_PATH
   988     /// registry can't be created in ROM, so fixed it to GSTREAMER_REGISTERY_PATH
  1008     registry_file = g_build_filename (GSTREAMER_REGISTERY_PATH,
   989     registry_file = g_build_filename (GSTREAMER_REGISTERY_PATH,
  1009        ".gstreamer-" GST_MAJORMINOR, "registry." HOST_CPU ".bin", NULL);
   990        ".gstreamer-" GST_MAJORMINOR, "registry." HOST_CPU ".bin", NULL);
  1010 #endif
   991 #endif
  1011   /* first see if forking is enabled */
   992     /* first see if forking is enabled */
  1012   do_fork = _gst_enable_registry_fork;
   993     do_fork = _gst_enable_registry_fork;
  1013   if (do_fork) {
   994     if (do_fork) {
  1014     const gchar *fork_env;
   995       const gchar *fork_env;
  1015 
   996 
  1016     /* forking enabled, see if it is disabled with an env var */
   997       /* forking enabled, see if it is disabled with an env var */
  1017     if ((fork_env = g_getenv ("GST_REGISTRY_FORK"))) {
   998       if ((fork_env = g_getenv ("GST_REGISTRY_FORK"))) {
  1018       /* fork enabled for any value different from "no" */
   999         /* fork enabled for any value different from "no" */
  1019       do_fork = strcmp (fork_env, "no") != 0;
  1000         do_fork = strcmp (fork_env, "no") != 0;
  1020     }
  1001       }
  1021   }
  1002     }
  1022 
  1003 
  1023   /* now check registry with or without forking */
  1004     /* now check registry with or without forking */
  1024   if (do_fork) {
  1005     if (do_fork) {
  1025     GST_DEBUG ("forking for registry rebuild");
  1006       GST_DEBUG ("forking for registry rebuild");
  1026     ret = ensure_current_registry_forking (default_registry, registry_file,
  1007       ret = ensure_current_registry_forking (default_registry, registry_file,
  1027         error);
  1008           error);
  1028   } else {
  1009     } else {
  1029     GST_DEBUG ("requested not to fork for registry rebuild");
  1010       GST_DEBUG ("requested not to fork for registry rebuild");
  1030     ret = ensure_current_registry_nonforking (default_registry, registry_file,
  1011       ret = ensure_current_registry_nonforking (default_registry, registry_file,
  1031         error);
  1012           error);
  1032   }
  1013     }
  1033   }
  1014   }
  1034 
  1015 
  1035   g_free (registry_file);
  1016   g_free (registry_file);
  1036   GST_INFO ("registry reading and updating done, result = %d", ret);
  1017   GST_INFO ("registry reading and updating done, result = %d", ret);
  1037 
  1018 
  1075   g_type_class_ref (gst_pad_get_type ());
  1056   g_type_class_ref (gst_pad_get_type ());
  1076   g_type_class_ref (gst_element_factory_get_type ());
  1057   g_type_class_ref (gst_element_factory_get_type ());
  1077   g_type_class_ref (gst_element_get_type ());
  1058   g_type_class_ref (gst_element_get_type ());
  1078   g_type_class_ref (gst_type_find_factory_get_type ());
  1059   g_type_class_ref (gst_type_find_factory_get_type ());
  1079   g_type_class_ref (gst_bin_get_type ());
  1060   g_type_class_ref (gst_bin_get_type ());
  1080 
  1061   g_type_class_ref (gst_bus_get_type ());
  1081 #ifndef GST_DISABLE_INDEX
  1062   g_type_class_ref (gst_task_get_type ());
       
  1063   g_type_class_ref (gst_clock_get_type ());
       
  1064 
  1082   g_type_class_ref (gst_index_factory_get_type ());
  1065   g_type_class_ref (gst_index_factory_get_type ());
  1083 #endif /* GST_DISABLE_INDEX */
       
  1084 #ifndef GST_DISABLE_URI
       
  1085   gst_uri_handler_get_type ();
  1066   gst_uri_handler_get_type ();
  1086 #endif /* GST_DISABLE_URI */
  1067 
       
  1068   g_type_class_ref (gst_object_flags_get_type ());
       
  1069   g_type_class_ref (gst_bin_flags_get_type ());
       
  1070   g_type_class_ref (gst_buffer_flag_get_type ());
       
  1071   g_type_class_ref (gst_buffer_copy_flags_get_type ());
       
  1072   g_type_class_ref (gst_buffer_list_item_get_type ());
       
  1073   g_type_class_ref (gst_bus_flags_get_type ());
       
  1074   g_type_class_ref (gst_bus_sync_reply_get_type ());
       
  1075   g_type_class_ref (gst_caps_flags_get_type ());
       
  1076   g_type_class_ref (gst_clock_return_get_type ());
       
  1077   g_type_class_ref (gst_clock_entry_type_get_type ());
       
  1078   g_type_class_ref (gst_clock_flags_get_type ());
       
  1079   g_type_class_ref (gst_clock_type_get_type ());
       
  1080   g_type_class_ref (gst_debug_graph_details_get_type ());
       
  1081   g_type_class_ref (gst_state_get_type ());
       
  1082   g_type_class_ref (gst_state_change_return_get_type ());
       
  1083   g_type_class_ref (gst_state_change_get_type ());
       
  1084   g_type_class_ref (gst_element_flags_get_type ());
       
  1085   g_type_class_ref (gst_core_error_get_type ());
       
  1086   g_type_class_ref (gst_library_error_get_type ());
       
  1087   g_type_class_ref (gst_resource_error_get_type ());
       
  1088   g_type_class_ref (gst_stream_error_get_type ());
       
  1089   g_type_class_ref (gst_event_type_flags_get_type ());
       
  1090   g_type_class_ref (gst_event_type_get_type ());
       
  1091   g_type_class_ref (gst_seek_type_get_type ());
       
  1092   g_type_class_ref (gst_seek_flags_get_type ());
       
  1093   g_type_class_ref (gst_format_get_type ());
       
  1094   g_type_class_ref (gst_index_certainty_get_type ());
       
  1095   g_type_class_ref (gst_index_entry_type_get_type ());
       
  1096   g_type_class_ref (gst_index_lookup_method_get_type ());
       
  1097   g_type_class_ref (gst_assoc_flags_get_type ());
       
  1098   g_type_class_ref (gst_index_resolver_method_get_type ());
       
  1099   g_type_class_ref (gst_index_flags_get_type ());
       
  1100   g_type_class_ref (gst_debug_level_get_type ());
       
  1101   g_type_class_ref (gst_debug_color_flags_get_type ());
       
  1102   g_type_class_ref (gst_iterator_result_get_type ());
       
  1103   g_type_class_ref (gst_iterator_item_get_type ());
       
  1104   g_type_class_ref (gst_message_type_get_type ());
       
  1105   g_type_class_ref (gst_mini_object_flags_get_type ());
       
  1106   g_type_class_ref (gst_pad_link_return_get_type ());
       
  1107   g_type_class_ref (gst_flow_return_get_type ());
       
  1108   g_type_class_ref (gst_activate_mode_get_type ());
       
  1109   g_type_class_ref (gst_pad_direction_get_type ());
       
  1110   g_type_class_ref (gst_pad_flags_get_type ());
       
  1111   g_type_class_ref (gst_pad_presence_get_type ());
       
  1112   g_type_class_ref (gst_pad_template_flags_get_type ());
       
  1113   g_type_class_ref (gst_pipeline_flags_get_type ());
       
  1114   g_type_class_ref (gst_plugin_error_get_type ());
       
  1115   g_type_class_ref (gst_plugin_flags_get_type ());
       
  1116   g_type_class_ref (gst_plugin_dependency_flags_get_type ());
       
  1117   g_type_class_ref (gst_rank_get_type ());
       
  1118   g_type_class_ref (gst_query_type_get_type ());
       
  1119   g_type_class_ref (gst_buffering_mode_get_type ());
       
  1120   g_type_class_ref (gst_stream_status_type_get_type ());
       
  1121   g_type_class_ref (gst_structure_change_type_get_type ());
       
  1122   g_type_class_ref (gst_tag_merge_mode_get_type ());
       
  1123   g_type_class_ref (gst_tag_flag_get_type ());
       
  1124   g_type_class_ref (gst_task_pool_get_type ());
       
  1125   g_type_class_ref (gst_task_state_get_type ());
       
  1126   g_type_class_ref (gst_alloc_trace_flags_get_type ());
       
  1127   g_type_class_ref (gst_type_find_probability_get_type ());
       
  1128   g_type_class_ref (gst_uri_type_get_type ());
       
  1129   g_type_class_ref (gst_parse_error_get_type ());
       
  1130   g_type_class_ref (gst_parse_flags_get_type ());
       
  1131   g_type_class_ref (gst_search_mode_get_type ());
  1087 
  1132 
  1088   gst_structure_get_type ();
  1133   gst_structure_get_type ();
  1089   _gst_value_initialize ();
  1134   _gst_value_initialize ();
  1090   g_type_class_ref (gst_param_spec_fraction_get_type ());
  1135   g_type_class_ref (gst_param_spec_fraction_get_type ());
  1091   gst_caps_get_type ();
  1136   gst_caps_get_type ();
  1092   _gst_event_initialize ();
  1137   _gst_event_initialize ();
  1093   _gst_buffer_initialize ();
  1138   _gst_buffer_initialize ();
       
  1139   _gst_buffer_list_initialize ();
  1094   _gst_message_initialize ();
  1140   _gst_message_initialize ();
  1095   _gst_tag_initialize ();
  1141   _gst_tag_initialize ();
  1096 
  1142 
  1097   _gst_plugin_initialize ();
  1143   _gst_plugin_initialize ();
       
  1144 
       
  1145   gst_g_error_get_type ();
  1098 
  1146 
  1099   /* register core plugins */
  1147   /* register core plugins */
  1100   gst_plugin_register_static (GST_VERSION_MAJOR, GST_VERSION_MINOR,
  1148   gst_plugin_register_static (GST_VERSION_MAJOR, GST_VERSION_MINOR,
  1101       "staticelements", "core elements linked into the GStreamer library",
  1149       "staticelements", "core elements linked into the GStreamer library",
  1102       gst_register_core_elements, VERSION, GST_LICENSE, PACKAGE,
  1150       gst_register_core_elements, VERSION, GST_LICENSE, PACKAGE,
  1177 
  1225 
  1178   while (walk) {
  1226   while (walk) {
  1179     GstDebugCategory *cat = (GstDebugCategory *) walk->data;
  1227     GstDebugCategory *cat = (GstDebugCategory *) walk->data;
  1180 
  1228 
  1181     if (gst_debug_is_colored ()) {
  1229     if (gst_debug_is_colored ()) {
       
  1230 #ifdef G_OS_WIN32
       
  1231       gint color = gst_debug_construct_win_color (cat->color);
       
  1232       const gint clear = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE;
       
  1233 
       
  1234       SetConsoleTextAttribute (GetStdHandle (STD_OUTPUT_HANDLE), color);
       
  1235       g_print ("%-20s", gst_debug_category_get_name (cat));
       
  1236       SetConsoleTextAttribute (GetStdHandle (STD_OUTPUT_HANDLE), clear);
       
  1237       g_print (" %1d %s ", gst_debug_category_get_threshold (cat),
       
  1238           gst_debug_level_get_name (gst_debug_category_get_threshold (cat)));
       
  1239       SetConsoleTextAttribute (GetStdHandle (STD_OUTPUT_HANDLE), color);
       
  1240       g_print ("%s", gst_debug_category_get_description (cat));
       
  1241       SetConsoleTextAttribute (GetStdHandle (STD_OUTPUT_HANDLE), clear);
       
  1242       g_print ("\n");
       
  1243 #else /* G_OS_WIN32 */
  1182       gchar *color = gst_debug_construct_term_color (cat->color);
  1244       gchar *color = gst_debug_construct_term_color (cat->color);
  1183 
  1245 
  1184       g_print ("%s%-20s\033[00m  %1d %s  %s%s\033[00m\n",
  1246       g_print ("%s%-20s\033[00m  %1d %s  %s%s\033[00m\n",
  1185           color,
  1247           color,
  1186           gst_debug_category_get_name (cat),
  1248           gst_debug_category_get_name (cat),
  1187           gst_debug_category_get_threshold (cat),
  1249           gst_debug_category_get_threshold (cat),
  1188           gst_debug_level_get_name (gst_debug_category_get_threshold (cat)),
  1250           gst_debug_level_get_name (gst_debug_category_get_threshold (cat)),
  1189           color, gst_debug_category_get_description (cat));
  1251           color, gst_debug_category_get_description (cat));
  1190       g_free (color);
  1252       g_free (color);
       
  1253 #endif /* G_OS_WIN32 */
  1191     } else {
  1254     } else {
  1192       g_print ("%-20s  %1d %s  %s\n", gst_debug_category_get_name (cat),
  1255       g_print ("%-20s  %1d %s  %s\n", gst_debug_category_get_name (cat),
  1193           gst_debug_category_get_threshold (cat),
  1256           gst_debug_category_get_threshold (cat),
  1194           gst_debug_level_get_name (gst_debug_category_get_threshold (cat)),
  1257           gst_debug_level_get_name (gst_debug_category_get_threshold (cat)),
  1195           gst_debug_category_get_description (cat));
  1258           gst_debug_category_get_description (cat));
  1251       split_and_iterate (arg, ",", prepare_for_load_plugin_func, NULL);
  1314       split_and_iterate (arg, ",", prepare_for_load_plugin_func, NULL);
  1252       break;
  1315       break;
  1253     case ARG_SEGTRAP_DISABLE:
  1316     case ARG_SEGTRAP_DISABLE:
  1254       _gst_disable_segtrap = TRUE;
  1317       _gst_disable_segtrap = TRUE;
  1255       break;
  1318       break;
  1256 #ifdef __SYMBIAN32__	  
       
  1257     case ARG_REGISTRY_UPDATE_DISABLE:
  1319     case ARG_REGISTRY_UPDATE_DISABLE:
  1258       _gst_disable_registry_update = TRUE;
  1320       _gst_disable_registry_update = TRUE;
  1259       break;
  1321       break;
  1260 #endif	  
       
  1261     case ARG_REGISTRY_FORK_DISABLE:
  1322     case ARG_REGISTRY_FORK_DISABLE:
  1262       _gst_enable_registry_fork = FALSE;
  1323       _gst_enable_registry_fork = FALSE;
  1263       break;
  1324       break;
  1264     default:
  1325     default:
  1265       g_set_error (err, G_OPTION_ERROR, G_OPTION_ERROR_UNKNOWN_OPTION,
  1326       g_set_error (err, G_OPTION_ERROR, G_OPTION_ERROR_UNKNOWN_OPTION,
  1293     {
  1354     {
  1294     "--gst-plugin-spew", ARG_PLUGIN_SPEW}, {
  1355     "--gst-plugin-spew", ARG_PLUGIN_SPEW}, {
  1295     "--gst-plugin-path", ARG_PLUGIN_PATH}, {
  1356     "--gst-plugin-path", ARG_PLUGIN_PATH}, {
  1296     "--gst-plugin-load", ARG_PLUGIN_LOAD}, {
  1357     "--gst-plugin-load", ARG_PLUGIN_LOAD}, {
  1297     "--gst-disable-segtrap", ARG_SEGTRAP_DISABLE}, {
  1358     "--gst-disable-segtrap", ARG_SEGTRAP_DISABLE}, {
  1298 #ifdef __SYMBIAN32__	
       
  1299     "--gst-disable-registry-update", ARG_REGISTRY_UPDATE_DISABLE}, {
  1359     "--gst-disable-registry-update", ARG_REGISTRY_UPDATE_DISABLE}, {
  1300 #endif    
  1360     "--gst-disable-registry-fork", ARG_REGISTRY_FORK_DISABLE}, {
  1301 	"--gst-disable-registry-fork", ARG_REGISTRY_FORK_DISABLE}, {
       
  1302     NULL}
  1361     NULL}
  1303   };
  1362   };
  1304   gint val = 0, n;
  1363   gint val = 0, n;
  1305 
  1364 
  1306   for (n = 0; options[n].opt; n++) {
  1365   for (n = 0; options[n].opt; n++) {
  1364   g_type_class_unref (g_type_class_peek (gst_pad_get_type ()));
  1423   g_type_class_unref (g_type_class_peek (gst_pad_get_type ()));
  1365   g_type_class_unref (g_type_class_peek (gst_element_factory_get_type ()));
  1424   g_type_class_unref (g_type_class_peek (gst_element_factory_get_type ()));
  1366   g_type_class_unref (g_type_class_peek (gst_element_get_type ()));
  1425   g_type_class_unref (g_type_class_peek (gst_element_get_type ()));
  1367   g_type_class_unref (g_type_class_peek (gst_type_find_factory_get_type ()));
  1426   g_type_class_unref (g_type_class_peek (gst_type_find_factory_get_type ()));
  1368   g_type_class_unref (g_type_class_peek (gst_bin_get_type ()));
  1427   g_type_class_unref (g_type_class_peek (gst_bin_get_type ()));
  1369 #ifndef GST_DISABLE_INDEX
  1428   g_type_class_unref (g_type_class_peek (gst_bus_get_type ()));
       
  1429   g_type_class_unref (g_type_class_peek (gst_task_get_type ()));
  1370   g_type_class_unref (g_type_class_peek (gst_index_factory_get_type ()));
  1430   g_type_class_unref (g_type_class_peek (gst_index_factory_get_type ()));
  1371 #endif /* GST_DISABLE_INDEX */
  1431   g_type_class_unref (g_type_class_peek (gst_object_flags_get_type ()));
       
  1432   g_type_class_unref (g_type_class_peek (gst_bin_flags_get_type ()));
       
  1433   g_type_class_unref (g_type_class_peek (gst_buffer_flag_get_type ()));
       
  1434   g_type_class_unref (g_type_class_peek (gst_buffer_copy_flags_get_type ()));
       
  1435   g_type_class_unref (g_type_class_peek (gst_buffer_list_item_get_type ()));
       
  1436   g_type_class_unref (g_type_class_peek (gst_bus_flags_get_type ()));
       
  1437   g_type_class_unref (g_type_class_peek (gst_bus_sync_reply_get_type ()));
       
  1438   g_type_class_unref (g_type_class_peek (gst_caps_flags_get_type ()));
       
  1439   g_type_class_unref (g_type_class_peek (gst_clock_type_get_type ()));
       
  1440   g_type_class_unref (g_type_class_peek (gst_clock_return_get_type ()));
       
  1441   g_type_class_unref (g_type_class_peek (gst_clock_entry_type_get_type ()));
       
  1442   g_type_class_unref (g_type_class_peek (gst_clock_flags_get_type ()));
       
  1443   g_type_class_unref (g_type_class_peek (gst_debug_graph_details_get_type ()));
       
  1444   g_type_class_unref (g_type_class_peek (gst_state_get_type ()));
       
  1445   g_type_class_unref (g_type_class_peek (gst_state_change_return_get_type ()));
       
  1446   g_type_class_unref (g_type_class_peek (gst_state_change_get_type ()));
       
  1447   g_type_class_unref (g_type_class_peek (gst_element_flags_get_type ()));
       
  1448   g_type_class_unref (g_type_class_peek (gst_core_error_get_type ()));
       
  1449   g_type_class_unref (g_type_class_peek (gst_library_error_get_type ()));
       
  1450   g_type_class_unref (g_type_class_peek (gst_plugin_dependency_flags_get_type
       
  1451           ()));
       
  1452   g_type_class_unref (g_type_class_peek (gst_parse_flags_get_type ()));
       
  1453   g_type_class_unref (g_type_class_peek (gst_resource_error_get_type ()));
       
  1454   g_type_class_unref (g_type_class_peek (gst_search_mode_get_type ()));
       
  1455   g_type_class_unref (g_type_class_peek (gst_stream_error_get_type ()));
       
  1456   g_type_class_unref (g_type_class_peek (gst_stream_status_type_get_type ()));
       
  1457   g_type_class_unref (g_type_class_peek (gst_structure_change_type_get_type
       
  1458           ()));
       
  1459   g_type_class_unref (g_type_class_peek (gst_event_type_flags_get_type ()));
       
  1460   g_type_class_unref (g_type_class_peek (gst_event_type_get_type ()));
       
  1461   g_type_class_unref (g_type_class_peek (gst_seek_type_get_type ()));
       
  1462   g_type_class_unref (g_type_class_peek (gst_seek_flags_get_type ()));
       
  1463   g_type_class_unref (g_type_class_peek (gst_format_get_type ()));
       
  1464   g_type_class_unref (g_type_class_peek (gst_index_certainty_get_type ()));
       
  1465   g_type_class_unref (g_type_class_peek (gst_index_entry_type_get_type ()));
       
  1466   g_type_class_unref (g_type_class_peek (gst_index_lookup_method_get_type ()));
       
  1467   g_type_class_unref (g_type_class_peek (gst_assoc_flags_get_type ()));
       
  1468   g_type_class_unref (g_type_class_peek (gst_index_resolver_method_get_type
       
  1469           ()));
       
  1470   g_type_class_unref (g_type_class_peek (gst_index_flags_get_type ()));
       
  1471   g_type_class_unref (g_type_class_peek (gst_debug_level_get_type ()));
       
  1472   g_type_class_unref (g_type_class_peek (gst_debug_color_flags_get_type ()));
       
  1473   g_type_class_unref (g_type_class_peek (gst_iterator_result_get_type ()));
       
  1474   g_type_class_unref (g_type_class_peek (gst_iterator_item_get_type ()));
       
  1475   g_type_class_unref (g_type_class_peek (gst_message_type_get_type ()));
       
  1476   g_type_class_unref (g_type_class_peek (gst_mini_object_flags_get_type ()));
       
  1477   g_type_class_unref (g_type_class_peek (gst_pad_link_return_get_type ()));
       
  1478   g_type_class_unref (g_type_class_peek (gst_flow_return_get_type ()));
       
  1479   g_type_class_unref (g_type_class_peek (gst_activate_mode_get_type ()));
       
  1480   g_type_class_unref (g_type_class_peek (gst_pad_direction_get_type ()));
       
  1481   g_type_class_unref (g_type_class_peek (gst_pad_flags_get_type ()));
       
  1482   g_type_class_unref (g_type_class_peek (gst_pad_presence_get_type ()));
       
  1483   g_type_class_unref (g_type_class_peek (gst_pad_template_flags_get_type ()));
       
  1484   g_type_class_unref (g_type_class_peek (gst_pipeline_flags_get_type ()));
       
  1485   g_type_class_unref (g_type_class_peek (gst_plugin_error_get_type ()));
       
  1486   g_type_class_unref (g_type_class_peek (gst_plugin_flags_get_type ()));
       
  1487   g_type_class_unref (g_type_class_peek (gst_rank_get_type ()));
       
  1488   g_type_class_unref (g_type_class_peek (gst_query_type_get_type ()));
       
  1489   g_type_class_unref (g_type_class_peek (gst_buffering_mode_get_type ()));
       
  1490   g_type_class_unref (g_type_class_peek (gst_tag_merge_mode_get_type ()));
       
  1491   g_type_class_unref (g_type_class_peek (gst_tag_flag_get_type ()));
       
  1492   g_type_class_unref (g_type_class_peek (gst_task_state_get_type ()));
       
  1493   g_type_class_unref (g_type_class_peek (gst_alloc_trace_flags_get_type ()));
       
  1494   g_type_class_unref (g_type_class_peek (gst_type_find_probability_get_type
       
  1495           ()));
       
  1496   g_type_class_unref (g_type_class_peek (gst_uri_type_get_type ()));
       
  1497   g_type_class_unref (g_type_class_peek (gst_parse_error_get_type ()));
  1372   g_type_class_unref (g_type_class_peek (gst_param_spec_fraction_get_type ()));
  1498   g_type_class_unref (g_type_class_peek (gst_param_spec_fraction_get_type ()));
  1373 
  1499 
  1374   gst_deinitialized = TRUE;
  1500   gst_deinitialized = TRUE;
  1375   GST_INFO ("deinitialized GStreamer");
  1501   GST_INFO ("deinitialized GStreamer");
  1376 }
  1502 }
  1422 
  1548 
  1423   gst_version (&major, &minor, &micro, &nano);
  1549   gst_version (&major, &minor, &micro, &nano);
  1424   if (nano == 0)
  1550   if (nano == 0)
  1425     return g_strdup_printf ("GStreamer %d.%d.%d", major, minor, micro);
  1551     return g_strdup_printf ("GStreamer %d.%d.%d", major, minor, micro);
  1426   else if (nano == 1)
  1552   else if (nano == 1)
  1427     return g_strdup_printf ("GStreamer %d.%d.%d (CVS)", major, minor, micro);
  1553     return g_strdup_printf ("GStreamer %d.%d.%d (GIT)", major, minor, micro);
  1428   else
  1554   else
  1429     return g_strdup_printf ("GStreamer %d.%d.%d (prerelease)", major, minor,
  1555     return g_strdup_printf ("GStreamer %d.%d.%d (prerelease)", major, minor,
  1430         micro);
  1556         micro);
  1431 }
  1557 }
  1432 
  1558