mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-03 21:12:26 +00:00
meta info: threadsafe registration using g_once
This commit is contained in:
parent
b10829d6c8
commit
b04b1b5089
3 changed files with 8 additions and 4 deletions
|
@ -759,6 +759,8 @@ gst_deinterleave_process (GstDeinterleave * self, GstBuffer * buf)
|
|||
if (!pads_pushed)
|
||||
ret = GST_FLOW_NOT_LINKED;
|
||||
|
||||
GST_DEBUG_OBJECT (self, "Pushed on %d pads", pads_pushed);
|
||||
|
||||
done:
|
||||
gst_buffer_unmap (buf, &read_info);
|
||||
gst_buffer_unref (buf);
|
||||
|
|
|
@ -75,11 +75,12 @@ gst_v4l2_meta_get_info (void)
|
|||
{
|
||||
static const GstMetaInfo *meta_info = NULL;
|
||||
|
||||
if (meta_info == NULL) {
|
||||
meta_info =
|
||||
if (g_once_init_enter (&meta_info)) {
|
||||
const GstMetaInfo *meta =
|
||||
gst_meta_register (gst_v4l2_meta_api_get_type (), "GstV4l2Meta",
|
||||
sizeof (GstV4l2Meta), (GstMetaInitFunction) NULL,
|
||||
(GstMetaFreeFunction) NULL, (GstMetaTransformFunction) NULL);
|
||||
g_once_init_leave (&meta_info, meta);
|
||||
}
|
||||
return meta_info;
|
||||
}
|
||||
|
|
|
@ -41,11 +41,12 @@ gst_meta_ximage_get_info (void)
|
|||
{
|
||||
static const GstMetaInfo *meta_ximage_info = NULL;
|
||||
|
||||
if (meta_ximage_info == NULL) {
|
||||
meta_ximage_info =
|
||||
if (g_once_init_enter (&meta_ximage_info)) {
|
||||
const GstMetaInfo *meta =
|
||||
gst_meta_register (gst_meta_ximage_api_get_type (), "GstMetaXImageSrc",
|
||||
sizeof (GstMetaXImage), (GstMetaInitFunction) NULL,
|
||||
(GstMetaFreeFunction) NULL, (GstMetaTransformFunction) NULL);
|
||||
g_once_init_leave (&meta_ximage_info, meta);
|
||||
}
|
||||
return meta_ximage_info;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue