Small cleanups
authorWim Taymans <wim.taymans@gmail.com>
Sun, 23 Jun 2002 12:42:52 +0000 (12:42 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Sun, 23 Jun 2002 12:42:52 +0000 (12:42 +0000)
Original commit message from CVS:
Small cleanups

gst/gst.c
gst/gst.h
gst/gstprops.h

index 37dd43d..0cc0c8c 100644 (file)
--- a/gst/gst.c
+++ b/gst/gst.c
@@ -41,7 +41,7 @@ gboolean _gst_registry_auto_load = TRUE;
 static GstRegistry *_global_registry;
 static GstRegistry *_user_registry;
 static gboolean _gst_registry_fixed = FALSE;
-static gboolean _nothreads = FALSE;
+static gboolean _gst_use_threads = TRUE;
 
 extern gint _gst_trace_on;
 
@@ -339,17 +339,17 @@ init_post (void)
 #endif
 
   if (!g_thread_supported ()) {
-    if (_nothreads)
-      g_thread_init (&gst_thread_dummy_functions);
-    else
+    if (_gst_use_threads)
       g_thread_init (NULL);
+    else
+      g_thread_init (&gst_thread_dummy_functions);
   }
   
   llf = G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL;
   g_log_set_handler(g_log_domain_gstreamer, llf, debug_log_handler, NULL);
   
   GST_INFO (GST_CAT_GST_INIT, "Initializing GStreamer Core Library version %s %s",
-            GST_VERSION, _nothreads?"(no threads)":"");
+            GST_VERSION, _gst_use_threads?"":"(no threads)");
   
   gst_object_get_type ();
   gst_pad_get_type ();
@@ -493,7 +493,7 @@ init_popt_callback (poptContext context, enum poptCallbackReason reason,
       gst_scheduler_factory_set_default_name (arg);
       break;
     case ARG_NOTHREADS:
-      _nothreads = TRUE;
+      gst_use_threads (FALSE);
       break;
     case ARG_REGISTRY:
       g_object_set (G_OBJECT (_user_registry), "location", arg, NULL);
@@ -510,10 +510,16 @@ init_popt_callback (poptContext context, enum poptCallbackReason reason,
   }
 }
 
+void
+gst_use_threads (gboolean use_threads)
+{
+  _gst_use_threads = use_threads;
+}
+
 gboolean
-gst_with_threads (void)
+gst_has_threads (void)
 {
-  return !_nothreads;
+  return _gst_use_threads;
 }
 
 
index 250a533..7d514b8 100644 (file)
--- a/gst/gst.h
+++ b/gst/gst.h
@@ -67,7 +67,8 @@ void                          gst_init_with_popt_table        (int *argc, char **argv[],
                                                                 const struct poptOption *popt_options);
 const struct poptOption*       gst_init_get_popt_table         (void);
 
-gboolean                       gst_with_threads                (void);
+void                           gst_use_threads                 (gboolean use_threads);
+gboolean                       gst_has_threads                 (void);
 
 void                           gst_main                        (void);
 void                           gst_main_quit                   (void);
index 41c91ed..0387688 100644 (file)
@@ -57,8 +57,8 @@ typedef enum {
    GST_PROPS_LAST_TYPE = GST_PROPS_END_TYPE + 16,
 } GstPropsType;
 
-#define GST_MAKE_FOURCC(a,b,c,d)       ((a)|(b)<<8|(c)<<16|(d)<<24)
-#define GST_STR_FOURCC(f)              (((f)[0])|((f)[1]<<8)|((f)[2]<<16)|((f)[3]<<24))
+#define GST_MAKE_FOURCC(a,b,c,d)       (guint32)((a)|(b)<<8|(c)<<16|(d)<<24)
+#define GST_STR_FOURCC(f)              (guint32)(((f)[0])|((f)[1]<<8)|((f)[2]<<16)|((f)[3]<<24))
 
 #define GST_PROPS_LIST(a...)           GST_PROPS_LIST_TYPE,##a,NULL
 #define GST_PROPS_INT(a)               GST_PROPS_INT_TYPE,(a)