- enable chain if an active group is added to it

Original commit message from CVS:
- enable chain if an active group is added to it
- enable group if a PLAYING element is added to it
This commit is contained in:
Wim Taymans 2003-03-28 17:29:57 +00:00
parent fec6a61298
commit 63db8dfb67

View file

@ -172,7 +172,11 @@ static GstOptSchedulerGroup* ref_group_by_count (GstOptSchedulerGroup *group,
#endif #endif
static GstOptSchedulerGroup* unref_group (GstOptSchedulerGroup *group); static GstOptSchedulerGroup* unref_group (GstOptSchedulerGroup *group);
static void destroy_group (GstOptSchedulerGroup *group); static void destroy_group (GstOptSchedulerGroup *group);
static void group_element_set_enabled (GstOptSchedulerGroup *group,
GstElement *element, gboolean enabled);
static void chain_group_set_enabled (GstOptSchedulerChain *chain,
GstOptSchedulerGroup *group, gboolean enabled);
/* /*
* Scheduler private data for an element * Scheduler private data for an element
*/ */
@ -425,6 +429,10 @@ add_to_chain (GstOptSchedulerChain *chain, GstOptSchedulerGroup *group)
chain->groups = g_slist_prepend (chain->groups, group); chain->groups = g_slist_prepend (chain->groups, group);
chain->num_groups++; chain->num_groups++;
if (GST_OPT_SCHEDULER_GROUP_IS_ENABLED (group)) {
chain_group_set_enabled (chain, group, TRUE);
}
return chain; return chain;
} }
@ -587,6 +595,10 @@ add_to_group (GstOptSchedulerGroup *group, GstElement *element)
group->elements = g_slist_prepend (group->elements, element); group->elements = g_slist_prepend (group->elements, element);
group->num_elements++; group->num_elements++;
if (gst_element_get_state (element) == GST_STATE_PLAYING) {
group_element_set_enabled (group, element, TRUE);
}
return group; return group;
} }