mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-25 10:04:19 +00:00
Minor changes to incsched stuff, need to make more major modifications to manager concept now, so I'm checkpointing.
Original commit message from CVS: Minor changes to incsched stuff, need to make more major modifications to manager concept now, so I'm checkpointing.
This commit is contained in:
parent
8edfe3f5de
commit
08427ffb2a
3 changed files with 40 additions and 12 deletions
|
@ -754,13 +754,13 @@ static GstSchedule *sched = &realsched;
|
||||||
/* this function will look at a pad and determine if the peer parent is
|
/* this function will look at a pad and determine if the peer parent is
|
||||||
* a possible candidate for connecting up in the same chain. */
|
* a possible candidate for connecting up in the same chain. */
|
||||||
GstElement *gst_schedule_check_pad (GstSchedule *schedule, GstPad *pad) {
|
GstElement *gst_schedule_check_pad (GstSchedule *schedule, GstPad *pad) {
|
||||||
GstPad *peer;
|
GstRealPad *peer;
|
||||||
GstElement *peerelement;
|
GstElement *peerelement;
|
||||||
|
|
||||||
GST_INFO (GST_CAT_SCHEDULING, "checking pad %s:%s for peer in scheduler",
|
GST_INFO (GST_CAT_SCHEDULING, "checking pad %s:%s for peer in scheduler",
|
||||||
GST_DEBUG_PAD_NAME(pad));
|
GST_DEBUG_PAD_NAME(pad));
|
||||||
|
|
||||||
peer = GST_PAD(GST_PAD_PEER (pad));
|
peer = GST_PAD_PEER (pad);
|
||||||
if (peer == NULL) return NULL;
|
if (peer == NULL) return NULL;
|
||||||
peerelement = GST_ELEMENT(GST_PAD_PARENT (peer));
|
peerelement = GST_ELEMENT(GST_PAD_PARENT (peer));
|
||||||
|
|
||||||
|
@ -816,7 +816,9 @@ gst_schedule_chain_elements (GstSchedule *schedule, GstElement *element1, GstEle
|
||||||
GST_INFO (GST_CAT_SCHEDULING, "creating new chain to hold two new elements");
|
GST_INFO (GST_CAT_SCHEDULING, "creating new chain to hold two new elements");
|
||||||
chain = gst_schedule_chain_new (sched);
|
chain = gst_schedule_chain_new (sched);
|
||||||
chain->elements = g_list_prepend (chain->elements, element1);
|
chain->elements = g_list_prepend (chain->elements, element1);
|
||||||
|
// FIXME chain changed here
|
||||||
chain->elements = g_list_prepend (chain->elements, element2);
|
chain->elements = g_list_prepend (chain->elements, element2);
|
||||||
|
// FIXME chain changed here
|
||||||
chain->num_elements = 2;
|
chain->num_elements = 2;
|
||||||
|
|
||||||
sched->chains = g_list_prepend (sched->chains, chain);
|
sched->chains = g_list_prepend (sched->chains, chain);
|
||||||
|
@ -827,6 +829,7 @@ gst_schedule_chain_elements (GstSchedule *schedule, GstElement *element1, GstEle
|
||||||
GST_INFO (GST_CAT_SCHEDULING, "joining two existing chains together");
|
GST_INFO (GST_CAT_SCHEDULING, "joining two existing chains together");
|
||||||
// take the contents of chain2 and merge them into chain1
|
// take the contents of chain2 and merge them into chain1
|
||||||
chain1->elements = g_list_concat (chain1->elements, chain2->elements);
|
chain1->elements = g_list_concat (chain1->elements, chain2->elements);
|
||||||
|
// FIXME chain changed here
|
||||||
chain1->num_elements += chain2->num_elements;
|
chain1->num_elements += chain2->num_elements;
|
||||||
|
|
||||||
g_free(chain2);
|
g_free(chain2);
|
||||||
|
@ -839,6 +842,7 @@ gst_schedule_chain_elements (GstSchedule *schedule, GstElement *element1, GstEle
|
||||||
|
|
||||||
GST_INFO (GST_CAT_SCHEDULING, "adding element to existing chain");
|
GST_INFO (GST_CAT_SCHEDULING, "adding element to existing chain");
|
||||||
chain->elements = g_list_prepend (chain->elements, element);
|
chain->elements = g_list_prepend (chain->elements, element);
|
||||||
|
// FIXME chain changed here
|
||||||
chain->num_elements++;
|
chain->num_elements++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -878,12 +882,30 @@ gst_schedule_add_element (GstSchedule *schedule, GstElement *element)
|
||||||
void
|
void
|
||||||
gst_schedule_remove_element (GstSchedule *schedule, GstElement *element)
|
gst_schedule_remove_element (GstSchedule *schedule, GstElement *element)
|
||||||
{
|
{
|
||||||
|
GList *chains;
|
||||||
|
GstScheduleChain *chain;
|
||||||
|
|
||||||
g_return_if_fail (element != NULL);
|
g_return_if_fail (element != NULL);
|
||||||
g_return_if_fail (GST_IS_ELEMENT(element));
|
g_return_if_fail (GST_IS_ELEMENT(element));
|
||||||
|
|
||||||
if (g_list_find (sched->elements, element)) {
|
if (g_list_find (sched->elements, element)) {
|
||||||
GST_INFO (GST_CAT_SCHEDULING, "removing element \"%s\" from schedule",
|
GST_INFO (GST_CAT_SCHEDULING, "removing element \"%s\" from schedule",
|
||||||
GST_ELEMENT_NAME(element));
|
GST_ELEMENT_NAME(element));
|
||||||
|
|
||||||
|
// find which chain it's in and remove it from that chain
|
||||||
|
chains = sched->chains;
|
||||||
|
while (chains) {
|
||||||
|
chain = (GstScheduleChain *)(chains->data);
|
||||||
|
chains = g_list_next(chains);
|
||||||
|
|
||||||
|
if (g_list_find (chain->elements, element)) {
|
||||||
|
GST_INFO (GST_CAT_SCHEDULING, "removing element from chain");
|
||||||
|
chain->elements = g_list_remove (chain->elements, element);
|
||||||
|
// FIXME chain changed here
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sched->elements = g_list_remove (sched->elements, element);
|
sched->elements = g_list_remove (sched->elements, element);
|
||||||
sched->num_elements--;
|
sched->num_elements--;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
#define __GST_SCHEDULER_H__
|
#define __GST_SCHEDULER_H__
|
||||||
|
|
||||||
#include <gst/gstelement.h>
|
#include <gst/gstelement.h>
|
||||||
/// ACK!
|
|
||||||
#include <gst/gstbin.h>
|
#include <gst/gstbin.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,17 +21,24 @@ int main(int argc,char *argv[]) {
|
||||||
gst_element_connect(identity,"src",sink,"sink");
|
gst_element_connect(identity,"src",sink,"sink");
|
||||||
|
|
||||||
g_print("\n\nAssembling things:\n");
|
g_print("\n\nAssembling things:\n");
|
||||||
g_print("\nAdding src to thread:\n");
|
g_print("\nAdding src to bin:\n");
|
||||||
gst_bin_add(thread,src);
|
gst_bin_add(bin,src);
|
||||||
g_print("there are %d managed elements in thread\n",thread->num_managed_elements);
|
g_print("there are %d managed elements in bin\n",bin->num_managed_elements);
|
||||||
|
|
||||||
g_print("\nAdding identity to thread:\n");
|
g_print("\nAdding identity to bin:\n");
|
||||||
gst_bin_add(thread,identity);
|
gst_bin_add(bin,identity);
|
||||||
g_print("there are %d managed elements in thread\n",thread->num_managed_elements);
|
g_print("there are %d managed elements in bin\n",bin->num_managed_elements);
|
||||||
|
|
||||||
g_print("\nAdding sink to thread:\n");
|
g_print("\nAdding sink to bin:\n");
|
||||||
gst_bin_add(thread,sink);
|
gst_bin_add(bin,sink);
|
||||||
g_print("there are %d managed elements in thread\n",thread->num_managed_elements);
|
g_print("there are %d managed elements in bin\n",bin->num_managed_elements);
|
||||||
|
|
||||||
|
g_print("\n\nDisconnecting sink:\n");
|
||||||
|
gst_element_disconnect(identity,"src",sink,"sink");
|
||||||
|
|
||||||
|
g_print("\nRemoving sink from bin:\n");
|
||||||
|
gst_bin_remove(bin,sink);
|
||||||
|
g_print("there are %d managed elements in bin\n",bin->num_managed_elements);
|
||||||
|
|
||||||
// g_print("\nAdding bin to thread:\n");
|
// g_print("\nAdding bin to thread:\n");
|
||||||
// gst_bin_add(thread,bin);
|
// gst_bin_add(thread,bin);
|
||||||
|
|
Loading…
Reference in a new issue