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;
}
/**
- * cothread_current)main:
+ * cothread_current_main:
*
* Returns: the #cothread_state of the main (0th) thread in the current pthread
*/
#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);
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);
return;
}
-
+/**
+ * cothread_lock:
+ * @thread: cothread state to lock
+ *
+ * Locks the cothread state.
+ */
void
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)
{
#endif
}
+/**
+ * cothread_unlock:
+ * @thread: cothread state to unlock
+ *
+ * Unlock the cothread state.
+ */
void
cothread_unlock (cothread_state *thread)
{
int flags;
void *sp;
- jmp_buf jmp;
+ sigjmp_buf jmp;
/* is this needed any more? */
void *top_sp;
void *pc;
bin->num_eos_providers = 0;
bin->chains = NULL;
bin->eoscond = g_cond_new ();
-// FIXME temporary testing measure
-// bin->use_cothreads = TRUE;
}
/**
}
}
-void
-gst_bin_use_cothreads (GstBin *bin,
- gboolean enabled)
-{
- g_return_if_fail (GST_IS_BIN (bin));
-
- bin->use_cothreads = enabled;
-}
/**
* gst_bin_iterate:
gint num_entries;
cothread_context *threadcontext;
- gboolean use_cothreads;
};
struct _GstBinClass {
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);
gboolean gst_bin_iterate (GstBin *bin);
-/* hack FIXME */
-void gst_bin_use_cothreads (GstBin *bin,
- gboolean enabled);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
/**
* 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
/**
* 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
* @object: GstObject to reference
*
* Increments the refence count on the object.
+ *
+ * Returns: A pointer to the object
*/
GstObject*
gst_object_ref (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);
object->refcount++;
GST_UNLOCK (object);
#endif
+
+ return object;
}
#endif /* gst_object_ref */
}
/**
- * 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)
{
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)
{
*
* 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
*/
#include <dirent.h>
#include <unistd.h>
+#undef RTLD_GLOBAL
+
#include "gst_private.h"
#include "gstplugin.h"
#include "gstversion.h"
};
-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