gst_buffer_add_meta question

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

gst_buffer_add_meta question

GStreamer-devel mailing list
Hi,
  I have a question about attaching metadata to buffers in one .so file and
reading it in another one.
  As far as I understand when I want to attach a meta data to a buffer (in
MyFirst.so file), I'll use the
     gst_buffer_add_meta(buffer, gst_meta_MY_IMPL_get_info(), ) function,
which looks like this:

     const GstMetaInfo *gst_meta_MY_IMPL_get_info()
     {
        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 MyFirst.so prevents me
to read its value
using gst_buffer_get_meta in MySecond.so? Currently I get garbage values
when I read it in MySecond.so code.


thanks
Eyal



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gst_buffer_add_meta question

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

Hi,

>      {
>         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 MyFirst.so prevents
> me to read its value using gst_buffer_get_meta in MySecond.so?

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 MySecond.so 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
variable.

Cheers
 Tim

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gst_buffer_add_meta question

GStreamer-devel mailing list
In reply to this post by GStreamer-devel mailing list
Le mardi 27 avril 2021 à 10:46 -0500, eyalhir74 via gstreamer-devel a écrit :

> Hi,
>   I have a question about attaching metadata to buffers in one .so file and
> reading it in another one.
>   As far as I understand when I want to attach a meta data to a buffer (in
> MyFirst.so file), I'll use the
>      gst_buffer_add_meta(buffer, gst_meta_MY_IMPL_get_info(), ) function,
> which looks like this:
>
>      const GstMetaInfo *gst_meta_MY_IMPL_get_info()
>      {
>         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 MyFirst.so prevents me
> to read its value
> using gst_buffer_get_meta in MySecond.so? Currently I get garbage values
> when I read it in MySecond.so code.

You will need a to share a library between all plugins using the meta in order
to use this. In 1.120, there will be a CustomMeta that can be used for single
producer and that in that case won't require a shared library.

>
>
> thanks
> Eyal
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel