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 |
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 |
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 |
Free forum by Nabble | Edit this page |