g_warning ("cannot connect pads from decoupled elements with the same sched\n");
return FALSE;
} else if (realsrc->sched != realsink->sched && num_decoupled != 1) {
- g_warning ("connecting pads with different scheds requires one decoupled element (queue)\n");
+ g_warning ("connecting pads with different scheds requires exactly one decoupled element (queue)\n");
return FALSE;
}
} else if (realsrc->sched || realsink->sched) {
g_warning ("you can't connect to a non-managed element");
+ return FALSE;
}
/* check for reversed directions and swap if necessary */
* @pad: the pad to set the scheduler for
* @sched: The scheduler to set
*
- * Set the sceduler for the pad
+ * Set the scheduler for the pad
*/
void
gst_pad_set_sched (GstPad *pad, GstScheduler *sched)
}
/**
+ * gst_pad_unset_sched:
+ * @pad: the pad to unset the scheduler for
+ *
+ * Unset the scheduler for the pad
+ */
+void
+gst_pad_unset_sched (GstPad *pad)
+{
+ g_return_if_fail (pad != NULL);
+ g_return_if_fail (GST_IS_PAD (pad));
+
+ GST_RPAD_SCHED(pad) = NULL;
+}
+
+/**
* gst_pad_get_real_parent:
* @pad: the pad to get the parent from
*
/**
* gst_scheduler_setup:
- * @sched: the schedulerr
+ * @sched: the scheduler
*
* Prepare the scheduler.
*/
/**
* gst_scheduler_reset:
- * @sched: the schedulerr
+ * @sched: the scheduler
*
* Reset the scheduler
*/
/**
* gst_scheduler_pad_connect:
- * @sched: the schedulerr
+ * @sched: the scheduler
* @srcpad: the srcpad to connect
* @sinkpad: the sinkpad to connect to
*
/**
* gst_scheduler_pad_disconnect:
- * @sched: the schedulerr
+ * @sched: the scheduler
* @srcpad: the srcpad to disconnect
* @sinkpad: the sinkpad to disconnect from
*
/**
* gst_scheduler_pad_select:
- * @sched: the schedulerr
+ * @sched: the scheduler
* @padlist: the padlist to select on
*
* register the given padlist for a select operation.
/**
* gst_scheduler_add_element:
- * @sched: the schedulerr
+ * @sched: the scheduler
* @element: the element to add to the schedulerr
*
* Add an element to the schedulerr.
/**
* gst_scheduler_state_transition:
- * @sched: the schedulerr
+ * @sched: the scheduler
* @element: the element with the state transition
* @transition: the state transition
*
/**
* gst_scheduler_remove_element:
* @sched: the schedulerr
- * @element: the element to remove
+ * @element: the element to remov
*
* Remove an element from the schedulerr.
*/
void
gst_scheduler_remove_element (GstScheduler *sched, GstElement *element)
{
+ GList *l;
+
g_return_if_fail (GST_IS_SCHEDULER (sched));
g_return_if_fail (GST_IS_ELEMENT (element));
if (CLASS (sched)->remove_element)
CLASS (sched)->remove_element (sched, element);
+
+ for (l=element->pads; l; l=l->next)
+ gst_pad_unset_sched ((GstPad*) l->data);
}
/**
* gst_scheduler_lock_element:
- * @sched: the schedulerr
+ * @sched: the scheduler
* @element: the element to lock
*
* Acquire a lock on the given element in the given scheduler.
/**
* gst_scheduler_unlock_element:
- * @sched: the schedulerr
+ * @sched: the scheduler
* @element: the element to unlock
*
* Release the lock on the given element in the given scheduler.
/**
* gst_scheduler_error:
- * @sched: the schedulerr
+ * @sched: the scheduler
* @element: the element with the error
*
* Tell the scheduler an element was in error
/**
* gst_scheduler_yield:
- * @sched: the schedulerr
+ * @sched: the scheduler
* @element: the element requesting a yield
*
* Tell the scheduler to schedule another element.
/**
* gst_scheduler_interrupt:
- * @sched: the schedulerr
+ * @sched: the scheduler
* @element: the element requesting an interrupt
*
* Tell the scheduler to interrupt execution of this element.
/**
* gst_scheduler_iterate:
- * @sched: the schedulerr
+ * @sched: the scheduler
*
* Perform one iteration on the schedulerr.
*
/**
* gst_scheduler_show:
- * @sched: the schedulerr
+ * @sched: the scheduler
*
* Dump the state of the schedulerr
*/
#include <gst/gst.h>
+/* This test will fail because it tries to allocate two cothread_context's in
+ * one thread. This will cause a segfault. This is a problem with gstreamer's
+ * cothreading that will be fixed in the future.
+ */
+
int main (int argc, char *argv[])
{
GstElement *fakesrc, *fakesink1, *fakesink2, *pipe1, *pipe2;
gst_object_ref(GST_OBJECT(fakesrc));
gst_bin_remove(GST_BIN(pipe1), fakesrc);
gst_bin_remove(GST_BIN(pipe1), fakesink1);
+ gst_object_unref(GST_OBJECT(pipe1));
// make a new pipeline
gst_bin_add (GST_BIN(pipe2), fakesink2);