[gstreamer-bugs] [Bug 500258] New: Buffer is not writable in do_transform_ip in gst.BaseTransform with passthrough=False and in_place=True

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Wed Nov 28 09:35:02 PST 2007


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

  GStreamer | gst-python | Ver: 0.10.9
           Summary: Buffer is not writable in do_transform_ip in
                    gst.BaseTransform with passthrough=False and
                    in_place=True
           Product: GStreamer
           Version: 0.10.9
          Platform: Other
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-python
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: csierra at alea-soluciones.com
         QAContact: gstreamer-bugs at lists.sourceforge.net
     GNOME version: Unspecified
   GNOME milestone: Unspecified


When subclassing gst.BaseTransform with passthrough disabled and in_place
enabled the buffer passed to do_transform_ip is not writtable. A code snippet
is attached to show the bug:

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

import gst, gobject, traceback

class MyTransform(gst.BaseTransform):    
    __gsttemplates__ = (

        gst.PadTemplate("src",
                    gst.PAD_SRC,
                    gst.PAD_ALWAYS,
                    gst.caps_new_any()),

        gst.PadTemplate("sink",
                    gst.PAD_SINK,
                    gst.PAD_ALWAYS,
                    gst.caps_new_any())
    )

    def __init__(self, name):
            self.__gobject_init__()
            self.set_name(name)
            self.set_passthrough(False)
            self.set_in_place(True)


    def do_transform_ip(self, buffer):
            buffer[0]=1 #This should work
            return gst.FLOW_OK

    def set_property(self, key, value):
            if key == "name":
                self.set_name(name)
            else:
                print "Property %s does not exist" % key

    def get_property(self, key):
            if key == "name":
                return self.get_name()
            else:
                print "Property %s does not exist" % key

gobject.type_register(MyTransform)
gobject.threads_init()

src = gst.element_factory_make("fakesrc", "src")
sink = gst.element_factory_make("fakesink", "sink")
trans = MyTransform("trans")

pipe = gst.Pipeline("MyPipeline")
pipe.add(src,trans, sink)
gst.element_link_many(src, trans, sink)

def bus_event(bus, message):

    t = message.type
    print message
    if t == gst.MESSAGE_EOS:

        loop.quit()

    return True

pipe.get_bus().add_watch(bus_event)

pipe.set_state(gst.STATE_PLAYING)

loop = gobject.MainLoop()

try:
    loop.run()
except:
    traceback.print_exc()

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

The non-working line is marked with #This should work


-- 
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=500258.




More information about the Gstreamer-bugs mailing list