Source push plugin

Tim Müller tim at centricular.com
Wed Jan 14 04:38:21 PST 2015


On Wed, 2015-01-14 at 11:35 +0000, Luis dArquer wrote:

Hi Luis,

> I have been working for a few days on a plugin for gstreamer 1.0. This
> plugin is intended to view data from an Optris thermal camera using
> gst-launch pipelines.
> 
> I have got the base skeleton for the plugin, based on the "Plugin
> Writer's Guide (1.4.5)". I based my plugin on the GstPushSrc plugin.
> Basically it includes all the class/object definition boilerplate, and
> overrides the gstbasesrc->start and gstpushsrc->create methods. As a
> result I have defined:
> 
> _class_init: sets details and adds pad template (defined before with GST_STATIC_PAD_TEMPLATE)
> _init (object): does nothing.
> _start: sets blocksize and call _start_complete

You usually don't have to do anything in start but reset your state, so
not sure this is needed. If you have a push source, the block size is
pretty much ignored anyway (note how GstPushSrc::create() doesn't have a
size parameter compared to GstBaseSrc::create()).

> _create: at the moment all it does is return GST_FLOW_OK

Ok.

> _init (plugin): registers the plugin
> 
> It compiles fine, creating libgstoptrissrc.so. However, when I try
> 
> gst-inspect-1.0 libgstoptrissrc.so
> 
> it hangs. I know I am not doing much in my code, but since my class is
> derived from GstPushSrc, I understand I only need to override the
> 'create' method. I would expect 'create' to make things fail, as it
> does not produce buffers yet, but does that really affect gst-inspect?
> I am not sure whether I should attach my code here or at Bugzilla,
> since it is neither a bug nor a patch.
> 
> Is there something obvious I may be missing?

If you just run gst-inspect-1.0, your plugin won't actually be started
up, so whatever the problem is, it probably has nothing to do with your
create implementation.

Try providing an absolute path to gst-inspect-1.0, like this:

 gst-inspect-1.0 `pwd`/libgstoptrissrc.so

or

 gst-inspect-1.0 /path/to/foo/bar/libgstoptrissrc.so

How long does it 'hang'? It might just create the GStreamer plugin cache
for the first time. If you're on a very slow / embedded system this
might take some time. On a normal laptop/desktop it should be quite fast
though.

Just run it in gdb and after it hung for a while, press control-C and
then type

 (gdb) thread apply all bt

That might give us a better idea of where it's stuck.

Also, does gst-inspect-1.0 without any parameters work fine?

Cheers
 -Tim


-- 
Tim Müller, Centricular Ltd - http://www.centricular.com



More information about the gstreamer-devel mailing list