gst_buffer_add_meta question

Tim Müller tim at
Tue Apr 27 17:44:47 UTC 2021

On Tue, 2021-04-27 at 10:46 -0500, eyalhir74 via gstreamer-devel wrote:


>      {
>         static const GstMetaInfo *m = NULL;
>         if (g_once_init_enter((GstMetaInfo **)m)
>         {
>              gst_meta_register(.......);
>              g_once_init_leave(....);
>         }
> Does the fact that the "m" variable is static in prevents
> me to read its value using gst_buffer_get_meta in

No, since it's only only ever retrieved via the function anyway. You
can't access that variable directly, but you don't need to either.

> Currently I get garbag value when I read it in code.

I think you want &m here (both in enter and leave)? And save the return
value of _register() so you can pass it to _leave() to set on the


More information about the gstreamer-devel mailing list