gstreamer_core/gst/gst.c
branchRCL_3
changeset 8 7e817e7e631c
parent 7 567bb019e3e3
equal deleted inserted replaced
7:567bb019e3e3 8:7e817e7e631c
   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"
       
   108 #include <stdlib.h>
   107 #include <stdlib.h>
   109 #include <stdio.h>
   108 #include <stdio.h>
   110 #include <sys/types.h>
   109 #include <sys/types.h>
   111 #ifdef HAVE_FORK
   110 #ifdef HAVE_FORK
   112 #include <sys/wait.h>
   111 #include <sys/wait.h>
   115 #include <sys/utsname.h>
   114 #include <sys/utsname.h>
   116 #endif
   115 #endif
   117 #ifdef HAVE_UNISTD_H
   116 #ifdef HAVE_UNISTD_H
   118 #include <unistd.h>
   117 #include <unistd.h>
   119 #endif
   118 #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
       
   124 
   119 
   125 #include "gst-i18n-lib.h"
   120 #include "gst-i18n-lib.h"
   126 #include <locale.h>             /* for LC_ALL */
   121 #include <locale.h>             /* for LC_ALL */
   127 
   122 
   128 #include "gst.h"
   123 #include "gst.h"
   129 
   124 
   130 #ifdef __SYMBIAN32__
   125 #ifdef __SYMBIAN32__
   131 #include <glib_global.h>
   126 #include <glib_global.h>
   132 #include <gst_global.h>
       
   133 #include <config.h>
   127 #include <config.h>
       
   128 #include <string.h>
   134 #endif
   129 #endif
   135 
   130 
   136 #define GST_CAT_DEFAULT GST_CAT_GST_INIT
   131 #define GST_CAT_DEFAULT GST_CAT_GST_INIT
   137 
   132 
   138 #define MAX_PATH_SPLIT  16
   133 #define MAX_PATH_SPLIT  16
   139 #define GST_PLUGIN_SEPARATOR ","
   134 #define GST_PLUGIN_SEPARATOR ","
   140 
   135 
   141 static gboolean gst_initialized = FALSE;
   136 static gboolean gst_initialized = FALSE;
   142 static gboolean gst_deinitialized = FALSE;
   137 static gboolean gst_deinitialized = FALSE;
   143 
   138 
   144 #ifdef G_OS_WIN32
       
   145 static HMODULE gst_dll_handle = NULL;
       
   146 #endif
       
   147 
       
   148 #ifndef GST_DISABLE_REGISTRY
   139 #ifndef GST_DISABLE_REGISTRY
   149 static GList *plugin_paths = NULL;      /* for delayed processing in post_init */
   140 static GList *plugin_paths = NULL;      /* for delayed processing in post_init */
   150 #endif
   141 #endif
   151 
   142 
   152 #ifndef GST_DISABLE_GST_DEBUG
   143 #ifndef GST_DISABLE_GST_DEBUG
   153 extern const gchar *priv_gst_dump_dot_dir;
   144 extern const gchar *priv_gst_dump_dot_dir;
   154 #endif
   145 #endif
   155 
   146 
   156 /* defaults */
   147 /* defaults */
   157 #if defined(HAVE_FORK) && !defined(GST_HAVE_UNSAFE_FORK)
   148 #ifdef HAVE_FORK
   158 #define DEFAULT_FORK TRUE
   149 #define DEFAULT_FORK TRUE
   159 #else
   150 #else
   160 #define DEFAULT_FORK FALSE
   151 #define DEFAULT_FORK FALSE
   161 #endif /* HAVE_FORK */
   152 #endif /* HAVE_FORK */
   162 
   153 
   164 static gboolean _gst_disable_segtrap = FALSE;
   155 static gboolean _gst_disable_segtrap = FALSE;
   165 
   156 
   166 /* control the behaviour of registry rebuild */
   157 /* control the behaviour of registry rebuild */
   167 static gboolean _gst_enable_registry_fork = DEFAULT_FORK;
   158 static gboolean _gst_enable_registry_fork = DEFAULT_FORK;
   168 
   159 
       
   160 #ifdef __SYMBIAN32__
   169 /*set to TRUE when registry needn't to be updated */
   161 /*set to TRUE when registry needn't to be updated */
   170 static gboolean _gst_disable_registry_update = FALSE;
   162 static gboolean _gst_disable_registry_update = FALSE;
       
   163 #endif
   171 
   164 
   172 static void load_plugin_func (gpointer data, gpointer user_data);
   165 static void load_plugin_func (gpointer data, gpointer user_data);
   173 static gboolean init_pre (GOptionContext * context, GOptionGroup * group,
   166 static gboolean init_pre (GOptionContext * context, GOptionGroup * group,
   174     gpointer data, GError ** error);
   167     gpointer data, GError ** error);
   175 static gboolean init_post (GOptionContext * context, GOptionGroup * group,
   168 static gboolean init_post (GOptionContext * context, GOptionGroup * group,
   206 #endif
   199 #endif
   207   ARG_PLUGIN_SPEW,
   200   ARG_PLUGIN_SPEW,
   208   ARG_PLUGIN_PATH,
   201   ARG_PLUGIN_PATH,
   209   ARG_PLUGIN_LOAD,
   202   ARG_PLUGIN_LOAD,
   210   ARG_SEGTRAP_DISABLE,
   203   ARG_SEGTRAP_DISABLE,
       
   204 #ifdef __SYMBIAN32__
   211   ARG_REGISTRY_UPDATE_DISABLE,
   205   ARG_REGISTRY_UPDATE_DISABLE,
       
   206 #endif
   212   ARG_REGISTRY_FORK_DISABLE
   207   ARG_REGISTRY_FORK_DISABLE
   213 };
   208 };
   214 
   209 
   215 /* debug-spec ::= category-spec [, category-spec]*
   210 /* debug-spec ::= category-spec [, category-spec]*
   216  * category-spec ::= category:val | val
   211  * category-spec ::= category:val | val
   292 
   287 
   293   g_strfreev (split);
   288   g_strfreev (split);
   294 }
   289 }
   295 #endif
   290 #endif
   296 
   291 
   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 
       
   308 /**
   292 /**
   309  * gst_init_get_option_group:
   293  * gst_init_get_option_group:
   310  *
   294  *
   311  * Returns a #GOptionGroup with GStreamer's argument specifications. The
   295  * Returns a #GOptionGroup with GStreamer's argument specifications. The
   312  * group is set up to use standard GOption callbacks, so when using this
   296  * group is set up to use standard GOption callbacks, so when using this
   330 GOptionGroup *
   314 GOptionGroup *
   331 gst_init_get_option_group (void)
   315 gst_init_get_option_group (void)
   332 {
   316 {
   333 #ifndef GST_DISABLE_OPTION_PARSING
   317 #ifndef GST_DISABLE_OPTION_PARSING
   334   GOptionGroup *group;
   318   GOptionGroup *group;
   335   static const GOptionEntry gst_args[] = {
   319   const static GOptionEntry gst_args[] = {
   336     {"gst-version", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
   320     {"gst-version", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
   337         (gpointer) parse_goption_arg, N_("Print the GStreamer version"), NULL},
   321         (gpointer) parse_goption_arg, N_("Print the GStreamer version"), NULL},
   338     {"gst-fatal-warnings", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
   322     {"gst-fatal-warnings", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
   339         (gpointer) parse_goption_arg, N_("Make all warnings fatal"), NULL},
   323         (gpointer) parse_goption_arg, N_("Make all warnings fatal"), NULL},
   340 #ifndef GST_DISABLE_GST_DEBUG
   324 #ifndef GST_DISABLE_GST_DEBUG
   372         N_("PLUGINS")},
   356         N_("PLUGINS")},
   373     {"gst-disable-segtrap", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
   357     {"gst-disable-segtrap", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
   374           (gpointer) parse_goption_arg,
   358           (gpointer) parse_goption_arg,
   375           N_("Disable trapping of segmentation faults during plugin loading"),
   359           N_("Disable trapping of segmentation faults during plugin loading"),
   376         NULL},
   360         NULL},
       
   361 #ifdef __SYMBIAN32__		
   377     {"gst-disable-registry-update", 0, G_OPTION_FLAG_NO_ARG,
   362     {"gst-disable-registry-update", 0, G_OPTION_FLAG_NO_ARG,
   378           G_OPTION_ARG_CALLBACK,
   363           G_OPTION_ARG_CALLBACK,
   379           (gpointer) parse_goption_arg,
   364           (gpointer) parse_goption_arg,
   380           N_("Disable updating the registry"),
   365           N_("Disable updating the registry"),
   381         NULL},
   366         NULL},
       
   367 #endif		
   382     {"gst-disable-registry-fork", 0, G_OPTION_FLAG_NO_ARG,
   368     {"gst-disable-registry-fork", 0, G_OPTION_FLAG_NO_ARG,
   383           G_OPTION_ARG_CALLBACK,
   369           G_OPTION_ARG_CALLBACK,
   384           (gpointer) parse_goption_arg,
   370           (gpointer) parse_goption_arg,
   385           N_("Disable the use of fork() while scanning the registry"),
   371           N_("Disable the use of fork() while scanning the registry"),
   386         NULL},
   372         NULL},
   447   GOptionGroup *group;
   433   GOptionGroup *group;
   448   GOptionContext *ctx;
   434   GOptionContext *ctx;
   449 #endif
   435 #endif
   450   gboolean res;
   436   gboolean res;
   451 
   437 
       
   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 
   452   if (!g_thread_supported ())
   470   if (!g_thread_supported ())
   453     g_thread_init (NULL);
   471     g_thread_init (NULL);
   454 
   472 
   455   if (gst_initialized) {
   473   if (gst_initialized) {
   456     GST_DEBUG ("already initialized gst");
   474     GST_DEBUG ("already initialized gst");
   619   _gst_debug_init ();
   637   _gst_debug_init ();
   620 
   638 
   621 #ifdef ENABLE_NLS
   639 #ifdef ENABLE_NLS
   622   setlocale (LC_ALL, "");
   640   setlocale (LC_ALL, "");
   623   bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
   641   bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
   624   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
       
   625 #endif /* ENABLE_NLS */
   642 #endif /* ENABLE_NLS */
   626 
   643 
   627 #ifndef GST_DISABLE_GST_DEBUG
   644 #ifndef GST_DISABLE_GST_DEBUG
   628   {
   645   {
   629     const gchar *debug_list;
   646     const gchar *debug_list;
   702 {
   719 {
   703   const gchar *plugin_path;
   720   const gchar *plugin_path;
   704   gboolean changed = FALSE;
   721   gboolean changed = FALSE;
   705   GList *l;
   722   GList *l;
   706 
   723 
   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 
       
   713   /* scan paths specified via --gst-plugin-path */
   724   /* scan paths specified via --gst-plugin-path */
   714   GST_DEBUG ("scanning paths added via --gst-plugin-path");
   725   GST_DEBUG ("scanning paths added via --gst-plugin-path");
   715   for (l = plugin_paths; l != NULL; l = l->next) {
   726   for (l = plugin_paths; l != NULL; l = l->next) {
   716     GST_INFO ("Scanning plugin path: \"%s\"", (gchar *) l->data);
   727     GST_INFO ("Scanning plugin path: \"%s\"", (gchar *) l->data);
   717     changed |= gst_registry_scan_path (default_registry, (gchar *) l->data);
   728     /* CHECKME: add changed |= here as well? */
       
   729     gst_registry_scan_path (default_registry, (gchar *) l->data);
   718   }
   730   }
   719   /* keep plugin_paths around in case a re-scan is forced later on */
   731   /* keep plugin_paths around in case a re-scan is forced later on */
   720 
   732 
   721   /* GST_PLUGIN_PATH specifies a list of directories to scan for
   733   /* GST_PLUGIN_PATH specifies a list of directories to scan for
   722    * additional plugins.  These take precedence over the system plugins */
   734    * additional plugins.  These take precedence over the system plugins */
   739    * loaded by default.  If not set, this defaults to the system-installed
   751    * loaded by default.  If not set, this defaults to the system-installed
   740    * path, and the plugins installed in the user's home directory */
   752    * path, and the plugins installed in the user's home directory */
   741   plugin_path = g_getenv ("GST_PLUGIN_SYSTEM_PATH");
   753   plugin_path = g_getenv ("GST_PLUGIN_SYSTEM_PATH");
   742   if (plugin_path == NULL) {
   754   if (plugin_path == NULL) {
   743     char *home_plugins;
   755     char *home_plugins;
   744 #ifdef __SYMBIAN32__
   756 
   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
       
   753     GST_DEBUG ("GST_PLUGIN_SYSTEM_PATH not set");
   757     GST_DEBUG ("GST_PLUGIN_SYSTEM_PATH not set");
   754 
   758 
   755     /* plugins in the user's home directory take precedence over
   759     /* plugins in the user's home directory take precedence over
   756      * system-installed ones */
   760      * system-installed ones */
   757     home_plugins = g_build_filename (g_get_home_dir (),
   761     home_plugins = g_build_filename (g_get_home_dir (),
   758         ".gstreamer-" GST_MAJORMINOR, "plugins", NULL);
   762         ".gstreamer-" GST_MAJORMINOR, "plugins", NULL);
   759     GST_DEBUG ("scanning home plugins %s", home_plugins);
   763     GST_DEBUG ("scanning home plugins %s", home_plugins);
   760     changed |= gst_registry_scan_path (default_registry, home_plugins);
   764     changed |= gst_registry_scan_path (default_registry, home_plugins);
   761     g_free (home_plugins);
   765     g_free (home_plugins);
   762 
   766 
   763 
       
   764     
       
   765     /* add the main (installed) library path */
   767     /* add the main (installed) library path */
   766     GST_DEBUG ("scanning main plugins %s", PLUGINDIR);
   768     GST_DEBUG ("scanning main plugins %s", PLUGINDIR);
   767     changed |= gst_registry_scan_path (default_registry, PLUGINDIR);
   769     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
       
   786   } else {
   770   } else {
   787     gchar **list;
   771     gchar **list;
   788     gint i;
   772     gint i;
   789 
   773 
   790     GST_DEBUG ("GST_PLUGIN_SYSTEM_PATH set to %s", plugin_path);
   774     GST_DEBUG ("GST_PLUGIN_SYSTEM_PATH set to %s", plugin_path);
   802     GST_INFO ("Registry cache has not changed");
   786     GST_INFO ("Registry cache has not changed");
   803     return REGISTRY_SCAN_AND_UPDATE_SUCCESS_NOT_CHANGED;
   787     return REGISTRY_SCAN_AND_UPDATE_SUCCESS_NOT_CHANGED;
   804   }
   788   }
   805 
   789 
   806   if (!write_changes) {
   790   if (!write_changes) {
   807     GST_INFO ("Registry cache changed, but writing is disabled. Not writing.");
   791     GST_INFO ("Registry cached changed, but writing is disabled. Not writing.");
   808     return REGISTRY_SCAN_AND_UPDATE_FAILURE;
   792     return REGISTRY_SCAN_AND_UPDATE_FAILURE;
   809   }
   793   }
   810 
   794 
   811   GST_INFO ("Registry cache changed. Writing new registry cache");
   795   GST_INFO ("Registry cache changed. Writing new registry cache");
       
   796 #ifdef USE_BINARY_REGISTRY
   812   if (!gst_registry_binary_write_cache (default_registry, registry_file)) {
   797   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
   813     g_set_error (error, GST_CORE_ERROR, GST_CORE_ERROR_FAILED,
   801     g_set_error (error, GST_CORE_ERROR, GST_CORE_ERROR_FAILED,
   814         _("Error writing registry cache to %s: %s"),
   802         _("Error writing registry cache to %s: %s"),
   815         registry_file, g_strerror (errno));
   803         registry_file, g_strerror (errno));
   816     return REGISTRY_SCAN_AND_UPDATE_FAILURE;
   804     return REGISTRY_SCAN_AND_UPDATE_FAILURE;
   817   }
   805   }
   823 static gboolean
   811 static gboolean
   824 ensure_current_registry_nonforking (GstRegistry * default_registry,
   812 ensure_current_registry_nonforking (GstRegistry * default_registry,
   825     const gchar * registry_file, GError ** error)
   813     const gchar * registry_file, GError ** error)
   826 {
   814 {
   827   /* fork() not available */
   815   /* 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
   828   GST_DEBUG ("Updating registry cache in-process");
   822   GST_DEBUG ("Updating registry cache in-process");
   829   scan_and_update_registry (default_registry, registry_file, TRUE, error);
   823   scan_and_update_registry (default_registry, registry_file, TRUE, error);
   830   return TRUE;
   824   return TRUE;
   831 }
   825 }
   832 
   826 
   849     g_set_error (error, GST_CORE_ERROR, GST_CORE_ERROR_FAILED,
   843     g_set_error (error, GST_CORE_ERROR, GST_CORE_ERROR_FAILED,
   850         _("Error re-scanning registry %s: %s"),
   844         _("Error re-scanning registry %s: %s"),
   851         ", could not create pipes. Error", g_strerror (errno));
   845         ", could not create pipes. Error", g_strerror (errno));
   852     return FALSE;
   846     return FALSE;
   853   }
   847   }
       
   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
   854 
   855 
   855   pid = fork ();
   856   pid = fork ();
   856   if (pid == -1) {
   857   if (pid == -1) {
   857     GST_ERROR ("Failed to fork()");
   858     GST_ERROR ("Failed to fork()");
   858     g_set_error (error, GST_CORE_ERROR, GST_CORE_ERROR_FAILED,
   859     g_set_error (error, GST_CORE_ERROR, GST_CORE_ERROR_FAILED,
   921     }
   922     }
   922 
   923 
   923     if (result_code == REGISTRY_SCAN_AND_UPDATE_SUCCESS_UPDATED) {
   924     if (result_code == REGISTRY_SCAN_AND_UPDATE_SUCCESS_UPDATED) {
   924       GST_DEBUG ("Child succeeded. Parent reading registry cache");
   925       GST_DEBUG ("Child succeeded. Parent reading registry cache");
   925       _priv_gst_registry_remove_cache_plugins (default_registry);
   926       _priv_gst_registry_remove_cache_plugins (default_registry);
       
   927 #ifdef USE_BINARY_REGISTRY
   926       gst_registry_binary_read_cache (default_registry, registry_file);
   928       gst_registry_binary_read_cache (default_registry, registry_file);
       
   929 #else
       
   930       gst_registry_xml_read_cache (default_registry, registry_file);
       
   931 #endif
   927     } else if (result_code == REGISTRY_SCAN_AND_UPDATE_FAILURE) {
   932     } else if (result_code == REGISTRY_SCAN_AND_UPDATE_FAILURE) {
   928       GST_DEBUG ("Child failed. Parent re-scanning registry, ignoring errors.");
   933       GST_DEBUG ("Child failed. Parent re-scanning registry, ignoring errors.");
   929       scan_and_update_registry (default_registry, registry_file, FALSE, NULL);
   934       scan_and_update_registry (default_registry, registry_file, FALSE, NULL);
   930     }
   935     }
   931   }
   936   }
   934 }
   939 }
   935 
   940 
   936 static gboolean
   941 static gboolean
   937 ensure_current_registry (GError ** error)
   942 ensure_current_registry (GError ** error)
   938 {
   943 {
   939   gchar *registry_file;
   944   char *registry_file;
   940   GstRegistry *default_registry;
   945   GstRegistry *default_registry;
   941   gboolean ret = TRUE;
   946   gboolean ret = TRUE;
   942   gboolean do_fork;
   947   gboolean do_fork;
       
   948 #ifdef __SYMBIAN32__  
   943   gboolean do_update;
   949   gboolean do_update;
   944   gboolean have_cache;
   950   char *temp;
       
   951   gboolean have_cache = FALSE;
       
   952   
       
   953 #endif
   945 
   954 
   946   default_registry = gst_registry_get_default ();
   955   default_registry = gst_registry_get_default ();
   947   registry_file = g_strdup (g_getenv ("GST_REGISTRY"));
   956   registry_file = g_strdup (g_getenv ("GST_REGISTRY"));
   948   if (registry_file == NULL) {
   957   if (registry_file == NULL) {
       
   958 #ifdef USE_BINARY_REGISTRY
   949 #ifdef __SYMBIAN32__  
   959 #ifdef __SYMBIAN32__  
   950     registry_file = g_build_filename (GSTREAMER_REGISTERY_PATH,
   960     registry_file = g_build_filename (GSTREAMER_REGISTERY_PATH,
   951         ".gstreamer-" GST_MAJORMINOR, "registry." HOST_CPU ".bin", NULL);
   961         ".gstreamer-" GST_MAJORMINOR, "registry." HOST_CPU ".bin", NULL);
   952     
   962     
   953     if (!g_file_test (registry_file, G_FILE_TEST_EXISTS))
   963     if (!g_file_test (registry_file, G_FILE_TEST_EXISTS))
   958 
   968 
   959 #else
   969 #else
   960     registry_file = g_build_filename (g_get_home_dir (),
   970     registry_file = g_build_filename (g_get_home_dir (),
   961         ".gstreamer-" GST_MAJORMINOR, "registry." HOST_CPU ".bin", NULL);
   971         ".gstreamer-" GST_MAJORMINOR, "registry." HOST_CPU ".bin", NULL);
   962 #endif    
   972 #endif    
   963   }
   973 #else
   964 
   974     registry_file = g_build_filename (g_get_home_dir (),
       
   975         ".gstreamer-" GST_MAJORMINOR, "registry." HOST_CPU ".xml", NULL);
       
   976 #endif
       
   977   }
       
   978 
       
   979 #ifdef __SYMBIAN32__
   965   GST_INFO ("reading registry cache: %s", registry_file);
   980   GST_INFO ("reading registry cache: %s", registry_file);
       
   981 #ifdef USE_BINARY_REGISTRY
   966   have_cache = gst_registry_binary_read_cache (default_registry, registry_file);
   982   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
   967 
   986 
   968   if (have_cache) {
   987   if (have_cache) {
   969     do_update = !_gst_disable_registry_update;
   988     do_update = !_gst_disable_registry_update;
   970     if (do_update) {
   989     if (do_update) {
   971       const gchar *update_env;
   990       const gchar *update_env;
   972 #if ((defined(__SYMBIAN32__))  && (!defined(__WINSCW__)))  
   991 
   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      
       
   977       if ((update_env = g_getenv ("GST_REGISTRY_UPDATE"))) {
   992       if ((update_env = g_getenv ("GST_REGISTRY_UPDATE"))) {
       
   993 #ifndef __WINSCW__
   978         /* do update for any value different from "no" */
   994         /* do update for any value different from "no" */
   979         do_update = (strcmp (update_env, "no") != 0);
   995         do_update = (strcmp (update_env, "yes") == 0);
       
   996 #endif
   980       }
   997       }
   981     }
   998     }
   982   } else {
   999   } else {
   983     do_update = TRUE;
  1000     do_update = TRUE;
   984   }
  1001   }
   985 
  1002 
   986   if (do_update) {
  1003   if (do_update) 
       
  1004 #endif  
       
  1005   {
   987 #ifdef __SYMBIAN32__
  1006 #ifdef __SYMBIAN32__
   988     /// registry can't be created in ROM, so fixed it to GSTREAMER_REGISTERY_PATH
  1007     /// registry can't be created in ROM, so fixed it to GSTREAMER_REGISTERY_PATH
   989     registry_file = g_build_filename (GSTREAMER_REGISTERY_PATH,
  1008     registry_file = g_build_filename (GSTREAMER_REGISTERY_PATH,
   990        ".gstreamer-" GST_MAJORMINOR, "registry." HOST_CPU ".bin", NULL);
  1009        ".gstreamer-" GST_MAJORMINOR, "registry." HOST_CPU ".bin", NULL);
   991 #endif
  1010 #endif
   992     /* first see if forking is enabled */
  1011   /* first see if forking is enabled */
   993     do_fork = _gst_enable_registry_fork;
  1012   do_fork = _gst_enable_registry_fork;
   994     if (do_fork) {
  1013   if (do_fork) {
   995       const gchar *fork_env;
  1014     const gchar *fork_env;
   996 
  1015 
   997       /* forking enabled, see if it is disabled with an env var */
  1016     /* forking enabled, see if it is disabled with an env var */
   998       if ((fork_env = g_getenv ("GST_REGISTRY_FORK"))) {
  1017     if ((fork_env = g_getenv ("GST_REGISTRY_FORK"))) {
   999         /* fork enabled for any value different from "no" */
  1018       /* fork enabled for any value different from "no" */
  1000         do_fork = strcmp (fork_env, "no") != 0;
  1019       do_fork = strcmp (fork_env, "no") != 0;
  1001       }
  1020     }
  1002     }
  1021   }
  1003 
  1022 
  1004     /* now check registry with or without forking */
  1023   /* now check registry with or without forking */
  1005     if (do_fork) {
  1024   if (do_fork) {
  1006       GST_DEBUG ("forking for registry rebuild");
  1025     GST_DEBUG ("forking for registry rebuild");
  1007       ret = ensure_current_registry_forking (default_registry, registry_file,
  1026     ret = ensure_current_registry_forking (default_registry, registry_file,
  1008           error);
  1027         error);
  1009     } else {
  1028   } else {
  1010       GST_DEBUG ("requested not to fork for registry rebuild");
  1029     GST_DEBUG ("requested not to fork for registry rebuild");
  1011       ret = ensure_current_registry_nonforking (default_registry, registry_file,
  1030     ret = ensure_current_registry_nonforking (default_registry, registry_file,
  1012           error);
  1031         error);
  1013     }
  1032   }
  1014   }
  1033   }
  1015 
  1034 
  1016   g_free (registry_file);
  1035   g_free (registry_file);
  1017   GST_INFO ("registry reading and updating done, result = %d", ret);
  1036   GST_INFO ("registry reading and updating done, result = %d", ret);
  1018 
  1037 
  1056   g_type_class_ref (gst_pad_get_type ());
  1075   g_type_class_ref (gst_pad_get_type ());
  1057   g_type_class_ref (gst_element_factory_get_type ());
  1076   g_type_class_ref (gst_element_factory_get_type ());
  1058   g_type_class_ref (gst_element_get_type ());
  1077   g_type_class_ref (gst_element_get_type ());
  1059   g_type_class_ref (gst_type_find_factory_get_type ());
  1078   g_type_class_ref (gst_type_find_factory_get_type ());
  1060   g_type_class_ref (gst_bin_get_type ());
  1079   g_type_class_ref (gst_bin_get_type ());
  1061   g_type_class_ref (gst_bus_get_type ());
  1080 
  1062   g_type_class_ref (gst_task_get_type ());
  1081 #ifndef GST_DISABLE_INDEX
  1063   g_type_class_ref (gst_clock_get_type ());
       
  1064 
       
  1065   g_type_class_ref (gst_index_factory_get_type ());
  1082   g_type_class_ref (gst_index_factory_get_type ());
       
  1083 #endif /* GST_DISABLE_INDEX */
       
  1084 #ifndef GST_DISABLE_URI
  1066   gst_uri_handler_get_type ();
  1085   gst_uri_handler_get_type ();
  1067 
  1086 #endif /* GST_DISABLE_URI */
  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 ());
       
  1132 
  1087 
  1133   gst_structure_get_type ();
  1088   gst_structure_get_type ();
  1134   _gst_value_initialize ();
  1089   _gst_value_initialize ();
  1135   g_type_class_ref (gst_param_spec_fraction_get_type ());
  1090   g_type_class_ref (gst_param_spec_fraction_get_type ());
  1136   gst_caps_get_type ();
  1091   gst_caps_get_type ();
  1137   _gst_event_initialize ();
  1092   _gst_event_initialize ();
  1138   _gst_buffer_initialize ();
  1093   _gst_buffer_initialize ();
  1139   _gst_buffer_list_initialize ();
       
  1140   _gst_message_initialize ();
  1094   _gst_message_initialize ();
  1141   _gst_tag_initialize ();
  1095   _gst_tag_initialize ();
  1142 
  1096 
  1143   _gst_plugin_initialize ();
  1097   _gst_plugin_initialize ();
  1144 
       
  1145   gst_g_error_get_type ();
       
  1146 
  1098 
  1147   /* register core plugins */
  1099   /* register core plugins */
  1148   gst_plugin_register_static (GST_VERSION_MAJOR, GST_VERSION_MINOR,
  1100   gst_plugin_register_static (GST_VERSION_MAJOR, GST_VERSION_MINOR,
  1149       "staticelements", "core elements linked into the GStreamer library",
  1101       "staticelements", "core elements linked into the GStreamer library",
  1150       gst_register_core_elements, VERSION, GST_LICENSE, PACKAGE,
  1102       gst_register_core_elements, VERSION, GST_LICENSE, PACKAGE,
  1225 
  1177 
  1226   while (walk) {
  1178   while (walk) {
  1227     GstDebugCategory *cat = (GstDebugCategory *) walk->data;
  1179     GstDebugCategory *cat = (GstDebugCategory *) walk->data;
  1228 
  1180 
  1229     if (gst_debug_is_colored ()) {
  1181     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 */
       
  1244       gchar *color = gst_debug_construct_term_color (cat->color);
  1182       gchar *color = gst_debug_construct_term_color (cat->color);
  1245 
  1183 
  1246       g_print ("%s%-20s\033[00m  %1d %s  %s%s\033[00m\n",
  1184       g_print ("%s%-20s\033[00m  %1d %s  %s%s\033[00m\n",
  1247           color,
  1185           color,
  1248           gst_debug_category_get_name (cat),
  1186           gst_debug_category_get_name (cat),
  1249           gst_debug_category_get_threshold (cat),
  1187           gst_debug_category_get_threshold (cat),
  1250           gst_debug_level_get_name (gst_debug_category_get_threshold (cat)),
  1188           gst_debug_level_get_name (gst_debug_category_get_threshold (cat)),
  1251           color, gst_debug_category_get_description (cat));
  1189           color, gst_debug_category_get_description (cat));
  1252       g_free (color);
  1190       g_free (color);
  1253 #endif /* G_OS_WIN32 */
       
  1254     } else {
  1191     } else {
  1255       g_print ("%-20s  %1d %s  %s\n", gst_debug_category_get_name (cat),
  1192       g_print ("%-20s  %1d %s  %s\n", gst_debug_category_get_name (cat),
  1256           gst_debug_category_get_threshold (cat),
  1193           gst_debug_category_get_threshold (cat),
  1257           gst_debug_level_get_name (gst_debug_category_get_threshold (cat)),
  1194           gst_debug_level_get_name (gst_debug_category_get_threshold (cat)),
  1258           gst_debug_category_get_description (cat));
  1195           gst_debug_category_get_description (cat));
  1314       split_and_iterate (arg, ",", prepare_for_load_plugin_func, NULL);
  1251       split_and_iterate (arg, ",", prepare_for_load_plugin_func, NULL);
  1315       break;
  1252       break;
  1316     case ARG_SEGTRAP_DISABLE:
  1253     case ARG_SEGTRAP_DISABLE:
  1317       _gst_disable_segtrap = TRUE;
  1254       _gst_disable_segtrap = TRUE;
  1318       break;
  1255       break;
       
  1256 #ifdef __SYMBIAN32__	  
  1319     case ARG_REGISTRY_UPDATE_DISABLE:
  1257     case ARG_REGISTRY_UPDATE_DISABLE:
  1320       _gst_disable_registry_update = TRUE;
  1258       _gst_disable_registry_update = TRUE;
  1321       break;
  1259       break;
       
  1260 #endif	  
  1322     case ARG_REGISTRY_FORK_DISABLE:
  1261     case ARG_REGISTRY_FORK_DISABLE:
  1323       _gst_enable_registry_fork = FALSE;
  1262       _gst_enable_registry_fork = FALSE;
  1324       break;
  1263       break;
  1325     default:
  1264     default:
  1326       g_set_error (err, G_OPTION_ERROR, G_OPTION_ERROR_UNKNOWN_OPTION,
  1265       g_set_error (err, G_OPTION_ERROR, G_OPTION_ERROR_UNKNOWN_OPTION,
  1354     {
  1293     {
  1355     "--gst-plugin-spew", ARG_PLUGIN_SPEW}, {
  1294     "--gst-plugin-spew", ARG_PLUGIN_SPEW}, {
  1356     "--gst-plugin-path", ARG_PLUGIN_PATH}, {
  1295     "--gst-plugin-path", ARG_PLUGIN_PATH}, {
  1357     "--gst-plugin-load", ARG_PLUGIN_LOAD}, {
  1296     "--gst-plugin-load", ARG_PLUGIN_LOAD}, {
  1358     "--gst-disable-segtrap", ARG_SEGTRAP_DISABLE}, {
  1297     "--gst-disable-segtrap", ARG_SEGTRAP_DISABLE}, {
       
  1298 #ifdef __SYMBIAN32__	
  1359     "--gst-disable-registry-update", ARG_REGISTRY_UPDATE_DISABLE}, {
  1299     "--gst-disable-registry-update", ARG_REGISTRY_UPDATE_DISABLE}, {
  1360     "--gst-disable-registry-fork", ARG_REGISTRY_FORK_DISABLE}, {
  1300 #endif    
       
  1301 	"--gst-disable-registry-fork", ARG_REGISTRY_FORK_DISABLE}, {
  1361     NULL}
  1302     NULL}
  1362   };
  1303   };
  1363   gint val = 0, n;
  1304   gint val = 0, n;
  1364 
  1305 
  1365   for (n = 0; options[n].opt; n++) {
  1306   for (n = 0; options[n].opt; n++) {
  1423   g_type_class_unref (g_type_class_peek (gst_pad_get_type ()));
  1364   g_type_class_unref (g_type_class_peek (gst_pad_get_type ()));
  1424   g_type_class_unref (g_type_class_peek (gst_element_factory_get_type ()));
  1365   g_type_class_unref (g_type_class_peek (gst_element_factory_get_type ()));
  1425   g_type_class_unref (g_type_class_peek (gst_element_get_type ()));
  1366   g_type_class_unref (g_type_class_peek (gst_element_get_type ()));
  1426   g_type_class_unref (g_type_class_peek (gst_type_find_factory_get_type ()));
  1367   g_type_class_unref (g_type_class_peek (gst_type_find_factory_get_type ()));
  1427   g_type_class_unref (g_type_class_peek (gst_bin_get_type ()));
  1368   g_type_class_unref (g_type_class_peek (gst_bin_get_type ()));
  1428   g_type_class_unref (g_type_class_peek (gst_bus_get_type ()));
  1369 #ifndef GST_DISABLE_INDEX
  1429   g_type_class_unref (g_type_class_peek (gst_task_get_type ()));
       
  1430   g_type_class_unref (g_type_class_peek (gst_index_factory_get_type ()));
  1370   g_type_class_unref (g_type_class_peek (gst_index_factory_get_type ()));
  1431   g_type_class_unref (g_type_class_peek (gst_object_flags_get_type ()));
  1371 #endif /* GST_DISABLE_INDEX */
  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 ()));
       
  1498   g_type_class_unref (g_type_class_peek (gst_param_spec_fraction_get_type ()));
  1372   g_type_class_unref (g_type_class_peek (gst_param_spec_fraction_get_type ()));
  1499 
  1373 
  1500   gst_deinitialized = TRUE;
  1374   gst_deinitialized = TRUE;
  1501   GST_INFO ("deinitialized GStreamer");
  1375   GST_INFO ("deinitialized GStreamer");
  1502 }
  1376 }
  1548 
  1422 
  1549   gst_version (&major, &minor, &micro, &nano);
  1423   gst_version (&major, &minor, &micro, &nano);
  1550   if (nano == 0)
  1424   if (nano == 0)
  1551     return g_strdup_printf ("GStreamer %d.%d.%d", major, minor, micro);
  1425     return g_strdup_printf ("GStreamer %d.%d.%d", major, minor, micro);
  1552   else if (nano == 1)
  1426   else if (nano == 1)
  1553     return g_strdup_printf ("GStreamer %d.%d.%d (GIT)", major, minor, micro);
  1427     return g_strdup_printf ("GStreamer %d.%d.%d (CVS)", major, minor, micro);
  1554   else
  1428   else
  1555     return g_strdup_printf ("GStreamer %d.%d.%d (prerelease)", major, minor,
  1429     return g_strdup_printf ("GStreamer %d.%d.%d (prerelease)", major, minor,
  1556         micro);
  1430         micro);
  1557 }
  1431 }
  1558 
  1432