[gstreamer-bugs] [Bug 369281] New: Initialization assertion failed, use g_type_init prior to this function

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Wed Nov 1 23:30:12 PST 2006


Do not reply to this via email (we are currently unable to handle email
responses and they get discarded).  You can add comments to this bug at
http://bugzilla.gnome.org/show_bug.cgi?id=369281

  GStreamer | gstreamer (core) | Ver: 0.10.10

           Summary: Initialization assertion failed, use g_type_init prior
                    to this function
           Product: GStreamer
           Version: 0.10.10
          Platform: Other
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: critical
          Priority: Normal
         Component: gstreamer (core)
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: wanjinxue at sohu.com
         QAContact: gstreamer-bugs at lists.sourceforge.net
     GNOME version: Unspecified
   GNOME milestone: Unspecified


I wrote a mp3player with the source code as following:

#include <gst/gst.h>
#define N_(string) string 
#define GETTEXT_PACKAGE "gstreamer-0.10"

static gboolean __gst_tools_version = FALSE;
#define GST_TOOLS_GOPTION_VERSION \
    { "version", 0, 0, G_OPTION_ARG_NONE, &__gst_tools_version, \
      N_("Print version information and exit"), NULL }


/* global statics for option parsing */
static gboolean _print = FALSE;
static gchar *_arg_mm = NULL;
static gboolean _arg_list_mm = FALSE;

/* popt options table for the wrapper */
static GOptionEntry wrapper_options[] = {
  {"print", 'p', 0, G_OPTION_ARG_NONE, &_print,
      "print wrapped command line options", NULL},
  {"gst-mm", 0, 0, G_OPTION_ARG_STRING, &_arg_mm,
      "Force major/minor version", "VERSION"},
  {"gst-list-mm", 0, 0, G_OPTION_ARG_NONE, &_arg_list_mm,
      "List found major/minor versions", NULL},
  {NULL}
};
int main (int argc, char *argv[])
{
  GstElement *pipeline, *filesrc, *decoder, *audiosink;
  //gst_init(&argc, &argv); //with this func, I can't init rightly, why? 

  GOptionContext *ctx;
  GError *err = NULL;
        guint major=0, minor=0, micro=0, nano=0;
        gst_version(&major, &minor, &micro, &nano);
        printf("[david] this program is linked to GStreamer
Version-%d.%d.%d.%d\n", major, minor, micro, nano);
  /* parse command line options */
  ctx = g_option_context_new ("PIPE-LINE");
  g_option_context_set_ignore_unknown_options (ctx, TRUE);
  g_option_context_add_main_entries (ctx, wrapper_options, GETTEXT_PACKAGE);
  if (!g_option_context_parse (ctx, &argc, &argv, &err)) {
    g_print ("Error initializing: %s\n", err->message);
    exit (1);
  }else{
        printf("[david]  g_option_context_parse is okay\n");
  }     
  g_option_context_free (ctx);

  pipeline = gst_pipeline_new ("pipeline");
  filesrc = gst_element_factory_make ("filesrc", "disk_source");
  g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL);
  decoder = gst_element_factory_make ("mad", "decoder");
  audiosink = gst_element_factory_make ("osssink", "play_audio");
  gst_bin_add_many (GST_BIN (pipeline), filesrc, decoder, audiosink, NULL);
  gst_element_link_many (filesrc, decoder, audiosink, NULL);
  gst_element_set_state (pipeline, GST_STATE_PLAYING);
  //while (gst_bin_iterate (GST_BIN (pipeline))); // In ver-0.10.10 with which 
                                                  // func this func is placed   

  gst_element_set_state (pipeline, GST_STATE_NULL);
  gst_object_unref (GST_OBJECT (pipeline));
  exit (0);
}

I compiled it on Linux-2.4.20 with GG=gcc
CFLAGS=-g -O2 -I/usr/include -I/usr/local/include -I/usr/include/glib-2.0
-I/usr/include/gstreamer-0.10 -I/usr/lib/glib-2.0/include
-I/usr/include/libxml2 -Wall
LFLAGS= -lgstreamer-0.10 -lgstdataprotocol-0.10  -lgstbase-0.10
-lgstcontroller-0.10  -pthread -lgobject-2.0 -lgmodule-2.0 -ldl -lgthread-2.0
-lxml2 -lpthread -lz -lm -lglib-2.0

