[gstreamer-bugs] [Bug 346666] New: A test filter element in gst-python

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Wed Jul 5 09:14:32 PDT 2006


Do not reply to this via email (we are currently unable to handle email
responses and they get discarded).  You can add comments to this bug at
http://bugzilla.gnome.org/show_bug.cgi?id=346666
 GStreamer | gst-python | Ver: 0.10.4

           Summary: A test filter element in gst-python
           Product: GStreamer
           Version: 0.10.4
          Platform: Other
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: Normal
         Component: gst-python
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: spam at coreyo.net
         QAContact: johan at gnome.org
     GNOME version: Unspecified
   GNOME milestone: Unspecified


I'm attempting to create a regular filter type element with gst-python.  Here
is my fist attempt at writing a plain passthru filter.

I was not quite sure how the GstElementDetails part translated into the python
binding.

Am I on the right track?
___________________________________________________________________________

import pygst
#pygst.require('0.10')
import gst
import gobject

class TestFilter(gst.Element):

  _srcpadtemplate = gst.PadTemplate ("srcpadtemplate",
                                     gst.PAD_SRC,
                                     gst.PAD_ALWAYS,
                                     gst.caps_new_any())

  _sinkpadtemplate = gst.PadTemplate ("sinkpadtemplate",
                                      gst.PAD_SINK,
                                      gst.PAD_ALWAYS,
                                      gst.caps_new_any())

  def __init__(self):
    gst.Element.__init__(self)
    self.srcpad = gst.Pad(self._srcpadtemplate, "src")
    self.inkpad = gst.Pad(self._sinkpadtemplate, "sink")
    self.add_pad(self.srcpad)
    self.add_pad(self.sinkpad)

    self.sinkpad.set_chain_function(self.chainfunc)
    self.sinkpad.set_event_function(self.eventfunc)

    def chainfunc(self, pad, buffer):
      return self.sinkpad.push(buffer)

    def eventfunc(self, pad, event):
      return self.sinkpad.push(buffer)

gobject.type_register(TestFilter)

------------------------------------------------------------------------------


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




More information about the Gstreamer-bugs mailing list