summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2020-05-02 19:27:20 +0000
committerTim-Philipp Müller <tim@centricular.com>2020-07-10 16:47:12 +0100
commite5593a4c9c35a56749d68d5974b868968ac29e98 (patch)
treeef77c1bed0c6dd70dcd5fce9e0fd56c89e289a4d /sys
parent1c25fe131dc155d08ab88f50a9a74d28cecde450 (diff)
downloadgstreamer-plugins-good-e5593a4c9c35a56749d68d5974b868968ac29e98.tar.gz
rpicamsrc: sync autotools with glib-mkenum usage in meson build
Diffstat (limited to 'sys')
-rw-r--r--sys/rpicamsrc/gstrpicam-enums-template.c32
-rw-r--r--sys/rpicamsrc/gstrpicam-enums-template.h10
2 files changed, 20 insertions, 22 deletions
diff --git a/sys/rpicamsrc/gstrpicam-enums-template.c b/sys/rpicamsrc/gstrpicam-enums-template.c
index b9dee13e1..8631751a5 100644
--- a/sys/rpicamsrc/gstrpicam-enums-template.c
+++ b/sys/rpicamsrc/gstrpicam-enums-template.c
@@ -4,36 +4,36 @@
/*** END file-header ***/
/*** BEGIN file-production ***/
-/* enumerations from "@filename@" */
+/* enumerations from "@basename@" */
#include "@filename@"
+#define C_ENUM(v) ((gint) v)
+#define C_FLAGS(v) ((guint) v)
+
/*** END file-production ***/
/*** BEGIN value-header ***/
GType
@enum_name@_get_type (void)
{
- static GType the_type = 0;
-
- if (the_type == 0)
- {
- static const G@Type@Value values[] = {
+ static volatile gsize gtype_id = 0;
+
+ if (g_once_init_enter (&gtype_id)) {
+ static const G@Type@Value values[] = {
/*** END value-header ***/
/*** BEGIN value-production ***/
- { @VALUENAME@,
- "@VALUENAME@",
- "@valuenick@" },
+ { C_@TYPE@(@VALUENAME@), "@VALUENAME@", "@valuenick@" },
/*** END value-production ***/
/*** BEGIN value-tail ***/
- { 0, NULL, NULL }
- };
- the_type = g_@type@_register_static (
- g_intern_static_string ("@EnumName@"),
- values);
- }
- return the_type;
+ { 0, NULL, NULL }
+ };
+
+ GType new_type = g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
+ g_once_init_leave (&gtype_id, new_type);
+ }
+ return (GType) gtype_id;
}
/*** END value-tail ***/
diff --git a/sys/rpicamsrc/gstrpicam-enums-template.h b/sys/rpicamsrc/gstrpicam-enums-template.h
index 62b49ca64..eb25042ba 100644
--- a/sys/rpicamsrc/gstrpicam-enums-template.h
+++ b/sys/rpicamsrc/gstrpicam-enums-template.h
@@ -1,6 +1,5 @@
/*** BEGIN file-header ***/
-#ifndef __GSTRPICAM_ENUM_TYPES_H__
-#define __GSTRPICAM_ENUM_TYPES_H__
+#pragma once
#include <glib-object.h>
@@ -9,18 +8,17 @@ G_BEGIN_DECLS
/*** END file-header ***/
/*** BEGIN file-production ***/
-/* Enumerations from "@filename@" */
+/* Enumerations from "@basename@" */
/*** END file-production ***/
/*** BEGIN enumeration-production ***/
-#define GST_RPI_CAM_TYPE_@ENUMSHORT@ (@enum_name@_get_type())
-GType @enum_name@_get_type (void) G_GNUC_CONST;
+#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type())
+GType @enum_name@_get_type (void);
/*** END enumeration-production ***/
/*** BEGIN file-tail ***/
G_END_DECLS
-#endif /* __GSTRPICAM_ENUM_TYPES_H__ */
/*** END file-tail ***/