[gstreamer-bugs] [Bug 637746] New: gst-python memory leak with python element

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue Dec 21 06:27:05 PST 2010


https://bugzilla.gnome.org/show_bug.cgi?id=637746
  GStreamer | gst-python | 0.10.20

           Summary: gst-python memory leak with python element
    Classification: Desktop
           Product: GStreamer
           Version: 0.10.20
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-python
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: mad_aluche at hotmail.com
         QAContact: gstreamer-bugs at lists.sourceforge.net
      GNOME target: ---
     GNOME version: ---


Running this code i get a memory leak:

#!/usr/bin/python
import pygst
pygst.require("0.10")
import gst
import gobject

class Leaker(gst.Element):

    #source pad (template): we send buffers forward through here
    _srctemplate = gst.PadTemplate ('src',
        gst.PAD_SRC,
        gst.PAD_ALWAYS,
        gst.caps_new_any())

    #sink pad (template): we recieve buffers from our sink pad
    _sinktemplate = gst.PadTemplate ('sink',
        gst.PAD_SINK,
        gst.PAD_ALWAYS,
        gst.caps_new_any())

    #register our pad templates
    __gsttemplates__ = (_srctemplate, _sinktemplate)

    def __init__(self):
        gst.Element.__init__(self)

        #source pad, outgoing data
        self.srcpad = gst.Pad(self._srctemplate)

        #sink pad, incoming data
        self.sinkpad = gst.Pad(self._sinktemplate)
        self.sinkpad.set_setcaps_function(self._sink_setcaps)
        self.sinkpad.set_chain_function(self._sink_chain)

        #make pads available
        self.add_pad(self.srcpad)
        self.add_pad(self.sinkpad)

    def _sink_setcaps(self, _pad, _caps):
        # We negotiate our capabilities here, this function is called
        # as we accept anything, we just say yes we can handle the
        # incoming data.
        return True

    def _sink_chain(self, _pad, buffer):
        return self.srcpad.push(buffer.copy())

gobject.type_register(Leaker)

pipeline = gst.Pipeline()
fakesrc = gst.element_factory_make('fakesrc')
filter = Leaker()
fakesink = gst.element_factory_make('fakesink')

pipeline.add(fakesrc)
pipeline.add(filter)
pipeline.add(fakesink)

fakesrc.link(filter)
filter.link(fakesink)

pipeline.set_state(gst.STATE_PLAYING)
loop = gobject.MainLoop()
loop.run()

-- 
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