How do I diagnose problems in loading a gstreamer plugin?

4.4k views Asked by At

I have created a gstreamer plugin with an element inside that would generate some data when put in a pipeline (by following the GStreamer Plugin Writer's Guide).

My problem is that I cannot load my plugin in a test application. When I call gst_element_factory_make("myextractor", NULL) the result is always NULL.

More data (I'm not sure this is related):

When I run gst-inspect on my dll I get incomplete output (output generated using cygwin):

beq11049@beqleuleu1nb028 /cygdrive/c/work
$ /cygdrive/c/OSSBuild/GStreamer/v0.10.6/bin/gst-inspect.exe MyProject/Release/gstxyzlibrary.dll
Plugin Details:
  Name:                 myextractor
  Description:          XYZ Library
  Filename:             MyProject/Release/gstxyzlibrary.dll
  Version:              1.0
  License:              LGPL
  Source module:        myextractor
  Binary package:       MyProject
  Origin URL:           http://www.example.com/

  myextractor: XYZExtractor

  1 features:
  +-- 1 elements

If I compare this with the avisubtitle addon (from the GStreamer Good Plug-ins package) I get a lot less information for mine.

For example, my plugin says:

  1 features:
  +-- 1 elements

The avisubtitle plugin says (generated using $ /cygdrive/c/OSSBuild/GStreamer/v0.10.6/bin/gst-inspect.exe avisubtitle):

GObject
 +----GstObject
       +----GstElement
             +----GstAviSubtitle

My question: I need advice on how to debug this / determine what I am missing (enabling debugging output, settings and paths to check and so on). My test code (the call to gst_element_factory_make) is written in a Songbird adon, but I get the same results if I put my code in a separate executable.

2

There are 2 answers

0
James On BEST ANSWER

It might be because the loader can't find your plugin, you should check that your plugin is in the shared library path:

Make sure you've set the LD_LIBRARY_PATH environment variable to the directory containing your compiled plugin.

In cygwin, add this to your .profile, or run it before you run your program:

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/cygdrive/c/path/to/your/plugin/"

You could also use the -L linker option to specify a search path at compile time.

0
elmarco On

I am not sure how to answer your question, because there might be several things missing. I think about unresolved symbol depedencies (although unlikely, since you can actually inspect your plugin) or wrong registration, somehow (it's also difficult to get it wrong), perhaps issue with songbird or windows that I ignore.

However, I just want to clear out one thing: GStreamer has "plug-ins" (aka dynamically loadable library) that can contain one or more elements. When you gst-introspect the plug-in or the element, you get different outputs! In the case of "avisubtitle", it's an element, and you can read the class hierarchy. If you introspect the plugin (or the library) "avi" or "/usr/lib/gstreamer-0.10/libgstavi.so" (on Unixes), you get the list of elements it contains and some common properties (version, project etc..).

For example, gst-introspect XYZ (XYZ a library or a path to a library) is different than gst-introspect XYZ (XYZ the name of the element in the XYZ library)

Perhaps that will helps you. good luck! Oh, and errors/warning can be displayed with the environment variable GST_DEBUG=*:2