* SECTION:gst
* @short_description: Media library supporting arbitrary formats and filter
* graphs.
- * @see_also: Check out both <ulink url="http://www.cse.ogi.edu/sysl/">OGI's
- * pipeline</ulink> and Microsoft's DirectShow for some background.
*
* GStreamer is a framework for constructing graphs of various filters
* (termed elements here) that will handle streaming media. Any discreet
* a powerful negotiation framework. Plugins are heavily used to provide for
* all elements, allowing one to construct plugins outside of the GST
* library, even released binary-only if license require (please don't).
- *
- * GStreamer borrows heavily from both the <ulink
- * url="http://www.cse.ogi.edu/sysl/">OGI media pipeline</ulink> and
- * Microsoft's DirectShow, hopefully taking the best of both and leaving the
- * cruft behind. Its interface is slowly getting stable.
+ * GStreamer covers a wide range of use cases including: playback, recording,
+ * editing, serving streams, voice over ip and video calls.
*
* The <application>GStreamer</application> library should be initialized with
* gst_init() before it can be used. You should pass pointers to the main argc
}
static gboolean
-parse_debug_level (gchar * str, gint * level)
+parse_debug_level (gchar * str, GstDebugLevel * level)
{
if (!str)
return FALSE;
if (str[0] != NUL && str[1] == NUL
&& str[0] >= '0' && str[0] < '0' + GST_LEVEL_COUNT) {
- *level = str[0] - '0';
+ *level = (GstDebugLevel) (str[0] - '0');
return TRUE;
}
gchar **split;
gchar **walk;
- g_return_if_fail (list != NULL);
+ g_assert (list);
split = g_strsplit (list, ",", 0);
gchar **values = g_strsplit (*walk, ":", 2);
if (values[0] && values[1]) {
- gint level;
+ GstDebugLevel level;
const gchar *category;
if (parse_debug_category (values[0], &category)
g_strfreev (values);
} else {
- gint level;
+ GstDebugLevel level;
if (parse_debug_level (*walk, &level))
gst_debug_set_default_threshold (level);
#endif
#ifdef G_OS_WIN32
+BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);
BOOL WINAPI
DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
* threading system as one of the very first things in your program
* (see the example at the beginning of this section).
*
- * Returns: a pointer to GStreamer's option group.
+ * Returns: (transfer full): a pointer to GStreamer's option group.
*/
GOptionGroup *
{NULL}
};
- /* The GLib threading system must be initialised before calling any other
- * GLib function according to the documentation; if the application hasn't
- * called gst_init() yet or initialised the threading system otherwise, we
- * better issue a warning here (since chances are high that the application
- * has already called other GLib functions such as g_option_context_new() */
- if (!g_thread_supported ()) {
- g_warning ("The GStreamer function gst_init_get_option_group() was\n"
- "\tcalled, but the GLib threading system has not been initialised\n"
- "\tyet, something that must happen before any other GLib function\n"
- "\tis called. The application needs to be fixed so that it calls\n"
- "\t if (!g_thread_supported ()) g_thread_init(NULL);\n"
- "\tas very first thing in its main() function. Please file a bug\n"
- "\tagainst this application.");
- g_thread_init (NULL);
+/* Since GLib 2.31.0 threading is always enabled and g_thread_init()
+ * is not needed any longer and deprecated */
+#if !GLIB_CHECK_VERSION (2, 31, 0)
+ /* Since GLib 2.23.2 calling g_thread_init() 'late' is allowed and is
+ * automatically done as part of g_type_init() */
+ if (glib_check_version (2, 23, 3)) {
+ /* The GLib threading system must be initialised before calling any other
+ * GLib function according to the documentation; if the application hasn't
+ * called gst_init() yet or initialised the threading system otherwise, we
+ * better issue a warning here (since chances are high that the application
+ * has already called other GLib functions such as g_option_context_new() */
+ if (!g_thread_get_initialized ()) {
+ g_warning ("The GStreamer function gst_init_get_option_group() was\n"
+ "\tcalled, but the GLib threading system has not been initialised\n"
+ "\tyet, something that must happen before any other GLib function\n"
+ "\tis called. The application needs to be fixed so that it calls\n"
+ "\t if (!g_thread_get_initialized ()) g_thread_init(NULL);\n"
+ "\tas very first thing in its main() function. Please file a bug\n"
+ "\tagainst this application.");
+ g_thread_init (NULL);
+ }
+ } else {
+ /* GLib >= 2.23.2 */
}
+#endif
group = g_option_group_new ("gst", _("GStreamer Options"),
_("Show GStreamer Options"), NULL, NULL);
/**
* gst_init_check:
- * @argc: pointer to application's argc
- * @argv: pointer to application's argv
+ * @argc: (inout) (allow-none): pointer to application's argc
+ * @argv: (inout) (array length=argc) (allow-none): pointer to application's argv
* @err: pointer to a #GError to which a message will be posted on error
*
* Initializes the GStreamer library, setting up internal path lists,
#endif
gboolean res;
- if (!g_thread_supported ())
+#if !GLIB_CHECK_VERSION (2, 31, 0)
+ if (!g_thread_get_initialized ())
g_thread_init (NULL);
+#endif
if (gst_initialized) {
GST_DEBUG ("already initialized gst");
/**
* gst_init:
- * @argc: (inout): pointer to application's argc
+ * @argc: (inout) (allow-none): pointer to application's argc
* @argv: (inout) (array length=argc) (allow-none): pointer to application's argv
*
* Initializes the GStreamer library, setting up internal path lists,
* registering built-in elements, and loading standard plugins.
*
+ * Unless the plugin registry is disabled at compile time, the registry will be
+ * loaded. By default this will also check if the registry cache needs to be
+ * updated and rescan all plugins if needed. See gst_update_registry() for
+ * details and section
+ * <link linkend="gst-running">Running GStreamer Applications</link>
+ * for how to disable automatic registry updates.
+ *
* This function should be called before calling any other GLib functions. If
* this is not an option, your program must initialise the GLib thread system
* using g_thread_init() before any other GLib functions are called.
}
}
+/**
+ * gst_is_initialized:
+ *
+ * Use this function to check if GStreamer has been initialized with gst_init()
+ * or gst_init_check().
+ *
+ * Returns: TRUE if initialization has been done, FALSE otherwise.
+ *
+ * Since: 0.10.31
+ */
+gboolean
+gst_is_initialized (void)
+{
+ return gst_initialized;
+}
+
#ifndef GST_DISABLE_REGISTRY
static void
add_path_func (gpointer data, gpointer user_data)
#ifndef GST_DISABLE_OPTION_PARSING
static void
-split_and_iterate (const gchar * stringlist, gchar * separator, GFunc iterator,
- gpointer user_data)
+split_and_iterate (const gchar * stringlist, const gchar * separator,
+ GFunc iterator, gpointer user_data)
{
gchar **strings;
gint j = 0;
return TRUE;
}
- /* GStreamer was built against a GLib >= 2.8 and is therefore not doing
- * the refcount hack. Check that it isn't being run against an older GLib */
- if (glib_major_version < 2 ||
- (glib_major_version == 2 && glib_minor_version < 8)) {
- g_warning ("GStreamer was compiled against GLib %d.%d.%d but is running"
- " against %d.%d.%d. This will cause reference counting issues",
- GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION,
- glib_major_version, glib_minor_version, glib_micro_version);
- }
-
g_type_init ();
+#if !GLIB_CHECK_VERSION (2, 31, 0)
/* we need threading to be enabled right here */
- g_assert (g_thread_supported ());
+ g_assert (g_thread_get_initialized ());
+#endif
+
_gst_debug_init ();
#ifdef ENABLE_NLS
g_type_class_ref (gst_event_type_get_type ());
g_type_class_ref (gst_seek_type_get_type ());
g_type_class_ref (gst_seek_flags_get_type ());
+ g_type_class_ref (gst_qos_type_get_type ());
g_type_class_ref (gst_format_get_type ());
g_type_class_ref (gst_index_certainty_get_type ());
g_type_class_ref (gst_index_entry_type_get_type ());
g_type_class_ref (gst_message_type_get_type ());
g_type_class_ref (gst_mini_object_flags_get_type ());
g_type_class_ref (gst_pad_link_return_get_type ());
+ g_type_class_ref (gst_pad_link_check_get_type ());
g_type_class_ref (gst_flow_return_get_type ());
g_type_class_ref (gst_activate_mode_get_type ());
g_type_class_ref (gst_pad_direction_get_type ());
g_type_class_ref (gst_parse_error_get_type ());
g_type_class_ref (gst_parse_flags_get_type ());
g_type_class_ref (gst_search_mode_get_type ());
+ g_type_class_ref (gst_progress_type_get_type ());
+ g_type_class_ref (gst_caps_intersect_mode_get_type ());
gst_structure_get_type ();
_gst_value_initialize ();
_gst_event_initialize ();
_gst_buffer_initialize ();
_gst_buffer_list_initialize ();
+ gst_buffer_list_iterator_get_type ();
_gst_message_initialize ();
_gst_tag_initialize ();
+ gst_parse_context_get_type ();
_gst_plugin_initialize ();
}
#endif /* GST_DISABLE_TRACE */
+ GST_INFO ("GLib runtime version: %d.%d.%d", glib_major_version,
+ glib_minor_version, glib_micro_version);
+ GST_INFO ("GLib headers version: %d.%d.%d", GLIB_MAJOR_VERSION,
+ GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
+
return TRUE;
}
}
#ifndef GST_DISABLE_GST_DEBUG
case ARG_DEBUG_LEVEL:{
- gint tmp = 0;
+ GstDebugLevel tmp = GST_LEVEL_NONE;
- tmp = strtol (arg, NULL, 0);
+ tmp = (GstDebugLevel) strtol (arg, NULL, 0);
if (tmp >= 0 && tmp < GST_LEVEL_COUNT) {
gst_debug_set_default_threshold (tmp);
}
{
static const struct
{
- gchar *opt;
+ const gchar *opt;
int val;
} options[] = {
{
g_type_class_unref (g_type_class_peek (gst_event_type_get_type ()));
g_type_class_unref (g_type_class_peek (gst_seek_type_get_type ()));
g_type_class_unref (g_type_class_peek (gst_seek_flags_get_type ()));
+ g_type_class_unref (g_type_class_peek (gst_qos_type_get_type ()));
g_type_class_unref (g_type_class_peek (gst_format_get_type ()));
g_type_class_unref (g_type_class_peek (gst_index_certainty_get_type ()));
g_type_class_unref (g_type_class_peek (gst_index_entry_type_get_type ()));
g_type_class_unref (g_type_class_peek (gst_message_type_get_type ()));
g_type_class_unref (g_type_class_peek (gst_mini_object_flags_get_type ()));
g_type_class_unref (g_type_class_peek (gst_pad_link_return_get_type ()));
+ g_type_class_unref (g_type_class_peek (gst_pad_link_check_get_type ()));
g_type_class_unref (g_type_class_peek (gst_flow_return_get_type ()));
g_type_class_unref (g_type_class_peek (gst_activate_mode_get_type ()));
g_type_class_unref (g_type_class_peek (gst_pad_direction_get_type ()));
g_type_class_unref (g_type_class_peek (gst_uri_type_get_type ()));
g_type_class_unref (g_type_class_peek (gst_parse_error_get_type ()));
g_type_class_unref (g_type_class_peek (gst_param_spec_fraction_get_type ()));
+ g_type_class_unref (g_type_class_peek (gst_progress_type_get_type ()));
+ g_type_class_unref (g_type_class_peek (gst_caps_intersect_mode_get_type ()));
gst_deinitialized = TRUE;
GST_INFO ("deinitialized GStreamer");
/**
* gst_version:
- * @major: pointer to a guint to store the major version number
- * @minor: pointer to a guint to store the minor version number
- * @micro: pointer to a guint to store the micro version number
- * @nano: pointer to a guint to store the nano version number
+ * @major: (out): pointer to a guint to store the major version number
+ * @minor: (out): pointer to a guint to store the minor version number
+ * @micro: (out): pointer to a guint to store the micro version number
+ * @nano: (out): pointer to a guint to store the nano version number
*
* Gets the version number of the GStreamer library.
*/
* This function returns a string that is useful for describing this version
* of GStreamer to the outside world: user agent strings, logging, ...
*
- * Returns: a newly allocated string describing this version of GStreamer.
+ * Returns: (transfer full): a newly allocated string describing this version
+ * of GStreamer.
*/
gchar *
-gst_version_string ()
+gst_version_string (void)
{
guint major, minor, micro, nano;