[Bug 655346] Gst.ElementFactory().create("element_name") passes NULL to Gstreamer

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Mon Oct 10 12:00:20 PDT 2011


https://bugzilla.gnome.org/show_bug.cgi?id=655346
  GStreamer | gstreamer (core) | unspecified

Tim-Philipp Müller <t.i.m> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO
                 CC|                            |t.i.m at zen.co.uk

--- Comment #1 from Tim-Philipp Müller <t.i.m at zen.co.uk> 2011-10-10 19:00:17 UTC ---
> 1. Python script
> from gi.repository import Gst
> Gst.init(None)
> element = Gst.ElementFactory().create("level")
>
> (<unknown>:8626): GStreamer-CRITICAL **: gst_registry_find_plugin: assertion
> `name != NULL' failed

I can reproduce this.

However, it's really wrong usage, and it sems to me that the bug is with pygi.
It should detect that this is wrong usage.

The C prototype is like this:

  GstElement *   gst_element_factory_create (GstElementFactory * factory,
                                                                               
  const gchar               * name);

This means that you should use it like this:

>>> from gi.repository import Gst
>>> Gst.init(None)
[]
>>> factory=Gst.ElementFactory().find("level")
>>> print factory
<ElementFactory object at 0x201ce10 (GstElementFactory at 0x2201480)>
>>> element=factory.create("mylevel")
>>> print element
<__main__.GstLevel object at 0x201ce60 (GstLevel at 0x225c170)>
>>> print element.get_name()
mylevel

which seems to work fine for me.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list