mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-03 04:52:28 +00:00
meta registration: use g_once functions to register these threadsafely.
This commit is contained in:
parent
17e3dc3357
commit
a29c4f9489
5 changed files with 18 additions and 12 deletions
|
@ -171,12 +171,13 @@ gst_audio_downmix_meta_get_info (void)
|
|||
{
|
||||
static const GstMetaInfo *audio_downmix_meta_info = NULL;
|
||||
|
||||
if (audio_downmix_meta_info == NULL) {
|
||||
audio_downmix_meta_info =
|
||||
if (g_once_init_enter (&audio_downmix_meta_info)) {
|
||||
const GstMetaInfo *meta =
|
||||
gst_meta_register (GST_AUDIO_DOWNMIX_META_API_TYPE,
|
||||
"GstAudioDownmixMeta", sizeof (GstAudioDownmixMeta),
|
||||
gst_audio_downmix_meta_init, gst_audio_downmix_meta_free,
|
||||
gst_audio_downmix_meta_transform);
|
||||
g_once_init_leave (&audio_downmix_meta_info, meta);
|
||||
}
|
||||
return audio_downmix_meta_info;
|
||||
}
|
||||
|
|
|
@ -76,11 +76,12 @@ gst_video_meta_get_info (void)
|
|||
{
|
||||
static const GstMetaInfo *video_meta_info = NULL;
|
||||
|
||||
if (video_meta_info == NULL) {
|
||||
video_meta_info =
|
||||
if (g_once_init_enter (&video_meta_info)) {
|
||||
const GstMetaInfo *meta =
|
||||
gst_meta_register (GST_VIDEO_META_API_TYPE, "GstVideoMeta",
|
||||
sizeof (GstVideoMeta), (GstMetaInitFunction) NULL,
|
||||
(GstMetaFreeFunction) NULL, gst_video_meta_transform);
|
||||
g_once_init_leave (&video_meta_info, meta);
|
||||
}
|
||||
return video_meta_info;
|
||||
}
|
||||
|
@ -349,11 +350,12 @@ gst_video_crop_meta_get_info (void)
|
|||
{
|
||||
static const GstMetaInfo *video_crop_meta_info = NULL;
|
||||
|
||||
if (video_crop_meta_info == NULL) {
|
||||
video_crop_meta_info =
|
||||
if (g_once_init_enter (&video_crop_meta_info)) {
|
||||
const GstMetaInfo *meta =
|
||||
gst_meta_register (GST_VIDEO_CROP_META_API_TYPE, "GstVideoCropMeta",
|
||||
sizeof (GstVideoCropMeta), (GstMetaInitFunction) NULL,
|
||||
(GstMetaFreeFunction) NULL, gst_video_crop_meta_transform);
|
||||
g_once_init_leave (&video_crop_meta_info, meta);
|
||||
}
|
||||
return video_crop_meta_info;
|
||||
}
|
||||
|
|
|
@ -241,14 +241,15 @@ gst_video_overlay_composition_meta_get_info (void)
|
|||
{
|
||||
static const GstMetaInfo *video_overlay_composition_meta_info = NULL;
|
||||
|
||||
if (video_overlay_composition_meta_info == NULL) {
|
||||
video_overlay_composition_meta_info =
|
||||
if (g_once_init_enter (&video_overlay_composition_meta_info)) {
|
||||
const GstMetaInfo *meta =
|
||||
gst_meta_register (GST_VIDEO_OVERLAY_COMPOSITION_META_API_TYPE,
|
||||
"GstVideoOverlayCompositionMeta",
|
||||
sizeof (GstVideoOverlayCompositionMeta), (GstMetaInitFunction) NULL,
|
||||
(GstMetaFreeFunction) gst_video_overlay_composition_meta_free,
|
||||
(GstMetaTransformFunction)
|
||||
gst_video_overlay_composition_meta_transform);
|
||||
g_once_init_leave (&video_overlay_composition_meta_info, meta);
|
||||
}
|
||||
return video_overlay_composition_meta_info;
|
||||
}
|
||||
|
|
|
@ -68,12 +68,13 @@ gst_ximage_meta_get_info (void)
|
|||
{
|
||||
static const GstMetaInfo *ximage_meta_info = NULL;
|
||||
|
||||
if (ximage_meta_info == NULL) {
|
||||
ximage_meta_info =
|
||||
if (g_once_init_enter (&ximage_meta_info)) {
|
||||
const GstMetaInfo *meta =
|
||||
gst_meta_register (GST_XIMAGE_META_API_TYPE, "GstXImageMeta",
|
||||
sizeof (GstXImageMeta), (GstMetaInitFunction) NULL,
|
||||
(GstMetaFreeFunction) gst_ximage_meta_free,
|
||||
(GstMetaTransformFunction) NULL);
|
||||
g_once_init_leave (&ximage_meta_info, meta);
|
||||
}
|
||||
return ximage_meta_info;
|
||||
}
|
||||
|
|
|
@ -71,12 +71,13 @@ gst_xvimage_meta_get_info (void)
|
|||
{
|
||||
static const GstMetaInfo *xvimage_meta_info = NULL;
|
||||
|
||||
if (xvimage_meta_info == NULL) {
|
||||
xvimage_meta_info =
|
||||
if (g_once_init_enter (&xvimage_meta_info)) {
|
||||
const GstMetaInfo *meta =
|
||||
gst_meta_register (GST_XVIMAGE_META_API_TYPE, "GstXvImageMeta",
|
||||
sizeof (GstXvImageMeta), (GstMetaInitFunction) NULL,
|
||||
(GstMetaFreeFunction) gst_xvimage_meta_free,
|
||||
(GstMetaTransformFunction) NULL);
|
||||
g_once_init_leave (&xvimage_meta_info, meta);
|
||||
}
|
||||
return xvimage_meta_info;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue