<html><body>Hi,<br><br>thanks - when I was trying to make it run, I also found that "__gstelementfactory__.." registration thing, but it got rid only of the warning (no long name), but "CRITICAL pad != NULL" remained.. that is up until I installed those debug packages.<br><br>They were all installed after "apt-get install python-gst-1.0-dbg":<br><br>libpython-dbg<br>libpython2.7-dbg<br>python-dbg<br>python-gst-1.0<br>python-gst-1.0-dbg<br>python2.7-dbg<br><br>I can't see anything that could change behaviour of such a simple example.. I'm now trying to recreate this on freshly installed debian8 in virtualbox, so in a few hours I'll either confirm this problem or I'll be even more puzzled than I'm now..<br><br>I use gstreamer on production servers in rather critical system so I really need to find out if there is some potential problem before we switch them to new version using gstreamer-1.0, or if it was a fluke and I don't have to worry<br><br><br><p>---------- Původní zpráva ----------<br>Od: Thibault Saunier <tsaunier@gnome.org><br>Komu: Discussion of the development of and with GStreamer <gstreamer-devel@lists.freedesktop.org><br>Datum: 28. 10. 2015 15:47:41<br>Předmět: Re: creating custom sink in python fails</p><br><blockquote>Hello,<br><br>I just pushed[0] a version of that example ported to GstBaseSink[1]<br>and it works just fine.<br><br>Regards,<br><br>Thibault Saunier<br><br>[0] http://cgit.freedesktop.org/gstreamer/gst-python/commit/?id=7dffdb68642ad527c184022935f4424d5e002654<br>[1] http://cgit.freedesktop.org/gstreamer/gst-python/tree/examples/plugins/python/sinkelement.py<br><br>On Tue, Oct 27, 2015 at 7:38 PM, Jan Spurný <JSpurny@seznam.cz> wrote:<br>> Hi,<br>><br>> yes, I saw that example before and it didn't worked either.<br>><br>> But I got something new (and disturbing) - I installed "python-gst-1.0-dbg"<br>> package, so I could analyze all debug messages and to my great surprise, it<br>> started working (both my example and sinkelement.py). It now works even if I<br>> uninstall all "*-dbg" packages which were installed with<br>> "python-gst-1.0-dbg".<br>><br>> But it really doesn't help. I don't want to install debug packages on<br>> production servers. I really need to know WHAT went wrong..<br>> And it seems to me it's probably some bug in gstreamer-python binding, so I<br>> should report it.<br>><br>> BTW - my machine is (was) freshly installed last week and I just started<br>> porting our software from gstreamer-0.10 to gstreamer-1.0, so there was no<br>> "interference" with previously installed sw..<br>><br>><br>> ---------- Původní zpráva ----------<br>> Od: Thibault Saunier <tsaunier@gnome.org><br>> Komu: Discussion of the development of and with GStreamer<br>> <gstreamer-devel@lists.freedesktop.org><br>> Datum: 27. 10. 2015 19:15:25<br>> Předmět: Re: creating custom sink in python fails<br>><br>><br>> Hello,<br>><br>> That should work, we have an example in gst-python that implement a<br>> stupid simple sink in python[0]. It is based on GstElement instead of<br>> BaseSink but it should probably be ported.<br>><br>> Regards,<br>><br>> Thibault.<br>><br>> [0]<br>> http://cgit.freedesktop.org/gstreamer/gst-python/tree/examples/plugins/python/sinkelement.py<br>><br>> On Tue, Oct 27, 2015 at 2:45 PM, Jan Spurný <JSpurny@seznam.cz> wrote:<br>>> Hi,<br>>><br>>> I have problem with (probably) python binding for gstreamer-1.0 (1.4.4.0)<br>>> - I was porting some code from gstreamer-0.10 (pygst) to new gstreamer-1.0<br>>> and I'm not able to get elements written in python to work. This is minimal<br>>> working example (python2.7):<br>>><br>>> ---------------------------------------------------------------------<br>>> import gi<br>>> gi.require_version('Gst', '1.0')<br>>> from gi.repository import Gst<br>>> from gi.repository import GstBase<br>>> from gi.repository import GObject<br>>><br>>> GObject.threads_init()<br>>> Gst.init()<br>>><br>>> class MySink(GstBase.BaseSink):<br>>> __gstmetadata__ = ('My Sink', 'Sink', 'Sink', 'foo bar')<br>>> __gsttemplates__ = (<br>>> Gst.PadTemplate.new("sink",<br>>> Gst.PadDirection.SINK, Gst.PadPresence.ALWAYS,<br>>> Gst.caps_from_string('text/plain')),)<br>>><br>>> def plugin_init(plugin, userarg):<br>>> t = GObject.type_register(MySink)<br>>> Gst.Element.register(plugin, 'my_sink', 0, t)<br>>> return True<br>>><br>>> version = Gst.version()<br>>> r = Gst.Plugin.register_static_full(<br>>> version[0], version[1], 'my_plugin', 'my plugin desc',<br>>> plugin_init, '1.0', 'Proprietary', 'abc', 'def', 'ghi', None)<br>>><br>>> s = MySink()<br>>> ---------------------------------------------------------------------<br>>><br>>> and it throws a CRITICAL error:<br>>><br>>> ---------------------------------------------------------------------<br>>> $ ./mysink.py<br>>> (python2:18618): GStreamer-WARNING **: Element factory metadata for<br>>> 'my_sink' has no valid long-name field<br>>> ** (python2:18618): CRITICAL **: gst_base_sink_init: assertion<br>>> 'pad_template != NULL' failedI'm not that worried about the warning, but<br>>> that CRITICAL error means the element has no sinkpad and can't be linked.<br>>> ---------------------------------------------------------------------<br>>><br>>> And worst thing - if I remove __gsttemplates__ and __gstmetadata__<br>>> completely, NOTHING changes. It seems to me that BaseSink.__init__() doesn't<br>>> see it.<br>>><br>>> Does anyone have any idea what I'm doing wrong? Also I would greatly<br>>> appreciate any documentation, examples or tutorials on python binding for<br>>> gstreamer-1.0, because I wasn't able to find much<br>>><br>>> Thanks,<br>>> Jan Spurny<br>>><br>>> _______________________________________________<br>>> gstreamer-devel mailing list<br>>> gstreamer-devel@lists.freedesktop.org<br>>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel<br>> _______________________________________________<br>> gstreamer-devel mailing list<br>> gstreamer-devel@lists.freedesktop.org<br>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel<br>><br>><br>> _______________________________________________<br>> gstreamer-devel mailing list<br>> gstreamer-devel@lists.freedesktop.org<br>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel<br>><br>_______________________________________________<br>gstreamer-devel mailing list<br>gstreamer-devel@lists.freedesktop.org<br>http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</blockquote></body></html>