Docs updates
authorWim Taymans <wim.taymans@gmail.com>
Sun, 27 May 2001 14:37:29 +0000 (14:37 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Sun, 27 May 2001 14:37:29 +0000 (14:37 +0000)
Original commit message from CVS:
Docs updates
Changed the cothread to use sigjmp_buf
removed some unused methods.
Some code cleanups.

gst/cothreads.c
gst/cothreads.h
gst/gstbin.c
gst/gstbin.h
gst/gstinfo.c
gst/gstobject.c
gst/gstpad.c
gst/gstplugin.c
gst/gstscheduler.h

index 855df5f..304749e 100644 (file)
@@ -159,7 +159,8 @@ cothread_create (cothread_context *ctx)
   s->lock = g_mutex_new();
 #endif
 
-  GST_INFO (GST_CAT_COTHREADS,"created cothread #%d: %p at sp:%p", ctx->nthreads, s, s->sp);
+  GST_INFO (GST_CAT_COTHREADS,"created cothread #%d: %p at sp:%p lock:%p", ctx->nthreads, 
+                 s, s->sp, s->lock);
 
   ctx->threads[ctx->nthreads++] = s;
 
@@ -201,7 +202,7 @@ cothread_main(cothread_context *ctx)
 }
 
 /**
- * cothread_current)main:
+ * cothread_current_main:
  *
  * Returns: the #cothread_state of the main (0th) thread in the current pthread
  */
@@ -335,7 +336,7 @@ cothread_switch (cothread_state *thread)
 #ifdef GST_ARCH_PRESETJMP
   GST_ARCH_PRESETJMP();
 #endif
