creating custom sink in python fails

Thibault Saunier tsaunier at gnome.org
Wed Oct 28 07:34:08 PDT 2015


Hello,

I just pushed[0] a version of that example ported to GstBaseSink[1]
and it works just fine.

Regards,

Thibault Saunier

[0] http://cgit.freedesktop.org/gstreamer/gst-python/commit/?id=7dffdb68642ad527c184022935f4424d5e002654
[1] http://cgit.freedesktop.org/gstreamer/gst-python/tree/examples/plugins/python/sinkelement.py

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


More information about the gstreamer-devel mailing list