Commit b04b1b50 authored by Michael Smith's avatar Michael Smith

meta info: threadsafe registration using g_once

parent b10829d6
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment