[gstreamer-bugs] [Bug 584389] New: don't recreate plugin feature and element factories on first use

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Sun May 31 12:34:26 PDT 2009


If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=584389

  GStreamer | gstreamer (core) | Ver: git
           Summary: don't recreate plugin feature and element factories on
                    first use
           Product: GStreamer
           Version: git
          Platform: Other
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: Normal
         Component: gstreamer (core)
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: ensonic at sonicpulse.de
         QAContact: gstreamer-bugs at lists.sourceforge.net
     GNOME version: Unspecified
   GNOME milestone: Unspecified


GST_DEBUG_NO_COLOR=1 GST_DEBUG="GST_REGISTRY:4" gst-launch 2>debug.log
audiotestsrc num-buffers=1 ! pulsesink

grep "replacing" debug.log
gstregistry.c:447:gst_registry_add_feature:<registry0> replacing existing
feature 0x80ebf50 (audiotestsrc)
gstregistry.c:447:gst_registry_add_feature:<registry0> replacing existing
feature 0x81a2890 (pulsesink)
...

basically, the first time we call gst_element_factory_make(), we recreate the
plugin feature and the element factory. As a side effect we ref the class to
fill in detail we already have filled from the registry cache. This is bad for
wrapper plugins like ladspa, as creating the first ladspa element would load
*all* ladspa *so (as it invokes the class init for each type).

The attached patch changes the behaviour to not thow the features away, but
update them. It won't ref the class anymore. This has the side-effect that it
can't fill klass->elementfactory = factory in gst_element_register() anymore
and thus relies on gst_element_factory_create() setting it (and this has a
FIXME: about thread safty).

I'd like to post this here for discussion and review.


-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=584389.




More information about the Gstreamer-bugs mailing list