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