Getting buffer metadata with a plugin written in python

Demeyer Jonathan Jonathan.Demeyer at macq.eu
Thu Nov 6 09:56:17 PST 2014


Hello,

For the sake of flexibility, we want to write a plugin in python (through pygi).

I can write a "hello world" plugin, but I don't succeed in getting metadata linked with buffers.

I can get the adress of the corresponding metadata, but all I get is a "void" object.

Here is a snippet of what I try :

---
    def do_transform_ip(self, buf):
        meta  = buf.get_meta("MyMetaAPI")
        if meta:
            print(meta)
		print(meta.flags)

        return Gst.FlowReturn.OK
---

MyMetaAPI comes from a C header file and it seems well defined as the print instruction shows the adress of the void pointer (and the adress is the same as in another plugin in the pipeline). However, meta.flags shows "<flags 0 of type GstMetaFlags>".

I don't know if I need to call Gst.Meta.register() or if it's my Gst.Buffer.get_meta() call who is wrong. I read http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/section-allocation-meta.html but the translation in python is not obvious.

Thanks,

 
Jonathan DEMEYER  


More information about the gstreamer-devel mailing list