app: export gst_app_stream_type_get_type()
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Tue, 18 Jan 2011 00:09:37 +0000 (00:09 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Tue, 18 Jan 2011 00:10:29 +0000 (00:10 +0000)
API: gst_app_stream_type_get_type()
API: GST_TYPE_APP_STREAM_TYPE

https://bugzilla.gnome.org/show_bug.cgi?id=639747

gst-libs/gst/app/gstappsrc.c
gst-libs/gst/app/gstappsrc.h
win32/common/libgstapp.def

index b5baefa..f051711 100644 (file)
@@ -198,23 +198,24 @@ GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_ALWAYS,
     GST_STATIC_CAPS_ANY);
 
-
-#define GST_TYPE_APP_STREAM_TYPE (stream_type_get_type ())
-static GType
-stream_type_get_type (void)
+GType
+gst_app_stream_type_get_type (void)
 {
-  static GType stream_type_type = 0;
+  static volatile gsize stream_type_type = 0;
   static const GEnumValue stream_type[] = {
-    {GST_APP_STREAM_TYPE_STREAM, "Stream", "stream"},
-    {GST_APP_STREAM_TYPE_SEEKABLE, "Seekable", "seekable"},
-    {GST_APP_STREAM_TYPE_RANDOM_ACCESS, "Random Access", "random-access"},
-    {0, NULL, NULL},
+    {GST_APP_STREAM_TYPE_STREAM, "GST_APP_STREAM_TYPE_STREAM", "stream"},
+    {GST_APP_STREAM_TYPE_SEEKABLE, "GST_APP_STREAM_TYPE_SEEKABLE", "seekable"},
+    {GST_APP_STREAM_TYPE_RANDOM_ACCESS, "GST_APP_STREAM_TYPE_RANDOM_ACCESS",
+        "random-access"},
+    {0, NULL, NULL}
   };
 
-  if (!stream_type_type) {
-    stream_type_type = g_enum_register_static ("GstAppStreamType", stream_type);
+  if (g_once_init_enter (&stream_type_type)) {
+    GType tmp = g_enum_register_static ("GstAppStreamType", stream_type);
+    g_once_init_leave (&stream_type_type, tmp);
   }
-  return stream_type_type;
+
+  return (GType) stream_type_type;
 }
 
 static void gst_app_src_uri_handler_init (gpointer g_iface,
index a1e09f7..041cb68 100644 (file)
@@ -117,6 +117,10 @@ struct _GstAppSrcClass
 
 GType gst_app_src_get_type(void);
 
+/* GType getter for GstAppStreamType, since 0.10.32 */
+#define GST_TYPE_APP_STREAM_TYPE (gst_app_stream_type_get_type ())
+GType gst_app_stream_type_get_type (void);
+
 void             gst_app_src_set_caps         (GstAppSrc *appsrc, const GstCaps *caps);
 GstCaps*         gst_app_src_get_caps         (GstAppSrc *appsrc);
 
index 9b1aa24..892d680 100644 (file)
@@ -31,3 +31,4 @@ EXPORTS
        gst_app_src_set_max_bytes
        gst_app_src_set_size
        gst_app_src_set_stream_type
+       gst_app_stream_type_get_type