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, |
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}, |
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 } |
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)); |
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 } |