How to shuttle GstMeta information between Python and C?

Arjen Veenhuizen arjen.veenhuizen at tno.nl
Sun Apr 10 22:00:04 UTC 2016


I have been having great difficulty grasping the concept of GstMeta and using
it from Python. A minimal-not-working-example can be found  here
<http://pastebin.com/EmLHPmzG>  .

I created a basic pipeline ([videotestsrc] - [capsfilter] - [xvimagesink[)
with a buffer probe on the capsfilter src pad. My goal is to add
GstVideoCropMeta to each passing buffer (in python). Xvimagesink already
implements a get_meta for this metadata type so that should be easy to
debug.

Unfortunately, I am unable to figure out how to actually store x, y, width
and height in the GstVideoCropMeta instance and making xvimagesink to
pick-up these values. 

In C, things look fairly  straightforward
<https://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/gst-libs/gst/video/gstvideometa.c#n372> 
:


Implying that, after doing the gst_buffer_add_video_crop_meta, I should
store the x, y, width and height directly on its return value (a Gst.Meta).
But that's doesn't really make sense right?

Setting GST_DEBUG=xvimagesink*:8, I can see that xvimagesink is picking up
the metadata, but x, y, width and height are still 0 (or worse, are
sometimes random numbers from uninitialized memory locations making things
crash and burn).

I have been reading the  docs
<https://cgit.freedesktop.org/gstreamer/gstreamer/tree/docs/design/part-meta.txt>  
a dozen times but I am still a bit lost.





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


More information about the gstreamer-devel mailing list