How to define get_type function in gstreamer plugin

Tim-Philipp Müller t.i.m at zen.co.uk
Sun Aug 25 08:09:41 PDT 2013


On Thu, 2013-08-22 at 20:49 +0530, Yogesh Tyagi wrote:

Hi,

> I have added a get_type function in one gstreamer plugin:
> 
> 
> GType ts_pmt_info_get_type (void);
> 
> 
> #define TS_TYPE_PMT_INFO (ts_pmt_info_get_type ())
> #define TS_IS_PMT_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),
> TS_TYPE_PMT_INFO))
> #define TS_PMT_INFO(obj)
> (G_TYPE_CHECK_INSTANCE_CAST((obj),TS_TYPE_PMT_INFO, TsPmtInfo))
> 
> 
> 
> 
> But when I try to inspect this plugin using gst-inspect, gstreamer
> fails to load this plugin due to undefined symbol.
> 
> 
> # gst-inspect /usr/lib/libgstts.so
> 
> 
> (gst-inspect-0.10:3461): GStreamer-WARNING **: External plugin loader
> failed. This most likely means that the plugin loader helper binary
> was not found or could not be run. If you are running an uninstalled
> GStreamer setup, you might need to update your gst-uninstalled script
> so that the GST_PLUGIN_SCANNER environment variable gets set.
> 
> 
> (gst-inspect-0.10:3461): GStreamer-WARNING **: Failed to load plugin
> '/usr/lib/libgstts.so': /usr/lib/libgstts.so: undefined symbol:
> ts_pmt_info_get_type
> 
> 
> (gst-inspect-0.10:3461): GStreamer-WARNING **: Failed to load plugin
> '/usr/lib/libgstts.so': /usr/lib/libgstts.so: undefined symbol:
> ts_pmt_info_get_type
> Could not load plugin file: Opening module
> failed: /usr/lib/libgstts.so: undefined symbol: ts_pmt_info_get_type
> 
> 
> 
> 
> I have checked other get_type functions in this plugin and they have
> been defined in the similar way, I don't know why I am getting
> undefined symbol for this function.
> 
> 
> Am I missing something? Please suggest.

The code you pasted simply *declares* the function signature of the
get_type function, it doesn't actually *provide* the function
implementation.

In most code, the actual get_type function implementation is done by a
macro such as GST_BOILERPLATE or G_DEFINE_TYPE.

Maybe show us all of the code for your plugin?

Cheers
 -Tim




More information about the gstreamer-devel mailing list