How to shuttle GstMeta information between Python and C?

Arjen Veenhuizen arjen.veenhuizen at tno.nl
Mon Apr 11 14:34:04 UTC 2016


It turns out this is actually quite an old bug which was mentioned in  this
<https://lists.freedesktop.org/archives/gstreamer-devel/2014-November/050337.html>  
message on the Gstreamer list in November 2014. In short, we cannot assign
values to a GstMeta object in python and recover them in C. The reverse,
however, is possible using some tweaks.

I came up with the following work-around.

First of all, use the latest gobject introspection bindings when compiling
GStreamer from source. For this, you need to install:


Also, add --enable-introspection when running autogen.sh when compiling the
gstreamer packages

and make sure you install the .typelib files in the proper folder. 

You can use 

to check the location of the typelib files in use by pygi.

Based on bug  #702921 <https://bugzilla.gnome.org/show_bug.cgi?id=702921>  
I was able to add a couple of publicly accessible methods
(gst_buffer_get_video_meta and gst_buffer_set_video_meta) to gstvideometa.c
and gstvideometa.h (gst-plugins-base) which allow me to explicitly set and
get the contents of a GstVideoCropMeta metadata instance in the C
environment.

In python you can then use:


Note, as Stian Stelnes already mentioned in the bugreport above, the
publicly accessible methods must be functions, not macros!




--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/How-to-shuttle-GstMeta-information-between-Python-and-C-tp4676813p4676830.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list