Compile is okay. Then I wanno run it like this:
./mp3player filesrc location=/home/purelove.mp3 ! mad ! osssink 
the result is error, like following:
[david] this program is linked to GStreamer Version-0.10.10.0
[david]  g_option_context_parse is okay
[david] argv[1]=audiotestsrc

(mp3player:4260): GLib-GObject-CRITICAL **: gtype.c:2240: initialization
assertion failed, use g_type_init() prior to this function

(mp3player:4260): GLib-GObject-CRITICAL **: gtype.c:2240: initialization
assertion failed, use g_type_init() prior to this function

(mp3player:4260): GLib-GObject-CRITICAL **: gtype.c:2240: initialization
assertion failed, use g_type_init() prior to this function

(mp3player:4260): GLib-GObject-CRITICAL **: gtype.c:2240: initialization
assertion failed, use g_type_init() prior to this function

(mp3player:4260): GLib-GObject-CRITICAL **: gtype.c:2240: initialization
assertion failed, use g_type_init() prior to this function

(mp3player:4260): GLib-GObject-CRITICAL **: g_object_new: assertion
`G_TYPE_IS_OBJECT (object_type)' failed

(mp3player:4260): GStreamer-CRITICAL **: gst_object_ref: assertion `object !=
NULL' failed

(mp3player:4260): GLib-GObject-CRITICAL **: gtype.c:2240: initialization
assertion failed, use g_type_init() prior to this function

(mp3player:4260): GStreamer-CRITICAL **: gst_object_sink: assertion
`GST_IS_OBJECT (object)' failed

(mp3player:4260): GLib-GObject-CRITICAL **: gtype.c:2240: initialization
assertion failed, use g_type_init() prior to this function

(mp3player:4260): GLib-GObject-CRITICAL **: gtype.c:2240: initialization
assertion failed, use g_type_init() prior to this function

(mp3player:4260): GStreamer-CRITICAL **: gst_registry_find_feature: assertion
`GST_IS_REGISTRY (registry)' failed

(mp3player:4260): GLib-GObject-CRITICAL **: gtype.c:2240: initialization
assertion failed, use g_type_init() prior to this function

(mp3player:4260): GLib-GObject-CRITICAL **: gtype.c:2240: initialization
assertion failed, use g_type_init() prior to this function

(mp3player:4260): GLib-GObject-CRITICAL **: gtype.c:2240: initialization
assertion failed, use g_type_init() prior to this function

(mp3player:4260): GLib-GObject-CRITICAL **: gtype.c:2240: initialization
assertion failed, use g_type_init() prior to this function

(mp3player:4260): GLib-GObject-CRITICAL **: gtype.c:2240: initialization
assertion failed, use g_type_init() prior to this function

(mp3player:4260): GLib-GObject-CRITICAL **: g_object_new: assertion
`G_TYPE_IS_OBJECT (object_type)' failed

(mp3player:4260): GStreamer-CRITICAL **: gst_object_ref: assertion `object !=
NULL' failed

(mp3player:4260): GLib-GObject-CRITICAL **: gtype.c:2240: initialization
assertion failed, use g_type_init() prior to this function

(mp3player:4260): GStreamer-CRITICAL **: gst_object_sink: assertion
`GST_IS_OBJECT (object)' failed

(mp3player:4260): GLib-GObject-CRITICAL **: gtype.c:2240: initialization
assertion failed, use g_type_init() prior to this function

(mp3player:4260): GLib-GObject-CRITICAL **: gtype.c:2240: initialization
assertion failed, use g_type_init() prior to this function

(mp3player:4260): GStreamer-CRITICAL **: gst_registry_find_feature: assertion
`GST_IS_REGISTRY (registry)' failed

...

what's the matter? 
 By the way, when I play it with gst-launch as:
   #gst-lauch filesrc location=/home/purelove.mp3 ! mad ! osssink 
 result is: 
   #WARNING: erroneous pipeline: @!$#$%!@#%

 with gst-inspect, I know that osssink was installed on my platform.
 I'm just a newbie on OPenMAX and GStreamer. Pls give me your hand on these
problems. Thx.


-- 
Configure bugmail: http://bugzilla.gnome.org/userprefs.cgi?tab=email




More information about the Gstreamer-bugs mailing list