tags:

views:

37

answers:

2

I am trying to render a GStreamer pipeline running on top of a XUL window.

For this I wrote an XPCOM plugin. A XPCOM plugin is basically a dll file that gets loaded by the Gecko engine. My plugin links with GStreamer and as a consequence it depends on many other GStreamer plugins (also dll files).

Invoking GStreamer code (for example a simple function like gst_pipeline_new) causes the application to crash. More specifically it freezes and hangs in glib consuming an entire CPU core (50% of total CPU):

alt text

Would someone be willing to help me figure out what's going wrong?

Edit

A few remarks:

  • Stand-alone GStreamer projects on Windows work fine.
  • The XUL plugin works fine as well (as long as I don't make any GStreamer calls).
  • From within the XUL plugin I can call a simple glib functions like g_strndup without any problems.
  • Calling GStreamer functions from within the plugin crashes the app.

This code can reproduce the problem. (I'm not sure if it's helpful though..)

The plugin .idl file defines the property videoWindow:

#include "nsISupports.idl"
interface nsIDOMXULElement;

[scriptable, uuid(BFE3F1BF-1C7B-4da2-8EAB-12F7683FAF71)]
interface IVideo : nsISupports
{
  attribute nsIDOMXULElement videoWindow;
};

Its implementation can reproduce the problem:

NS_IMETHODIMP Video::SetVideoWindow(nsIDOMXULElement * inXULVideoWindow)
{
    GstElement * pipeline = gst_pipeline_new("test"); // freezes here
    return NS_OK;
}

Edit
Problem is fixed. See my own answer to this post.

A: 

Fix your symbols so that you can read the gstreamer and glib functions - this may require compiling these two libraries from source. Once you see the real stack, solving the problem will be much easier.

Paul Betts
A: 

Ok, I'm embarrased... I forgot to execute the GStreamer initialization function:

gst_init(NULL, NULL);

Problem is fixed now.

StackedCrooked