mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-02 06:31:08 +00:00
gst/schedulers/gstoptimalscheduler.c: Elements without a group can do a state change as well, just wait with the setu...
Original commit message from CVS: * 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.
This commit is contained in:
parent
6187bf80e7
commit
d738f23c6a
2 changed files with 22 additions and 7 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
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>
|
2004-05-27 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
* gst/schedulers/gstoptimalscheduler.c: (add_to_chain),
|
* gst/schedulers/gstoptimalscheduler.c: (add_to_chain),
|
||||||
|
|
|
@ -544,6 +544,9 @@ add_to_chain (GstOptSchedulerChain * chain, GstOptSchedulerGroup * group)
|
||||||
enabled = GST_OPT_SCHEDULER_GROUP_IS_ENABLED (group);
|
enabled = GST_OPT_SCHEDULER_GROUP_IS_ENABLED (group);
|
||||||
|
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
|
/* we can now setup the scheduling of the group */
|
||||||
|
setup_group_scheduler (chain->sched, group);
|
||||||
|
|
||||||
chain->num_enabled++;
|
chain->num_enabled++;
|
||||||
if (chain->num_enabled == chain->num_groups) {
|
if (chain->num_enabled == chain->num_groups) {
|
||||||
GST_LOG ("enabling chain %p after adding of enabled group", chain);
|
GST_LOG ("enabling chain %p after adding of enabled group", chain);
|
||||||
|
@ -1035,7 +1038,8 @@ group_element_set_enabled (GstOptSchedulerGroup * group, GstElement * element,
|
||||||
group->chain==NULL. */
|
group->chain==NULL. */
|
||||||
|
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
if (group->num_enabled < group->num_elements)
|
g_assert (group->num_enabled < group->num_elements);
|
||||||
|
|
||||||
group->num_enabled++;
|
group->num_enabled++;
|
||||||
|
|
||||||
GST_DEBUG
|
GST_DEBUG
|
||||||
|
@ -1053,7 +1057,8 @@ group_element_set_enabled (GstOptSchedulerGroup * group, GstElement * element,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (group->num_enabled > 0)
|
g_assert (group->num_enabled > 0);
|
||||||
|
|
||||||
group->num_enabled--;
|
group->num_enabled--;
|
||||||
|
|
||||||
GST_DEBUG
|
GST_DEBUG
|
||||||
|
@ -1508,11 +1513,10 @@ gst_opt_scheduler_state_transition (GstScheduler * sched, GstElement * element,
|
||||||
|
|
||||||
switch (transition) {
|
switch (transition) {
|
||||||
case GST_STATE_PAUSED_TO_PLAYING:
|
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 */
|
* filter element */
|
||||||
if (!group) {
|
if (!group) {
|
||||||
GST_INFO ("element \"%s\" has no group", GST_ELEMENT_NAME (element));
|
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 construct the scheduling context of this group and enable it */
|
||||||
else {
|
else {
|
||||||
|
@ -2360,7 +2364,7 @@ gst_opt_scheduler_iterate (GstScheduler * sched)
|
||||||
|
|
||||||
osched->state = GST_OPT_SCHEDULER_STATE_RUNNING;
|
osched->state = GST_OPT_SCHEDULER_STATE_RUNNING;
|
||||||
|
|
||||||
/* gst_opt_scheduler_show (sched); */
|
//gst_opt_scheduler_show (sched);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (sched, "iterating");
|
GST_DEBUG_OBJECT (sched, "iterating");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue