2 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3 * 2000 Wim Taymans <wtay@chello.be>
5 * gst.c: Initialization and non-pipeline operations
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
25 * @short_description: Media library supporting arbitrary formats and filter
27 * @see_also: Check out both <ulink url="http://www.cse.ogi.edu/sysl/">OGI's
28 * pipeline</ulink> and Microsoft's DirectShow for some background.
30 * GStreamer is a framework for constructing graphs of various filters
31 * (termed elements here) that will handle streaming media. Any discreet
32 * (packetizable) media type is supported, with provisions for automatically
33 * determining source type. Formatting/framing information is provided with
34 * a powerful negotiation framework. Plugins are heavily used to provide for
35 * all elements, allowing one to construct plugins outside of the GST
36 * library, even released binary-only if license require (please don't).
38 * GStreamer borrows heavily from both the <ulink
39 * url="http://www.cse.ogi.edu/sysl/">OGI media pipeline</ulink> and
40 * Microsoft's DirectShow, hopefully taking the best of both and leaving the
41 * cruft behind. Its interface is still very fluid and thus can be changed
42 * to increase the sanity/noise ratio.
44 * The <application>GStreamer</application> library should be initialized with
45 * gst_init() before it can be used. You should pass pointers to the main argc
46 * and argv variables so that GStreamer can process its own command line
47 * options, as shown in the following example.
50 * <title>Initializing the gstreamer library</title>
51 * <programlisting language="c">
53 * main (int argc, char *argv[])
55 * // initialize the GStreamer library
56 * gst_init (&argc, &argv);
62 * It's allowed to pass two NULL pointers to gst_init() in case you don't want
63 * to pass the command line args to GStreamer.
65 * You can also use GOption to initialize your own parameters as shown in
66 * the next code fragment:
68 * <title>Initializing own parameters when initializing gstreamer</title>
70 * static gboolean stats = FALSE;
73 * main (int argc, char *argv[])
75 * GOptionEntry options[] = {
76 * {"tags", 't', 0, G_OPTION_ARG_NONE, &tags,
77 * N_("Output tags (also known as metadata)"), NULL},
80 * ctx = g_option_context_new ("gst-launch");
81 * g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE);
82 * g_option_context_add_group (ctx, gst_init_get_option_group ());
83 * if (!g_option_context_parse (ctx, &argc, &argv, &err)) {
84 * g_print ("Error initializing: %s\n", GST_STR_NULL (err->message));
87 * g_option_context_free (ctx);
93 * Use gst_version() to query the library version at runtime or use the
94 * GST_VERSION_* macros to find the version at compile time. Optionally
95 * gst_version_string() returns a printable string.
97 * The gst_deinit() call is used to clean up all internal resources used
98 * by <application>GStreamer</application>. It is mostly used in unit tests
101 * Last reviewed on 2005-11-23 (0.9.5)
107 #include "gst_private.h"
108 #include "gst-i18n-lib.h"
109 #include <locale.h> /* for LC_ALL */
113 #define GST_CAT_DEFAULT GST_CAT_GST_INIT
115 #define MAX_PATH_SPLIT 16
116 #define GST_PLUGIN_SEPARATOR ","
118 static gboolean gst_initialized = FALSE;
120 extern gint _gst_trace_on;
122 /* set to TRUE when segfaults need to be left as is */
123 gboolean _gst_disable_segtrap = FALSE;
126 static void load_plugin_func (gpointer data, gpointer user_data);
127 static gboolean init_pre (void);
128 static gboolean init_post (void);
129 static gboolean parse_goption_arg (const gchar * s_opt,
130 const gchar * arg, gpointer data, GError ** err);
132 static GSList *preload_plugins = NULL;
134 const gchar g_log_domain_gstreamer[] = "GStreamer";
137 debug_log_handler (const gchar * log_domain,
138 GLogLevelFlags log_level, const gchar * message, gpointer user_data)
140 g_log_default_handler (log_domain, log_level, message, user_data);
141 /* FIXME: do we still need this ? fatal errors these days are all
142 * other than core errors */
143 /* g_on_error_query (NULL); */
150 #ifndef GST_DISABLE_GST_DEBUG
163 /* debug-spec ::= category-spec [, category-spec]*
164 * category-spec ::= category:val | val
173 #ifndef GST_DISABLE_GST_DEBUG
175 parse_debug_category (gchar * str, const gchar ** category)
192 parse_debug_level (gchar * str, gint * level)
200 if (str[0] != NUL && str[1] == NUL
201 && str[0] >= '0' && str[0] < '0' + GST_LEVEL_COUNT) {
202 *level = str[0] - '0';
210 parse_debug_list (const gchar * list)
215 g_return_if_fail (list != NULL);
217 split = g_strsplit (list, ",", 0);
219 for (walk = split; *walk; walk++) {
220 if (strchr (*walk, ':')) {
221 gchar **values = g_strsplit (*walk, ":", 2);
223 if (values[0] && values[1]) {
225 const gchar *category;
227 if (parse_debug_category (values[0], &category)
228 && parse_debug_level (values[1], &level))
229 gst_debug_set_threshold_for_name (category, level);
236 if (parse_debug_level (*walk, &level))
237 gst_debug_set_default_threshold (level);
245 #ifndef GST_HAVE_GLIB_2_8
246 #define G_OPTION_FLAG_NO_ARG 0
250 * gst_init_get_option_group:
252 * Returns a #GOptionGroup with GStreamer's argument specifications. The
253 * group is set up to use standard GOption callbacks, so when using this
254 * group in combination with GOption parsing methods, all argument parsing
255 * and initialization is automated.
257 * This function is useful if you want to integrate GStreamer with other
258 * libraries that use GOption (see g_option_context_add_group() ).
260 * Returns: a pointer to GStreamer's option group. Should be dereferenced
265 gst_init_get_option_group (void)
268 static GOptionEntry gst_args[] = {
269 {"gst-version", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
270 parse_goption_arg, N_("Print the GStreamer version"), NULL},
271 {"gst-fatal-warnings", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
272 parse_goption_arg, N_("Make all warnings fatal"), NULL},
273 #ifndef GST_DISABLE_GST_DEBUG
274 {"gst-debug-help", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
275 parse_goption_arg, N_("Print available debug categories and exit"),
277 {"gst-debug-level", 0, 0, G_OPTION_ARG_CALLBACK, parse_goption_arg,
278 N_("Default debug level from 1 (only error) to 5 (anything) or "
281 {"gst-debug", 0, 0, G_OPTION_ARG_CALLBACK, parse_goption_arg,
282 N_("Comma-separated list of category_name:level pairs to set "
283 "specific levels for the individual categories. Example: "
284 "GST_AUTOPLUG:5,GST_ELEMENT_*:3"),
286 {"gst-debug-no-color", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
287 parse_goption_arg, N_("Disable colored debugging output"), NULL},
288 {"gst-debug-disable", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
289 parse_goption_arg, N_("Disable debugging"), NULL},
291 {"gst-plugin-spew", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
292 parse_goption_arg, N_("Enable verbose plugin loading diagnostics"),
294 {"gst-plugin-path", 0, 0, G_OPTION_ARG_CALLBACK, parse_goption_arg,
295 N_("Colon-separated paths containing plugins"), N_("PATHS")},
296 {"gst-plugin-load", 0, 0, G_OPTION_ARG_CALLBACK, parse_goption_arg,
297 N_("Comma-separated list of plugins to preload in addition to the "
298 "list stored in environment variable GST_PLUGIN_PATH"),
300 {"gst-disable-segtrap", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
302 N_("Disable trapping of segmentation faults during plugin loading"),
307 group = g_option_group_new ("gst", _("GStreamer Options"),
308 _("Show GStreamer Options"), NULL, NULL);
309 g_option_group_set_parse_hooks (group, (GOptionParseFunc) init_pre,
310 (GOptionParseFunc) init_post);
312 g_option_group_add_entries (group, gst_args);
313 g_option_group_set_translation_domain (group, GETTEXT_PACKAGE);
320 * @argc: pointer to application's argc
321 * @argv: pointer to application's argv
322 * @err: pointer to a #GError to which a message will be posted on error
324 * Initializes the GStreamer library, setting up internal path lists,
325 * registering built-in elements, and loading standard plugins.
327 * This function will return %FALSE if GStreamer could not be initialized
328 * for some reason. If you want your program to fail fatally,
329 * use gst_init() instead.
331 * Returns: %TRUE if GStreamer could be initialized.
334 gst_init_check (int *argc, char **argv[], GError ** err)
340 if (gst_initialized) {
341 GST_DEBUG ("already initialized gst");
345 ctx = g_option_context_new ("- GStreamer initialization");
346 g_option_context_set_ignore_unknown_options (ctx, TRUE);
347 group = gst_init_get_option_group ();
348 g_option_context_add_group (ctx, group);
349 res = g_option_context_parse (ctx, argc, argv, err);
350 g_option_context_free (ctx);
353 gst_initialized = TRUE;
361 * @argc: pointer to application's argc
362 * @argv: pointer to application's argv
364 * Initializes the GStreamer library, setting up internal path lists,
365 * registering built-in elements, and loading standard plugins.
368 * This function will terminate your program if it was unable to initialize
369 * GStreamer for some reason. If you want your program to fall back,
370 * use gst_init_check() instead.
373 * WARNING: This function does not work in the same way as corresponding
374 * functions in other glib-style libraries, such as gtk_init(). In
375 * particular, unknown command line options cause this function to
376 * abort program execution.
379 gst_init (int *argc, char **argv[])
383 if (!gst_init_check (argc, argv, &err)) {
384 g_print ("Could not initialized GStreamer: %s\n",
385 err ? err->message : "unknown error occurred");
393 #ifndef GST_DISABLE_REGISTRY
395 add_path_func (gpointer data, gpointer user_data)
397 GST_INFO ("Adding plugin path: \"%s\"", (gchar *) data);
398 gst_registry_scan_path (gst_registry_get_default (), (gchar *) data);
403 prepare_for_load_plugin_func (gpointer data, gpointer user_data)
405 preload_plugins = g_slist_prepend (preload_plugins, data);
409 load_plugin_func (gpointer data, gpointer user_data)
412 const gchar *filename;
415 filename = (const gchar *) data;
417 plugin = gst_plugin_load_file (filename, &err);
420 GST_INFO ("Loaded plugin: \"%s\"", filename);
422 gst_default_registry_add_plugin (plugin);
425 /* Report error to user, and free error */
426 GST_ERROR ("Failed to load plugin: %s\n", err->message);
429 GST_WARNING ("Failed to load plugin: \"%s\"", filename);
437 split_and_iterate (const gchar * stringlist, gchar * separator, GFunc iterator,
442 gchar *lastlist = g_strdup (stringlist);
445 strings = g_strsplit (lastlist, separator, MAX_PATH_SPLIT);
450 iterator (strings[j], user_data);
451 if (++j == MAX_PATH_SPLIT) {
452 lastlist = g_strdup (strings[j]);
453 g_strfreev (strings);
458 g_strfreev (strings);
462 /* we have no fail cases yet, but maybe in the future */
466 #ifdef GST_HAVE_GLIB_2_8
467 /* GStreamer was built against a GLib >= 2.8 and is therefore not doing
468 * the refcount hack. Check that it isn't being run against an older GLib */
469 if (glib_major_version < 2 ||
470 (glib_major_version == 2 && glib_minor_version < 8)) {
472 /* GStreamer was built against a GLib < 2.8 and is therefore doing
473 * the refcount hack. Check that it isn't being run against a newer GLib */
474 if (glib_major_version > 2 ||
475 (glib_major_version == 2 && glib_minor_version >= 8)) {
477 g_warning ("GStreamer was compiled against GLib %d.%d.%d but is running"
478 " against %d.%d.%d. This will cause reference counting issues",
479 GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION,
480 glib_major_version, glib_minor_version, glib_micro_version);
485 if (g_thread_supported ()) {
486 /* somebody already initialized threading */
488 g_thread_init (NULL);
490 /* we need threading to be enabled right here */
494 setlocale (LC_ALL, "");
495 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
496 #endif /* ENABLE_NLS */
498 #ifndef GST_DISABLE_GST_DEBUG
500 const gchar *debug_list;
502 if (g_getenv ("GST_DEBUG_NO_COLOR") != NULL)
503 gst_debug_set_colored (FALSE);
505 debug_list = g_getenv ("GST_DEBUG");
507 parse_debug_list (debug_list);
511 /* This is the earliest we can make stuff show up in the logs.
512 * So give some useful info about GStreamer here */
513 GST_INFO ("Initializing GStreamer Core Library version %s", VERSION);
514 GST_INFO ("Using library installed in %s", LIBDIR);
520 gst_register_core_elements (GstPlugin * plugin)
522 /* register some standard builtin types */
523 if (!gst_element_register (plugin, "bin", GST_RANK_PRIMARY,
525 !gst_element_register (plugin, "pipeline", GST_RANK_PRIMARY,
528 g_assert_not_reached ();
533 static GstPluginDesc plugin_desc = {
537 "core elements linked into the GStreamer library",
538 gst_register_core_elements,
550 * - initalization of threads if we use them
553 * - initializes gst_format
554 * - registers a bunch of types for gst_objects
556 * - we don't have cases yet where this fails, but in the future
557 * we might and then it's nice to be able to return that
564 #ifndef GST_DISABLE_TRACE
566 #endif /* GST_DISABLE_TRACE */
568 llf = G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL;
569 g_log_set_handler (g_log_domain_gstreamer, llf, debug_log_handler, NULL);
571 _gst_format_initialize ();
572 _gst_query_initialize ();
573 gst_object_get_type ();
575 gst_element_factory_get_type ();
576 gst_element_get_type ();
577 gst_type_find_factory_get_type ();
580 #ifndef GST_DISABLE_INDEX
581 gst_index_factory_get_type ();
582 #endif /* GST_DISABLE_INDEX */
583 #ifndef GST_DISABLE_URI
584 gst_uri_handler_get_type ();
585 #endif /* GST_DISABLE_URI */
587 gst_structure_get_type ();
588 _gst_value_initialize ();
589 gst_caps_get_type ();
590 _gst_event_initialize ();
591 _gst_buffer_initialize ();
592 _gst_message_initialize ();
593 _gst_tag_initialize ();
595 /* register core plugins */
596 _gst_plugin_register_static (&plugin_desc);
598 _gst_plugin_initialize ();
600 #ifndef GST_DISABLE_REGISTRY
603 const char *plugin_path;
604 GstRegistry *default_registry;
606 default_registry = gst_registry_get_default ();
607 registry_file = g_strdup (g_getenv ("GST_REGISTRY"));
608 if (registry_file == NULL) {
609 registry_file = g_build_filename (g_get_home_dir (),
610 ".gstreamer-" GST_MAJORMINOR, "registry." HOST_CPU ".xml", NULL);
612 GST_DEBUG ("Reading registry cache");
613 gst_registry_xml_read_cache (default_registry, registry_file);
615 /* GST_PLUGIN_PATH specifies a list of directories to scan for
616 * additional plugins. These take precedence over the system plugins */
617 plugin_path = g_getenv ("GST_PLUGIN_PATH");
622 GST_DEBUG ("GST_PLUGIN_PATH set to %s", plugin_path);
623 list = g_strsplit (plugin_path, G_SEARCHPATH_SEPARATOR_S, 0);
624 for (i = 0; list[i]; i++) {
625 gst_registry_scan_path (default_registry, list[i]);
629 GST_DEBUG ("GST_PLUGIN_PATH not set");
632 /* GST_PLUGIN_SYSTEM_PATH specifies a list of plugins that are always
633 * loaded by default. If not set, this defaults to the system-installed
634 * path, and the plugins installed in the user's home directory */
635 plugin_path = g_getenv ("GST_PLUGIN_SYSTEM_PATH");
636 if (plugin_path == NULL) {
639 GST_DEBUG ("GST_PLUGIN_SYSTEM_PATH not set");
641 /* plugins in the user's home directory take precedence over
642 * system-installed ones */
643 home_plugins = g_build_filename (g_get_home_dir (),
644 ".gstreamer-" GST_MAJORMINOR, "plugins", NULL);
645 gst_registry_scan_path (default_registry, home_plugins);
646 g_free (home_plugins);
648 /* add the main (installed) library path */
649 gst_registry_scan_path (default_registry, PLUGINDIR);
654 GST_DEBUG ("GST_PLUGIN_SYSTEM_PATH set to %s", plugin_path);
655 list = g_strsplit (plugin_path, G_SEARCHPATH_SEPARATOR_S, 0);
656 for (i = 0; list[i]; i++) {
657 gst_registry_scan_path (default_registry, list[i]);
662 gst_registry_xml_write_cache (default_registry, registry_file);
664 _gst_registry_remove_cache_plugins (default_registry);
666 g_free (registry_file);
669 #endif /* GST_DISABLE_REGISTRY */
671 /* if we need to preload plugins */
672 if (preload_plugins) {
673 g_slist_foreach (preload_plugins, load_plugin_func, NULL);
674 g_slist_free (preload_plugins);
675 preload_plugins = NULL;
677 #ifndef GST_DISABLE_TRACE
680 gst_trace = gst_trace_new ("gst.trace", 1024);
681 gst_trace_set_default (gst_trace);
683 #endif /* GST_DISABLE_TRACE */
688 #ifndef GST_DISABLE_GST_DEBUG
690 select_all (GstPlugin * plugin, gpointer user_data)
696 sort_by_category_name (gconstpointer a, gconstpointer b)
698 return strcmp (gst_debug_category_get_name ((GstDebugCategory *) a),
699 gst_debug_category_get_name ((GstDebugCategory *) b));
702 gst_debug_help (void)
710 list2 = gst_registry_plugin_filter (gst_registry_get_default (),
711 select_all, FALSE, NULL);
713 /* FIXME this is gross. why don't debug have categories PluginFeatures? */
714 for (g = list2; g; g = g_list_next (g)) {
715 GstPlugin *plugin = GST_PLUGIN (g->data);
717 gst_plugin_load (plugin);
721 list = gst_debug_get_all_categories ();
722 walk = list = g_slist_sort (list, sort_by_category_name);
725 g_print ("name level description\n");
726 g_print ("---------------------+--------+--------------------------------\n");
729 GstDebugCategory *cat = (GstDebugCategory *) walk->data;
731 if (gst_debug_is_colored ()) {
732 gchar *color = gst_debug_construct_term_color (cat->color);
734 g_print ("%s%-20s\033[00m %1d %s %s%s\033[00m\n",
736 gst_debug_category_get_name (cat),
737 gst_debug_category_get_threshold (cat),
738 gst_debug_level_get_name (gst_debug_category_get_threshold (cat)),
739 color, gst_debug_category_get_description (cat));
742 g_print ("%-20s %1d %s %s\n", gst_debug_category_get_name (cat),
743 gst_debug_category_get_threshold (cat),
744 gst_debug_level_get_name (gst_debug_category_get_threshold (cat)),
745 gst_debug_category_get_description (cat));
747 walk = g_slist_next (walk);
755 parse_one_option (gint opt, const gchar * arg, GError ** err)
759 g_print ("GStreamer Core Library version %s\n", PACKAGE_VERSION);
761 case ARG_FATAL_WARNINGS:{
762 GLogLevelFlags fatal_mask;
764 fatal_mask = g_log_set_always_fatal (G_LOG_FATAL_MASK);
765 fatal_mask |= G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL;
766 g_log_set_always_fatal (fatal_mask);
769 #ifndef GST_DISABLE_GST_DEBUG
770 case ARG_DEBUG_LEVEL:{
773 tmp = strtol (arg, NULL, 0);
774 if (tmp >= 0 && tmp < GST_LEVEL_COUNT) {
775 gst_debug_set_default_threshold (tmp);
780 parse_debug_list (arg);
782 case ARG_DEBUG_NO_COLOR:
783 gst_debug_set_colored (FALSE);
785 case ARG_DEBUG_DISABLE:
786 gst_debug_set_active (FALSE);
792 case ARG_PLUGIN_SPEW:
794 case ARG_PLUGIN_PATH:
795 #ifndef GST_DISABLE_REGISTRY
796 split_and_iterate (arg, G_SEARCHPATH_SEPARATOR_S, add_path_func, NULL);
797 #endif /* GST_DISABLE_REGISTRY */
799 case ARG_PLUGIN_LOAD:
800 split_and_iterate (arg, ",", prepare_for_load_plugin_func, NULL);
802 case ARG_SEGTRAP_DISABLE:
803 _gst_disable_segtrap = TRUE;
806 g_set_error (err, G_OPTION_ERROR, G_OPTION_ERROR_UNKNOWN_OPTION,
807 _("Unknown option"));
815 parse_goption_arg (const gchar * opt,
816 const gchar * arg, gpointer data, GError ** err)
824 "--gst-version", ARG_VERSION}, {
825 "--gst-fatal-warnings", ARG_FATAL_WARNINGS},
826 #ifndef GST_DISABLE_GST_DEBUG
828 "--gst-debug-level", ARG_DEBUG_LEVEL}, {
829 "--gst-debug", ARG_DEBUG}, {
830 "--gst-debug-disable", ARG_DEBUG_DISABLE}, {
831 "--gst-debug-no-color", ARG_DEBUG_NO_COLOR}, {
832 "--gst-debug-help", ARG_DEBUG_HELP},
835 "--gst-plugin-spew", ARG_PLUGIN_SPEW}, {
836 "--gst-plugin-path", ARG_PLUGIN_PATH}, {
837 "--gst-plugin-load", ARG_PLUGIN_LOAD}, {
838 "--gst-disable-segtrap", ARG_SEGTRAP_DISABLE}, {
843 for (n = 0; options[n].opt; n++) {
844 if (!strcmp (opt, options[n].opt)) {
845 val = options[n].val;
850 return parse_one_option (val, arg, err);
857 * Call only once, before exiting.
858 * After this call GStreamer should not be used anymore.
861 extern GstRegistry *_gst_registry_default;
867 GST_INFO ("deinitializing GStreamer");
868 clock = gst_system_clock_obtain ();
869 gst_object_unref (clock);
870 gst_object_unref (clock);
872 _gst_registry_cleanup ();
874 gst_initialized = FALSE;
875 GST_INFO ("deinitialized GStreamer");
880 * @major: pointer to a guint to store the major version number
881 * @minor: pointer to a guint to store the minor version number
882 * @micro: pointer to a guint to store the micro version number
883 * @nano: pointer to a guint to store the nano version number
885 * Gets the version number of the GStreamer library.
888 gst_version (guint * major, guint * minor, guint * micro, guint * nano)
890 g_return_if_fail (major);
891 g_return_if_fail (minor);
892 g_return_if_fail (micro);
893 g_return_if_fail (nano);
895 *major = GST_VERSION_MAJOR;
896 *minor = GST_VERSION_MINOR;
897 *micro = GST_VERSION_MICRO;
898 *nano = GST_VERSION_NANO;
902 * gst_version_string:
904 * This function returns a string that is useful for describing this version
905 * of GStreamer to the outside world: user agent strings, logging, ...
907 * Returns: a newly allocated string describing this version of GStreamer.
911 gst_version_string ()
913 guint major, minor, micro, nano;
915 gst_version (&major, &minor, µ, &nano);
917 return g_strdup_printf ("GStreamer %d.%d.%d", major, minor, micro);
919 return g_strdup_printf ("GStreamer %d.%d.%d (CVS)", major, minor, micro);
921 return g_strdup_printf ("GStreamer %d.%d.%d (prerelease)", major, minor,