2004-05-27 Wim Taymans <wim@fluendo.com>
* gst/schedulers/gstoptimalscheduler.c: (add_to_chain),
+ (remove_from_chain), (chain_group_set_enabled),
+ (setup_group_scheduler), (group_element_set_enabled),
+ (gst_opt_scheduler_state_transition), (gst_opt_scheduler_iterate),
+ (gst_opt_scheduler_show):
+ Elements without a group can do a state change as well, just wait
+ with the setup of the scheduling function when it is added to a
+ chain.
+
+2004-05-27 Wim Taymans <wim@fluendo.com>
+
+ * gst/schedulers/gstoptimalscheduler.c: (add_to_chain),
(remove_from_chain), (chain_group_set_enabled), (add_to_group),
(merge_groups), (setup_group_scheduler),
(group_inc_links_for_element), (gst_opt_scheduler_iterate),
enabled = GST_OPT_SCHEDULER_GROUP_IS_ENABLED (group);
if (enabled) {
+ /* we can now setup the scheduling of the group */
+ setup_group_scheduler (chain->sched, group);
+
chain->num_enabled++;
if (chain->num_enabled == chain->num_groups) {
GST_LOG ("enabling chain %p after adding of enabled group", chain);
group->chain==NULL. */
if (enabled) {
- if (group->num_enabled < group->num_elements)
- group->num_enabled++;
+ g_assert (group->num_enabled < group->num_elements);
+
+ group->num_enabled++;
GST_DEBUG
("enable element %s in group %p, now %d elements enabled out of %d",
}
}
} else {
- if (group->num_enabled > 0)
- group->num_enabled--;
+ g_assert (group->num_enabled > 0);
+
+ group->num_enabled--;
GST_DEBUG
("disable element %s in group %p, now %d elements enabled out of %d",
switch (transition) {
case GST_STATE_PAUSED_TO_PLAYING:
- /* an element withut a group has to be an unlinked src, sink
+ /* an element without a group has to be an unlinked src, sink
* filter element */
if (!group) {
GST_INFO ("element \"%s\" has no group", GST_ELEMENT_NAME (element));
- res = GST_STATE_FAILURE;
}
/* else construct the scheduling context of this group and enable it */
else {
osched->state = GST_OPT_SCHEDULER_STATE_RUNNING;
- /* gst_opt_scheduler_show (sched); */
+ //gst_opt_scheduler_show (sched);
GST_DEBUG_OBJECT (sched, "iterating");