implement _destroy, and fix some bugs changing songs in the player doesn't work now...
authorAndy Wingo <wingo@pobox.com>
Sun, 23 Jun 2002 04:31:45 +0000 (04:31 +0000)
committerAndy Wingo <wingo@pobox.com>
Sun, 23 Jun 2002 04:31:45 +0000 (04:31 +0000)
Original commit message from CVS:
implement _destroy, and fix some bugs

changing songs in the player doesn't work now, i don't know why yet

gst/schedulers/cothreads_compat.h
gst/schedulers/gstbasicscheduler.c

index 0322749..e02d1c4 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
  *                    2000 Wim Taymans <wtay@chello.be>
  *
- * gstscheduler.c: Default scheduling code for most cases
+ * cothreads_compat.h: Compatibility macros between cothreads packages
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -44,15 +44,15 @@ typedef cothread_state cothread;
 
 #define do_cothread_switch(to)                 cothread_switch(to)
 
-#define do_cothread_create(new_thread, context, func, argc, argv)      \
-  G_STMT_START{        \
-    new_thread = cothread_create (context);    \
-    if (new_thread) {  \
-      cothread_setfunc (new_thread, (func), (argc), (argv));   \
-    }\
+#define do_cothread_create(new_thread, context, func, argc, argv)               \
+  G_STMT_START{                                                                 \
+    new_thread = cothread_create (context);                                     \
+    if (new_thread) {                                                           \
+      cothread_setfunc (new_thread, (func), (argc), (argv));                    \
+    }                                                                           \
   }G_STMT_END
 
-#define do_cothread_setfunc(cothread, context, func, argc, argv) \
+#define do_cothread_setfunc(cothread, context, func, argc, argv)                \
   cothread_setfunc ((cothread), (func), (argc), (argv))
   
 #define do_cothread_destroy(cothread)          cothread_free(cothread)
@@ -88,34 +88,35 @@ typedef cothread cothread_context;
 /* define functions
  * the macros are prepended with "do_" 
  */
-#define do_cothreads_init(x) G_STMT_START{     \
-    if (!cothreads_initialized())      \
-      cothreads_init(0x0200000, 16);   \
+#define do_cothreads_init(x) G_STMT_START{                                      \
+    if (!cothreads_initialized())                                               \
+      cothreads_init(0x0200000, 16);                                            \
   }G_STMT_END
 
-#define do_cothreads_stackquery(stack,size)    \
+#define do_cothreads_stackquery(stack,size)                                     \
   cothreads_alloc_thread_stack (stack, size)
 
-#define do_cothread_switch(to) G_STMT_START{   \
-  cothread *from = cothread_self ();   \
-  if (from == (to)) {  \
-    GST_DEBUG (GST_CAT_COTHREAD_SWITCH, "trying to switch to the same cothread (%p), not allowed",     \
-              (to));   \
-    g_warning ("trying to switch to the same cothread, not allowed");  \
-  } else {     \
-    GST_INFO (GST_CAT_COTHREAD_SWITCH, "switching from cothread %p to cothread %p",    \
-             from, (to));      \
-    cothread_switch (from, (to));      \
-    GST_INFO (GST_CAT_COTHREAD_SWITCH, "we're in cothread %p now", from);      \
-  }    \
+#define do_cothread_switch(to) G_STMT_START{                                   \
+  cothread *from = cothread_self ();                                            \
+  if (from == (to)) {                                                           \
+    GST_DEBUG (GST_CAT_COTHREAD_SWITCH,                                         \
+               "trying to switch to the same cothread (%p), not allowed",       \
+               (to));                                                           \
+    g_warning ("trying to switch to the same cothread, not allowed");           \
+  } else {                                                                      \
+    GST_INFO (GST_CAT_COTHREAD_SWITCH,                                          \
+              "switching from cothread %p to cothread %p", from, (to));         \
+    cothread_switch (from, (to));                                               \
+    GST_INFO (GST_CAT_COTHREAD_SWITCH, "we're in cothread %p now", from);       \
+  }                                                                             \
 }G_STMT_END
 
-#define do_cothread_create(new_thread, context, func, argc, argv)      \
-  G_STMT_START{        \
-    new_thread = cothread_create ((func), 0, (void**) (argv), (context));      \
+#define do_cothread_create(new_thread, context, func, argc, argv)               \
+  G_STMT_START{                                                                 \
+    new_thread = cothread_create ((func), 0, (void**) (argv), (context));       \
   }G_STMT_END
   
-#define do_cothread_setfunc(cothread, context, func, argc, argv) \
+#define do_cothread_setfunc(cothread, context, func, argc, argv)                \
   cothread_setfunc ((cothread), (func), (argc), (void **) (argv), (context))
 
 #define do_cothread_destroy(cothread)          cothread_destroy(cothread)
index d38872a..02c713d 100644 (file)
@@ -245,7 +245,7 @@ plugin_init (GModule *module, GstPlugin *plugin)
   gst_plugin_set_longname (plugin, "A basic scheduler");
 
   factory = gst_scheduler_factory_new (COTHREADS_NAME,
-                                     "A basic scheduler, it uses "COTHREADS_NAME" cothreads",
+                                     "A basic scheduler using "COTHREADS_NAME" cothreads",
                                      gst_basic_scheduler_get_type());
 
   if (factory != NULL) {