#include "gstarch.h"
-#define COTHREAD_STACKSIZE 16384
-#define COTHREAD_MAXTHREADS 128
+#define COTHREAD_STACKSIZE 32768
+#define COTHREAD_MAXTHREADS 64
#define STACK_SIZE 0x200000
#ifdef COTHREAD_ATOMIC
// do something to lock the cothread
#else
- g_mutex_lock(thread->lock);
+ if (thread->lock)
+ g_mutex_lock(thread->lock);
#endif
}
#ifdef COTHREAD_ATOMIC
// do something to try to lock the cothread
#else
- return g_mutex_trylock(thread->lock);
+ if (thread->lock)
+ return g_mutex_trylock(thread->lock);
+ else
+ return FALSE;
#endif
}
#ifdef COTHREAD_ATOMIC
// do something to unlock the cothread
#else
- g_mutex_unlock(thread->lock);
+ if (thread->lock)
+ g_mutex_unlock(thread->lock);
#endif
}
static void gst_element_class_init (GstElementClass *klass);
static void gst_element_init (GstElement *element);
+static void gst_element_base_class_init (GstElementClass *klass);
static void gst_element_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_element_get_arg (GtkObject *object, GtkArg *arg, guint id);
(GtkObjectInitFunc)gst_element_init,
(GtkArgSetFunc)gst_element_set_arg,
(GtkArgGetFunc)gst_element_get_arg,
- (GtkClassInitFunc)NULL,
+ (GtkClassInitFunc)gst_element_base_class_init,
};
element_type = gtk_type_unique(GST_TYPE_OBJECT,&element_info);
}
klass->elementfactory = NULL;
}
+static void
+gst_element_base_class_init (GstElementClass *klass)
+{
+ GtkObjectClass *gtkobject_class;
+
+ gtkobject_class = (GtkObjectClass*) klass;
+
+ gtkobject_class->set_arg = GST_DEBUG_FUNCPTR(gst_element_set_arg);
+ gtkobject_class->get_arg = GST_DEBUG_FUNCPTR(gst_element_get_arg);
+}
+
static void
gst_element_init (GstElement *element)
{
static void
gst_schedule_lock_element (GstSchedule *sched,GstElement *element)
{
- cothread_lock(element->threadstate);
+ if (element->threadstate)
+ cothread_lock(element->threadstate);
}
static void
gst_schedule_unlock_element (GstSchedule *sched,GstElement *element)
{
- cothread_unlock(element->threadstate);
+ if (element->threadstate)
+ cothread_unlock(element->threadstate);
}