Ejemplo n.º 1
0
/* we have no fail cases yet, but maybe in the future */
static gboolean
init_pre (GOptionContext * context, GOptionGroup * group, gpointer data,
    GError ** error)
{
  gchar *libdir;
  if (gst_initialized) {
    GST_DEBUG ("already initialized");
    return TRUE;
  }

  _priv_gst_start_time = gst_util_get_timestamp ();

#ifndef GST_DISABLE_GST_DEBUG
  _priv_gst_debug_init ();
  priv_gst_dump_dot_dir = g_getenv ("GST_DEBUG_DUMP_DOT_DIR");
#endif

#ifdef ENABLE_NLS
  bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#endif /* ENABLE_NLS */

  /* This is the earliest we can make stuff show up in the logs.
   * So give some useful info about GStreamer here */
#ifdef G_OS_WIN32
  {
    gchar *basedir =
        g_win32_get_package_installation_directory_of_module
        (_priv_gst_dll_handle);

    libdir = g_build_filename (basedir,
#ifdef _DEBUG
        "debug"
#endif
        "lib", NULL);
    g_free (basedir);
  }
#else
  libdir = g_strdup (LIBDIR);
#endif
  GST_INFO ("Initializing GStreamer Core Library version %s", VERSION);
  GST_INFO ("Using library installed in %s", libdir);
  g_free (libdir);

  /* Print some basic system details if possible (OS/architecture) */
#ifdef HAVE_SYS_UTSNAME_H
  {
    struct utsname sys_details;

    if (uname (&sys_details) == 0) {
      GST_INFO ("%s %s %s %s %s", sys_details.sysname,
          sys_details.nodename, sys_details.release, sys_details.version,
          sys_details.machine);
    }
  }
#endif

#ifndef G_ATOMIC_LOCK_FREE
  GST_CAT_WARNING (GST_CAT_PERFORMANCE, "GLib atomic operations are NOT "
      "implemented using real hardware atomic operations!");
#endif

  return TRUE;
}
Ejemplo n.º 2
0
/* we have no fail cases yet, but maybe in the future */
static gboolean
init_pre (GOptionContext * context, GOptionGroup * group, gpointer data,
    GError ** error)
{
  if (gst_initialized) {
    GST_DEBUG ("already initialized");
    return TRUE;
  }
#if !GLIB_CHECK_VERSION(2, 35, 0)
  g_type_init ();
#endif

#ifndef GST_DISABLE_GST_DEBUG
  _priv_gst_debug_init ();
#endif

#ifdef ENABLE_NLS
  bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#endif /* ENABLE_NLS */

#ifndef GST_DISABLE_GST_DEBUG
  {
    const gchar *debug_list;
    const gchar *color_mode;

    if (g_getenv ("GST_DEBUG_NO_COLOR") != NULL)
      gst_debug_set_color_mode (GST_DEBUG_COLOR_MODE_OFF);
    color_mode = g_getenv ("GST_DEBUG_COLOR_MODE");
    if (color_mode)
      gst_debug_set_color_mode_from_string (color_mode);

    debug_list = g_getenv ("GST_DEBUG");
    if (debug_list) {
      gst_debug_set_threshold_from_string (debug_list, FALSE);
    }
  }

  priv_gst_dump_dot_dir = g_getenv ("GST_DEBUG_DUMP_DOT_DIR");
#endif
  /* This is the earliest we can make stuff show up in the logs.
   * So give some useful info about GStreamer here */
  GST_INFO ("Initializing GStreamer Core Library version %s", VERSION);
  GST_INFO ("Using library installed in %s", LIBDIR);

  /* Print some basic system details if possible (OS/architecture) */
#ifdef HAVE_SYS_UTSNAME_H
  {
    struct utsname sys_details;

    if (uname (&sys_details) == 0) {
      GST_INFO ("%s %s %s %s %s", sys_details.sysname,
          sys_details.nodename, sys_details.release, sys_details.version,
          sys_details.machine);
    }
  }
#endif

#ifndef G_ATOMIC_LOCK_FREE
  GST_CAT_WARNING (GST_CAT_PERFORMANCE, "GLib atomic operations are NOT "
      "implemented using real hardware atomic operations!");
#endif

  return TRUE;
}