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.
26 #include "gst_private.h"
27 #include "gst-i18n-lib.h"
28 #include <locale.h> /* for LC_ALL */
32 #ifndef GST_DISABLE_REGISTRY
33 #include "registries/gstxmlregistry.h"
34 #endif /* GST_DISABLE_REGISTRY */
35 #include "gstregistrypool.h"
37 #define GST_CAT_DEFAULT GST_CAT_GST_INIT
39 #define MAX_PATH_SPLIT 16
40 #define GST_PLUGIN_SEPARATOR ","
44 #ifndef GST_DISABLE_REGISTRY
45 gboolean _gst_registry_auto_load = TRUE;
46 static GstRegistry *_global_registry;
47 static GstRegistry *_user_registry;
48 static gboolean _gst_registry_fixed = FALSE;
51 static gboolean _gst_use_threads = TRUE;
53 static gboolean _gst_enable_cpu_opt = TRUE;
55 static gboolean gst_initialized = FALSE;
56 /* this will be set in popt callbacks when a problem has been encountered */
57 static gboolean _gst_initialization_failure = FALSE;
58 extern gint _gst_trace_on;
60 /* set to TRUE when segfaults need to be left as is */
61 gboolean _gst_disable_segtrap = FALSE;
63 extern GThreadFunctions gst_thread_dummy_functions;
66 static void load_plugin_func (gpointer data, gpointer user_data);
67 static void init_popt_callback (poptContext context,
68 enum poptCallbackReason reason,
69 const struct poptOption *option,
70 const char *arg, void *data);
71 static gboolean init_pre (void);
72 static gboolean init_post (void);
74 static GSList *preload_plugins = NULL;
76 const gchar *g_log_domain_gstreamer = "GStreamer";
79 debug_log_handler (const gchar *log_domain,
80 GLogLevelFlags log_level,
84 g_log_default_handler (log_domain, log_level, message, user_data);
85 /* FIXME: do we still need this ? fatal errors these days are all
86 * other than core errors */
87 /* g_on_error_query (NULL); */
93 #ifndef GST_DISABLE_GST_DEBUG
113 /* default scheduler, can be changed in gstscheduler.h with
114 * the GST_SCHEDULER_DEFAULT_NAME define.
116 static const struct poptOption gstreamer_options[] = {
117 {NULL, NUL, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE|POPT_CBFLAG_POST, (void *) &init_popt_callback, 0, NULL, NULL},
118 {"gst-version", NUL, POPT_ARG_NONE|POPT_ARGFLAG_STRIP, NULL, ARG_VERSION, N_("Print the GStreamer version"), NULL},
119 {"gst-fatal-warnings", NUL, POPT_ARG_NONE|POPT_ARGFLAG_STRIP, NULL, ARG_FATAL_WARNINGS, N_("Make all warnings fatal"), NULL},
120 #ifndef GST_DISABLE_GST_DEBUG
121 {"gst-debug-level", NUL, POPT_ARG_INT|POPT_ARGFLAG_STRIP, NULL, ARG_DEBUG_LEVEL, N_("Default debug level from 1 (only error) to 5 (anything) or 0 for no output"), N_("LEVEL")},
122 {"gst-debug", NUL, POPT_ARG_STRING|POPT_ARGFLAG_STRIP, NULL, ARG_DEBUG, N_("Comma-separated list of category_name:level pairs to set specific levels for the individual categories.\nExample: GST_AUTOPLUG:5,GST_ELEMENT_*:3"), N_("CATEGORIES")},
123 {"gst-debug-no-color", NUL, POPT_ARG_NONE|POPT_ARGFLAG_STRIP, NULL, ARG_DEBUG_NO_COLOR, N_("Disable color debugging output"), NULL},
124 {"gst-disable-debug", NUL, POPT_ARG_NONE|POPT_ARGFLAG_STRIP, NULL, ARG_DEBUG_DISABLE, N_("Disable debugging")},
125 {"gst-debug-help", NUL, POPT_ARG_NONE|POPT_ARGFLAG_STRIP, NULL, ARG_DEBUG_HELP, N_("Print available debug categories and exit"), NULL},
127 {"gst-disable-cpu-opt",NUL, POPT_ARG_NONE|POPT_ARGFLAG_STRIP, NULL, ARG_DISABLE_CPU_OPT,N_("Disable accelerated CPU instructions"), NULL},
128 {"gst-plugin-spew", NUL, POPT_ARG_NONE|POPT_ARGFLAG_STRIP, NULL, ARG_PLUGIN_SPEW, N_("Enable verbose plugin loading diagnostics"), NULL},
129 {"gst-plugin-path", NUL, POPT_ARG_STRING|POPT_ARGFLAG_STRIP, NULL, ARG_PLUGIN_PATH, N_("path list for loading plugins (separated by '" G_SEARCHPATH_SEPARATOR_S "')"),N_("PATHS")},
130 {"gst-plugin-load", NUL, POPT_ARG_STRING|POPT_ARGFLAG_STRIP, NULL, ARG_PLUGIN_LOAD, N_("Comma-separated list of plugins to preload in addition to the list stored in env variable GST_PLUGIN_PATH"), N_("PLUGINS")},
131 {"gst-disable-segtrap",NUL, POPT_ARG_NONE|POPT_ARGFLAG_STRIP, NULL, ARG_SEGTRAP_DISABLE,N_("Disable trapping of segmentation faults during plugin loading"), NULL},
132 {"gst-scheduler", NUL, POPT_ARG_STRING|POPT_ARGFLAG_STRIP, NULL, ARG_SCHEDULER, N_("Scheduler to use ('"GST_SCHEDULER_DEFAULT_NAME"' is the default)"), N_("SCHEDULER")},
133 {"gst-registry", NUL, POPT_ARG_STRING|POPT_ARGFLAG_STRIP, NULL, ARG_REGISTRY, N_("Registry to use") , N_("REGISTRY")},
138 * gst_init_get_popt_table:
140 * Returns a popt option table with GStreamer's argument specifications. The
141 * table is set up to use popt's callback method, so whenever the parsing is
142 * actually performed (via poptGetContext), the GStreamer libraries will
145 * Returns: a pointer to the static GStreamer option table.
146 * No free is necessary.
148 const struct poptOption *
149 gst_init_get_popt_table (void)
151 return gstreamer_options;
156 * @argc: pointer to application's argc
157 * @argv: pointer to application's argv
159 * Initializes the GStreamer library, setting up internal path lists,
160 * registering built-in elements, and loading standard plugins.
162 * This function will return %FALSE if GStreamer could not be initialized
163 * for some reason. If you want your program to fail fatally,
164 * use gst_init() instead.
166 * Returns: %TRUE if GStreamer could be initialized.
169 gst_init_check (int *argc, char **argv[])
171 return gst_init_check_with_popt_table (argc, argv, NULL);
176 * @argc: pointer to application's argc
177 * @argv: pointer to application's argv
179 * Initializes the GStreamer library, setting up internal path lists,
180 * registering built-in elements, and loading standard plugins.
182 * This function will terminate your program if it was unable to initialize
183 * GStreamer for some reason. If you want your program to fall back,
184 * use gst_init_check() instead.
187 gst_init (int *argc, char **argv[])
189 gst_init_with_popt_table (argc, argv, NULL);
193 * gst_init_with_popt_table:
194 * @argc: pointer to application's argc
195 * @argv: pointer to application's argv
196 * @popt_options: pointer to a popt table to append
198 * Initializes the GStreamer library, parsing the options,
199 * setting up internal path lists,
200 * registering built-in elements, and loading standard plugins.
202 * This function will terminate your program if it was unable to initialize
203 * GStreamer for some reason. If you want your program to fall back,
204 * use gst_init_check_with_popt_table() instead.
207 gst_init_with_popt_table (int *argc, char **argv[],
208 const struct poptOption *popt_options)
210 if (!gst_init_check_with_popt_table (argc, argv, popt_options)) {
211 g_print ("Could not initialize GStreamer !\n");
216 * gst_init_check_with_popt_table:
217 * @argc: pointer to application's argc
218 * @argv: pointer to application's argv
219 * @popt_options: pointer to a popt table to append
221 * Initializes the GStreamer library, parsing the options,
222 * setting up internal path lists,
223 * registering built-in elements, and loading standard plugins.
225 * Returns: %TRUE if GStreamer could be initialized.
228 gst_init_check_with_popt_table (int *argc, char **argv[],
229 const struct poptOption *popt_options)
233 struct poptOption *options;
234 struct poptOption options_with[] = {
235 {NULL, NUL, POPT_ARG_INCLUDE_TABLE, poptHelpOptions, 0, "Help options:", NULL},
236 {NULL, NUL, POPT_ARG_INCLUDE_TABLE, (struct poptOption *) gstreamer_options, 0, "GStreamer options:", NULL},
237 {NULL, NUL, POPT_ARG_INCLUDE_TABLE, (struct poptOption *) popt_options, 0, "Application options:", NULL},
240 struct poptOption options_without[] = {
241 {NULL, NUL, POPT_ARG_INCLUDE_TABLE, poptHelpOptions, 0, "Help options:", NULL},
242 {NULL, NUL, POPT_ARG_INCLUDE_TABLE, (struct poptOption *) gstreamer_options, 0, "GStreamer options:", NULL},
248 GST_DEBUG ("already initialized gst");
252 if (!argc || !argv) {
254 g_warning ("gst_init: Only one of argc or argv was NULL");
256 if (!init_pre ()) return FALSE;
257 if (!init_post ()) return FALSE;
258 gst_initialized = TRUE;
262 if (popt_options == NULL) {
263 options = options_without;
265 options = options_with;
267 context = poptGetContext ("GStreamer", *argc, (const char**)*argv,
270 while ((nextopt = poptGetNextOpt (context)) > 0)
272 /* we only check for failures here, actual work is done in callbacks */
273 if (_gst_initialization_failure) return FALSE;
277 g_print ("Error on option %s: %s.\nRun '%s --help' "
278 "to see a full list of available command line options.\n",
279 poptBadOption (context, 0),
280 poptStrerror (nextopt),
283 poptFreeContext (context);
287 *argc = poptStrippedArgv (context, *argc, *argv);
289 poptFreeContext (context);
294 #ifndef GST_DISABLE_REGISTRY
296 add_path_func (gpointer data, gpointer user_data)
298 GstRegistry *registry = GST_REGISTRY (user_data);
300 GST_INFO ("Adding plugin path: \"%s\"", (gchar *) data);
301 gst_registry_add_path (registry, (gchar *)data);
306 prepare_for_load_plugin_func (gpointer data, gpointer user_data)
308 preload_plugins = g_slist_prepend (preload_plugins, data);
312 parse_debug_list (const gchar *list)
317 g_return_if_fail (list != NULL);
319 walk = split = g_strsplit (list, ",", 0);
322 gchar **values = g_strsplit ( walk[0], ":", 2);
323 if (values[0] && values[1]) {
325 g_strstrip (values[0]);
326 g_strstrip (values[1]);
327 level = strtol (values[1], NULL, 0);
328 if (level >= 0 && level < GST_LEVEL_COUNT) {
329 GST_DEBUG ("setting debugging to level %d for name \"%s\"",
331 gst_debug_set_threshold_for_name (values[0], level);
340 load_plugin_func (gpointer data, gpointer user_data)
343 const gchar *filename;
345 filename = (const gchar *) data;
347 plugin = gst_plugin_load_file (filename, NULL);
350 GST_INFO ("Loaded plugin: \"%s\"", filename);
352 gst_registry_pool_add_plugin (plugin);
354 GST_WARNING ("Failed to load plugin: \"%s\"", filename);
361 split_and_iterate (const gchar *stringlist, gchar *separator, GFunc iterator, gpointer user_data)
365 gchar *lastlist = g_strdup (stringlist);
368 strings = g_strsplit (lastlist, separator, MAX_PATH_SPLIT);
373 iterator (strings[j], user_data);
374 if (++j == MAX_PATH_SPLIT) {
375 lastlist = g_strdup (strings[j]);
376 g_strfreev (strings);
384 /* we have no fail cases yet, but maybe in the future */
391 if (g_thread_supported ()) {
392 /* somebody already initialized threading */
393 _gst_use_threads = TRUE;
395 if (_gst_use_threads)
396 g_thread_init (NULL);
398 g_thread_init (&gst_thread_dummy_functions);
400 /* we need threading to be enabled right here */
404 setlocale (LC_ALL, "");
405 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
406 textdomain (GETTEXT_PACKAGE);
407 #endif /* ENABLE_NLS */
409 #ifndef GST_DISABLE_REGISTRY
411 const gchar *debug_list;
413 debug_list = g_getenv ("GST_DEBUG");
415 parse_debug_list (debug_list);
419 #ifndef GST_DISABLE_REGISTRY
422 const gchar *homedir;
424 _global_registry = gst_xml_registry_new ("global_registry", GLOBAL_REGISTRY_FILE);
426 #ifdef PLUGINS_USE_BUILDDIR
427 /* location libgstelements.so */
428 gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/libs/gst");
429 gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/gst/elements");
430 gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/gst/types");
431 gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/gst/autoplug");
432 gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/gst/schedulers");
433 gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/gst/indexers");
435 /* add the main (installed) library path */
436 gst_registry_add_path (_global_registry, PLUGINS_DIR);
437 #endif /* PLUGINS_USE_BUILDDIR */
439 if (g_getenv ("GST_REGISTRY"))
441 user_reg = g_strdup (g_getenv ("GST_REGISTRY"));
445 homedir = g_get_home_dir ();
446 user_reg = g_strjoin ("/", homedir, LOCAL_REGISTRY_FILE, NULL);
448 _user_registry = gst_xml_registry_new ("user_registry", user_reg);
452 #endif /* GST_DISABLE_REGISTRY */
458 gst_register_core_elements (GstPlugin *plugin)
460 /* register some standard builtin types */
461 g_assert (gst_element_register (plugin, "bin", GST_RANK_PRIMARY, GST_TYPE_BIN));
462 g_assert (gst_element_register (plugin, "pipeline", GST_RANK_PRIMARY, GST_TYPE_PIPELINE));
463 g_assert (gst_element_register (plugin, "thread", GST_RANK_PRIMARY, GST_TYPE_THREAD));
464 g_assert (gst_element_register (plugin, "queue", GST_RANK_PRIMARY, GST_TYPE_QUEUE));
469 static GstPluginDesc plugin_desc = {
473 "core elements of the GStreamer library",
474 gst_register_core_elements,
486 * - initalization of threads if we use them
489 * - initializes gst_format
490 * - registers a bunch of types for gst_objects
492 * - we don't have cases yet where this fails, but in the future
493 * we might and then it's nice to be able to return that
499 const gchar *plugin_path;
500 #ifndef GST_DISABLE_TRACE
502 #endif /* GST_DISABLE_TRACE */
504 llf = G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL;
505 g_log_set_handler (g_log_domain_gstreamer, llf, debug_log_handler, NULL);
507 GST_INFO ("Initializing GStreamer Core Library version %s %s",
508 VERSION, _gst_use_threads ? "" : "(no threads)");
510 _gst_format_initialize ();
511 _gst_query_type_initialize ();
512 gst_object_get_type ();
514 gst_real_pad_get_type ();
515 gst_ghost_pad_get_type ();
516 gst_element_factory_get_type ();
517 gst_element_get_type ();
518 gst_scheduler_factory_get_type ();
519 gst_type_find_factory_get_type ();
521 #ifndef GST_DISABLE_INDEX
522 gst_index_factory_get_type ();
523 #endif /* GST_DISABLE_INDEX */
524 #ifndef GST_DISABLE_URI
525 gst_uri_handler_get_type ();
526 #endif /* GST_DISABLE_URI */
528 plugin_path = g_getenv ("GST_PLUGIN_PATH");
529 #ifndef GST_DISABLE_REGISTRY
530 split_and_iterate (plugin_path, G_SEARCHPATH_SEPARATOR_S, add_path_func, _user_registry);
531 #endif /* GST_DISABLE_REGISTRY */
533 /* register core plugins */
534 _gst_plugin_register_static (&plugin_desc);
536 _gst_cpu_initialize (_gst_enable_cpu_opt);
537 _gst_structure_initialize ();
538 _gst_value_initialize ();
539 _gst_caps_initialize ();
540 _gst_plugin_initialize ();
541 _gst_event_initialize ();
542 _gst_buffer_initialize ();
543 _gst_tag_initialize ();
545 #ifndef GST_DISABLE_REGISTRY
546 if (!_gst_registry_fixed) {
547 /* don't override command-line options */
548 if (g_getenv ("GST_REGISTRY")) {
549 g_object_set (_user_registry, "location", g_getenv ("GST_REGISTRY"), NULL);
550 _gst_registry_fixed = TRUE;
554 if (!_gst_registry_fixed) {
555 gst_registry_pool_add (_global_registry, 100);
556 gst_registry_pool_add (_user_registry, 50);
558 gst_registry_pool_add (_user_registry, 50);
561 if (_gst_registry_auto_load) {
562 gst_registry_pool_load_all ();
564 #endif /* GST_DISABLE_REGISTRY */
566 /* if we need to preload plugins */
567 if (preload_plugins) {
568 g_slist_foreach (preload_plugins, load_plugin_func, NULL);
569 g_slist_free (preload_plugins);
570 preload_plugins = NULL;
573 #ifndef GST_DISABLE_TRACE
576 gst_trace = gst_trace_new ("gst.trace", 1024);
577 gst_trace_set_default (gst_trace);
579 #endif /* GST_DISABLE_TRACE */
580 if (_gst_progname == NULL) {
581 _gst_progname = g_strdup ("gstprog");
587 #ifndef GST_DISABLE_GST_DEBUG
589 sort_by_category_name (gconstpointer a, gconstpointer b)
591 return strcmp (gst_debug_category_get_name ((GstDebugCategory *) a),
592 gst_debug_category_get_name ((GstDebugCategory *) b));
595 gst_debug_help (void)
598 GList *list2, *walk2;
603 walk2 = list2 = gst_registry_pool_plugin_list ();
605 GstPlugin *plugin = GST_PLUGIN (walk2->data);
606 walk2 = g_list_next (walk2);
608 if (!gst_plugin_is_loaded (plugin)) {
609 #ifndef GST_DISABLE_REGISTRY
610 if (GST_IS_REGISTRY (plugin->manager)) {
611 GST_CAT_LOG (GST_CAT_PLUGIN_LOADING, "loading plugin %s", plugin->desc.name);
612 if (gst_registry_load_plugin (GST_REGISTRY (plugin->manager), plugin) != GST_REGISTRY_OK)
613 GST_CAT_WARNING (GST_CAT_PLUGIN_LOADING, "loading plugin %s failed", plugin->desc.name);
615 #endif /* GST_DISABLE_REGISTRY */
620 list = gst_debug_get_all_categories ();
621 walk = list = g_slist_sort (list, sort_by_category_name);
624 g_print ("name level description\n");
625 g_print ("---------------------+--------+--------------------------------\n");
628 GstDebugCategory *cat = (GstDebugCategory *) walk->data;
630 if (gst_debug_is_colored ()) {
631 gchar *color = gst_debug_construct_term_color (cat->color);
632 g_print ("%s%-20s\033[00m %1d %s %s%s\033[00m\n",
634 gst_debug_category_get_name (cat),
635 gst_debug_category_get_threshold (cat),
636 gst_debug_level_get_name (gst_debug_category_get_threshold (cat)),
638 gst_debug_category_get_description (cat));
641 g_print ("%-20s %1d %s %s\n", gst_debug_category_get_name (cat),
642 gst_debug_category_get_threshold (cat),
643 gst_debug_level_get_name (gst_debug_category_get_threshold (cat)),
644 gst_debug_category_get_description (cat));
646 walk = g_slist_next (walk);
654 init_popt_callback (poptContext context, enum poptCallbackReason reason,
655 const struct poptOption *option, const char *arg, void *data)
657 GLogLevelFlags fatal_mask;
662 case POPT_CALLBACK_REASON_PRE:
663 if (!init_pre ()) _gst_initialization_failure = TRUE;
665 case POPT_CALLBACK_REASON_OPTION:
666 switch (option->val) {
668 g_print ("GStreamer Core Library version %s\n", GST_VERSION);
670 case ARG_FATAL_WARNINGS:
671 fatal_mask = g_log_set_always_fatal (G_LOG_FATAL_MASK);
672 fatal_mask |= G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL;
673 g_log_set_always_fatal (fatal_mask);
675 #ifndef GST_DISABLE_GST_DEBUG
676 case ARG_DEBUG_LEVEL: {
678 tmp = strtol (arg, NULL, 0);
679 if (tmp >= 0 && tmp < GST_LEVEL_COUNT) {
680 gst_debug_set_default_threshold (tmp);
685 parse_debug_list (arg);
687 case ARG_DEBUG_NO_COLOR:
688 gst_debug_set_colored (FALSE);
690 case ARG_DEBUG_DISABLE:
691 gst_debug_set_active (FALSE);
697 case ARG_DISABLE_CPU_OPT:
698 _gst_enable_cpu_opt = FALSE;
700 case ARG_PLUGIN_SPEW:
702 case ARG_PLUGIN_PATH:
703 #ifndef GST_DISABLE_REGISTRY
704 split_and_iterate (arg, G_SEARCHPATH_SEPARATOR_S, add_path_func, _user_registry);
705 #endif /* GST_DISABLE_REGISTRY */
707 case ARG_PLUGIN_LOAD:
708 split_and_iterate (arg, ",", prepare_for_load_plugin_func, NULL);
710 case ARG_SEGTRAP_DISABLE:
711 _gst_disable_segtrap = TRUE;
714 gst_scheduler_factory_set_default_name (arg);
717 #ifndef GST_DISABLE_REGISTRY
718 g_object_set (G_OBJECT (_user_registry), "location", arg, NULL);
719 _gst_registry_fixed = TRUE;
720 #endif /* GST_DISABLE_REGISTRY */
723 g_warning ("option %d not recognized", option->val);
727 case POPT_CALLBACK_REASON_POST:
728 if (!init_post ()) _gst_initialization_failure = TRUE;
729 gst_initialized = TRUE;
736 * @use_threads: a #gboolean indicating whether threads should be used
738 * Instructs the core to turn on/off threading. When threading
739 * is turned off, all thread operations such as mutexes and conditionals
740 * are turned into NOPs. use this if you want absolute minimal overhead
741 * and you don't use any threads in the pipeline.
743 * This function may only be called before threads are initialized. This
744 * usually happens when calling gst_init.
748 gst_use_threads (gboolean use_threads)
750 g_return_if_fail (!gst_initialized);
751 g_return_if_fail (g_thread_supported ());
753 _gst_use_threads = use_threads;
759 * Queries if GStreamer has threads enabled.
761 * Returns: %TRUE if threads are enabled.
764 gst_has_threads (void)
766 return _gst_use_threads;
770 static GSList *mainloops = NULL;
775 * Enters the main GStreamer processing loop.
782 loop = g_main_loop_new (NULL, FALSE);
783 mainloops = g_slist_prepend (mainloops, loop);
785 g_main_loop_run (loop);
791 * Exits the main GStreamer processing loop.
797 g_error ("Quit more loops than there are");
799 GMainLoop *loop = mainloops->data;
800 mainloops = g_slist_delete_link (mainloops, mainloops);
801 g_main_loop_quit (loop);
802 g_main_loop_unref (loop);
808 * @major: pointer to a guint to store the major version number
809 * @minor: pointer to a guint to store the minor version number
810 * @micro: pointer to a guint to store the micro version number
812 * Gets the version number of the GStreamer library.
815 gst_version (guint *major, guint *minor, guint *micro)
817 g_return_if_fail (major);
818 g_return_if_fail (minor);
819 g_return_if_fail (micro);
821 *major = GST_VERSION_MAJOR;
822 *minor = GST_VERSION_MINOR;
823 *micro = GST_VERSION_MICRO;