-  enter = setjmp(current->jmp);
+  enter = sigsetjmp(current->jmp, 1);
   if (enter != 0) {
     GST_DEBUG (0,"enter thread #%d %d %p<->%p (%d)\n",current->threadnum, enter, 
                    current->sp, current->top_sp, current->top_sp-current->sp);
@@ -350,7 +351,7 @@ cothread_switch (cothread_state *thread)
   if (thread->flags & COTHREAD_STARTED) {
     GST_DEBUG (0,"in thread \n");
     // switch to it
-    longjmp(thread->jmp,1);
+    siglongjmp(thread->jmp,1);
   } else {
     GST_ARCH_SETUP_STACK(thread->sp);
     GST_ARCH_SET_SP(thread->sp);
@@ -378,7 +379,12 @@ selfswitch:
   return;
 }
 
-
+/**
+ * cothread_lock:
+ * @thread: cothread state to lock
+ *
+ * Locks the cothread state.
+ */
 void
 cothread_lock (cothread_state *thread)
 {
@@ -390,6 +396,14 @@ cothread_lock (cothread_state *thread)
 #endif
 }
 
+/**
+ * cothread_trylock:
+ * @thread: cothread state to try to lock
+ *
+ * Try to lock the cothread state
+ *
+ * Returns: TRUE if the cothread could be locked.
+ */
 gboolean
 cothread_trylock (cothread_state *thread)
 {
@@ -403,6 +417,12 @@ cothread_trylock (cothread_state *thread)
 #endif
 }
 
+/**
+ * cothread_unlock:
+ * @thread: cothread state to unlock
+ *
+ * Unlock the cothread state.
+ */
 void
 cothread_unlock (cothread_state *thread)
 {
index d95d7cf..d33a45f 100644 (file)
@@ -53,7 +53,7 @@ struct _cothread_state {
 
   int flags;
   void *sp;
-  jmp_buf jmp;
+  sigjmp_buf jmp;
   /* is this needed any more? */
   void *top_sp;
   void *pc;
index a45f134..1a61097 100644 (file)
@@ -134,8 +134,6 @@ gst_bin_init (GstBin *bin)
   bin->num_eos_providers = 0;
   bin->chains = NULL;
   bin->eoscond = g_cond_new ();
-// FIXME temporary testing measure
-//  bin->use_cothreads = TRUE;
 }
 
 /**
@@ -644,14 +642,6 @@ gst_bin_restore_thyself (GstObject *object,
   }
 }
 
-void
-gst_bin_use_cothreads (GstBin *bin,
-                      gboolean enabled)
-{
-  g_return_if_fail (GST_IS_BIN (bin));
-
-  bin->use_cothreads = enabled;
-}
 
 /**
  * gst_bin_iterate:
index da5d8aa..e18ad0e 100644 (file)
@@ -82,7 +82,6 @@ struct _GstBin {
   gint num_entries;
 
   cothread_context *threadcontext;
-  gboolean use_cothreads;
 };
 
 struct _GstBinClass {
@@ -115,10 +114,6 @@ GtkType            gst_bin_get_type                (void);
 GstElement*    gst_bin_new                     (const gchar *name);
 #define                gst_bin_destroy(bin)            gst_object_destroy(GST_OBJECT(bin))
 
-void           gst_bin_set_element_manager     (GstElement *element, GstElement *manager);
-void           gst_bin_add_managed_element     (GstBin *bin, GstElement *element);
-void           gst_bin_remove_managed_element  (GstBin *bin, GstElement *element);
-
 /* add and remove elements from the bin */
 void           gst_bin_add                     (GstBin *bin,
                                                 GstElement *element);
@@ -138,10 +133,6 @@ gboolean   gst_bin_set_state_type          (GstBin *bin,
 
 gboolean       gst_bin_iterate                 (GstBin *bin);
 
-/* hack FIXME */
-void           gst_bin_use_cothreads           (GstBin *bin,
-                                                gboolean enabled);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index 46ccbde..a962462 100644 (file)
@@ -129,6 +129,7 @@ guint32 _gst_debug_categories = 0x00000000;
 /**
  * gst_default_debug_handler:
  * @category: category of the DEBUG message
+ * @incore: if the debug handler is for core code.
  * @file: the file the DEBUG occurs in
  * @function: the function the DEBUG occurs in
  * @line: the line number in the file
@@ -247,6 +248,7 @@ guint32 _gst_info_categories = 0x00000001;
 /**
  * gst_default_info_handler:
  * @category: category of the INFO message
+ * @incore: if the info handler is for core code.
  * @file: the file the INFO occurs in
  * @function: the function the INFO occurs in
  * @line: the line number in the file
index 82c7e2b..d693a5f 100644 (file)
@@ -152,6 +152,8 @@ gst_object_new (void)
  * @object: GstObject to reference
  *
  * Increments the refence count on the object.
+ *
+ * Returns: A pointer to the object
  */
 GstObject*
 gst_object_ref (GstObject *object)
@@ -370,13 +372,15 @@ gst_object_unparent (GstObject *object)
  * @object: GstObject to reference
  *
  * Increments the refence count on the object.
+ *
+ * Returns: Apointer to the Object
  */
 #ifndef gst_object_ref
-void
+GstObject*
 gst_object_ref (GstObject *object)
 {
-  g_return_if_fail (object != NULL);
-  g_return_if_fail (GST_IS_OBJECT (object));
+  g_return_if_fail (object != NULL, NULL);
+  g_return_if_fail (GST_IS_OBJECT (object), NULL);
 
 #ifdef HAVE_ATOMIC_H
   g_return_if_fail (atomic_read (&(object->refcount)) > 0);
@@ -387,6 +391,8 @@ gst_object_ref (GstObject *object)
   object->refcount++;
   GST_UNLOCK (object);
 #endif
+
+  return object;
 }
 #endif /* gst_object_ref */
 
index 69913d2..16cae99 100644 (file)
@@ -704,39 +704,46 @@ gst_pad_set_parent (GstPad *pad,
 }
 
 /**
- * gst_pad_get_padtemplate:
- * @pad: the pad to get the padtemplate from
+ * gst_pad_get_parent:
+ * @pad: the pad to get the parent from
  *
- * Get the padtemplate object of this pad.
+ * Get the parent object of this pad.
  *
- * Returns: the padtemplate object
+ * Returns: the parent object
  */
-GstPadTemplate*
-gst_pad_get_padtemplate (GstPad *pad)
+GstElement*
+gst_pad_get_parent (GstPad *pad)
 {
   g_return_val_if_fail (pad != NULL, NULL);
   g_return_val_if_fail (GST_IS_PAD (pad), NULL);
 
-  return GST_PAD_PADTEMPLATE (pad); 
+  return GST_PAD_PARENT (pad);
 }
 
 /**
- * gst_pad_get_parent:
- * @pad: the pad to get the parent from
+ * gst_pad_get_padtemplate:
+ * @pad: the pad to get the padtemplate from
  *
- * Get the parent object of this pad.
+ * Get the padtemplate object of this pad.
  *
- * Returns: the parent object
+ * Returns: the padtemplate object
  */
-GstElement*
-gst_pad_get_parent (GstPad *pad)
+GstPadTemplate*
+gst_pad_get_padtemplate (GstPad *pad)
 {
   g_return_val_if_fail (pad != NULL, NULL);
   g_return_val_if_fail (GST_IS_PAD (pad), NULL);
 
-  return GST_PAD_PARENT (pad);
+  return GST_PAD_PADTEMPLATE (pad); 
 }
 
+/**
+ * gst_pad_set_sched:
+ * @pad: the pad to set the scheduler for
+ * @sched: The scheduler to set
+ *
+ * Set the sceduler for the pad
+ */
 void
 gst_pad_set_sched (GstPad *pad, GstSchedule *sched)
 {
@@ -746,6 +753,14 @@ gst_pad_set_sched (GstPad *pad, GstSchedule *sched)
   GST_RPAD_SCHED(pad) = sched;
 }
 
+/**
+ * gst_pad_get_sched:
+ * @pad: the pad to get the scheduler from
+ *
+ * Get the scheduler of the pad
+ *
+ * Returns: the scheduler of the pad.
+ */
 GstSchedule*
 gst_pad_get_sched (GstPad *pad)
 {
@@ -761,7 +776,7 @@ gst_pad_get_sched (GstPad *pad)
  *
  * Get the real parent object of this pad. If the pad
  * is a ghostpad, the actual owner of the real pad is
- * returned, as opposed to the gst_pad_get_parent.
+ * returned, as opposed to the gst_pad_get_parent().
  *
  * Returns: the parent object
  */
index 0e43892..d957049 100644 (file)
@@ -25,6 +25,8 @@
 #include <dirent.h>
 #include <unistd.h>
 
+#undef RTLD_GLOBAL
+
 #include "gst_private.h"
 #include "gstplugin.h"
 #include "gstversion.h"
index c10b700..39699da 100644 (file)
@@ -126,20 +126,18 @@ struct _GstScheduleChain {
 };
 
 
-void gst_bin_schedule_func(GstBin *bin);
-
-GtkType                gst_schedule_get_type           (void);
-GstSchedule *  gst_schedule_new                (GstElement *parent);
-
-void   gst_schedule_add_element        (GstSchedule *sched, GstElement *element);
-void   gst_schedule_remove_element     (GstSchedule *sched, GstElement *element);
-void   gst_schedule_enable_element     (GstSchedule *sched, GstElement *element);
-void   gst_schedule_disable_element    (GstSchedule *sched, GstElement *element);
-void   gst_schedule_pad_connect        (GstSchedule *sched, GstPad *srcpad, GstPad *sinkpad);
-void   gst_schedule_pad_disconnect     (GstSchedule *sched, GstPad *srcpad, GstPad *sinkpad);
-gboolean       gst_schedule_iterate    (GstSchedule *sched);
-
-void   gst_schedule_show               (GstSchedule *sched);
+GtkType                        gst_schedule_get_type           (void);
+GstSchedule*           gst_schedule_new                (GstElement *parent);
+
+void                   gst_schedule_add_element        (GstSchedule *sched, GstElement *element);
+void                   gst_schedule_remove_element     (GstSchedule *sched, GstElement *element);
+void                   gst_schedule_enable_element     (GstSchedule *sched, GstElement *element);
+void                   gst_schedule_disable_element    (GstSchedule *sched, GstElement *element);
+void                   gst_schedule_pad_connect        (GstSchedule *sched, GstPad *srcpad, GstPad *sinkpad);
+void                   gst_schedule_pad_disconnect     (GstSchedule *sched, GstPad *srcpad, GstPad *sinkpad);
+gboolean               gst_schedule_iterate            (GstSchedule *sched);
+
+void                   gst_schedule_show               (GstSchedule *sched);
 
 
 #ifdef __cplusplus