gst/gstbin.c: don't add decoupled elements to schedulers - otherwise it's impossible to control if a link to a decoup...

Original commit message from CVS:
* gst/gstbin.c: (gst_bin_set_element_sched),
(gst_bin_unset_element_sched):
don't add decoupled elements to schedulers - otherwise it's
impossible to control if a link to a decoupled element was already
removed from a scheduler or not.
* gst/schedulers/cothreads_compat.h:
* gst/schedulers/gthread-cothreads.h:
add COTHREADS_TYPE macro. Make do_cothread_set_func a macro so there
is no "unused" warning.
* gst/schedulers/Makefile.am:
* gst/schedulers/entryscheduler.c:
add new scheduler, based on ideas from talking to David and Martin.
It's supposed to be small and correct. Currently it's also slow (but
it's not noticable)
* examples/retag/retag.c: (main):
* testsuite/bytestream/test1.c: (main):
fix missing NULLs at end of variadic functions
* testsuite/elements/.cvsignore:
update
This commit is contained in:
Benjamin Otte 2004-03-28 02:29:24 +00:00
parent 734bd34a92
commit c29e35436f
12 changed files with 1081 additions and 23 deletions

View file

@ -1,3 +1,25 @@
2004-03-28 Benjamin Otte <otte@gnome.org>
* gst/gstbin.c: (gst_bin_set_element_sched),
(gst_bin_unset_element_sched):
don't add decoupled elements to schedulers - otherwise it's
impossible to control if a link to a decoupled element was already
removed from a scheduler or not.
* gst/schedulers/cothreads_compat.h:
* gst/schedulers/gthread-cothreads.h:
add COTHREADS_TYPE macro. Make do_cothread_set_func a macro so there
is no "unused" warning.
* gst/schedulers/Makefile.am:
* gst/schedulers/entryscheduler.c:
add new scheduler, based on ideas from talking to David and Martin.
It's supposed to be small and correct. Currently it's also slow (but
it's not noticable)
* examples/retag/retag.c: (main):
* testsuite/bytestream/test1.c: (main):
fix missing NULLs at end of variadic functions
* testsuite/elements/.cvsignore:
update
2004-03-28 Jan Schmidt <thaytan@mad.scientist.com>
* gst/gstevent.h:

View file

@ -83,7 +83,8 @@ main (int argc, char *argv[])
gst_bin_add_many (GST_BIN (bin), filesrc, tag_changer, filesink, NULL);
/* link the elements */
g_assert (gst_element_link_many (filesrc, tag_changer, filesink));
if (!gst_element_link_many (filesrc, tag_changer, filesink, NULL))
g_assert_not_reached ();
/* start playing */
gst_element_set_state (bin, GST_STATE_PLAYING);

View file

@ -312,7 +312,7 @@ gst_bin_set_element_sched (GstElement * element, GstScheduler * sched)
(GFunc) gst_bin_set_element_sched, sched);
}
/* otherwise, if it's just a regular old element */
else {
else if (!GST_FLAG_IS_SET (element, GST_ELEMENT_DECOUPLED)) {
GList *pads;
gst_scheduler_add_element (sched, element);
@ -375,9 +375,8 @@ gst_bin_unset_element_sched (GstElement * element, GstScheduler * sched)
(GFunc) gst_bin_unset_element_sched, sched);
gst_scheduler_remove_element (GST_ELEMENT_SCHED (element), element);
}
/* otherwise, if it's just a regular old element */
else {
} else if (!GST_FLAG_IS_SET (element, GST_ELEMENT_DECOUPLED)) {
/* otherwise, if it's just a regular old element */
GList *pads;
/* set the sched pointer in all the pads */

View file

@ -3,6 +3,9 @@ plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@
plugin_LTLIBRARIES = \
libgstbasicomegascheduler.la \
libgstbasicgthreadscheduler.la \
libgstentrygthreadscheduler.la \
libgstentryomegascheduler.la \
libgstfairgthreadscheduler.la \
libgstoptscheduler.la \
libgstoptomegascheduler.la \
libgstoptgthreadscheduler.la
@ -16,6 +19,15 @@ libgstbasicgthreadscheduler_la_SOURCES = gstbasicscheduler.c
libgstbasicgthreadscheduler_la_CFLAGS = $(GST_CFLAGS) -D_COTHREADS_GTHREAD
libgstbasicgthreadscheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstentrygthreadscheduler_la_SOURCES = entryscheduler.c
libgstentrygthreadscheduler_la_CFLAGS = $(GST_CFLAGS) -D_COTHREADS_GTHREAD
libgstentrygthreadscheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstentryomegascheduler_la_SOURCES = entryscheduler.c
libgstentryomegascheduler_la_CFLAGS = $(GST_CFLAGS) -D_COTHREADS_OMEGA
libgstentryomegascheduler_la_LIBADD = ../libcothreads.la
libgstentryomegascheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstoptscheduler_la_SOURCES = gstoptimalscheduler.c
libgstoptscheduler_la_CFLAGS = $(GST_CFLAGS)
libgstoptscheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)

View file

@ -26,6 +26,7 @@
#include "../cothreads.h"
/* the name of this cothreads type */
#define COTHREADS_TYPE omega
#define COTHREADS_NAME "omega"
#define COTHREADS_NAME_CAPITAL "Omega"

File diff suppressed because it is too large Load diff

View file

@ -24,6 +24,7 @@
#include <gst/gstthread.h>
/* the name of this cothreads */
#define COTHREADS_TYPE gthread
#define COTHREADS_NAME "gthread"
#define COTHREADS_NAME_CAPITAL "GThread"
@ -74,11 +75,6 @@ static cothread * cothread_create (cothread_context *conte
new_cothread = cothread_create ((context), (func), argc, (char**) (argv)); \
}G_STMT_END
static void do_cothread_switch (cothread *to);
static void do_cothread_setfunc (cothread *thread,
cothread_context *context,
cothread_func func,
int argc,
char **argv);
static void do_cothread_destroy (cothread *thread);
#define do_cothread_lock(cothread) /* FIXME */
#define do_cothread_unlock(cothread) /* FIXME */
@ -191,14 +187,12 @@ static void do_cothread_switch (cothread *to)
}
}
static void
do_cothread_setfunc (cothread *thread, cothread_context *context,
cothread_func func, int argc, char **argv)
{
thread->run = func;
thread->argc = argc;
thread->argv = argv;
}
#define do_cothread_setfunc(thread,context,_func,_argc,_argv) G_STMT_START {\
((cothread *)(thread))->run = (_func); \
((cothread *)(thread))->argc = _argc; \
((cothread *)(thread))->argv = _argv; \
}G_STMT_END
static void
do_cothread_destroy (cothread *thread)
{

View file

@ -83,7 +83,8 @@ main (int argc, char *argv[])
gst_bin_add_many (GST_BIN (bin), filesrc, tag_changer, filesink, NULL);
/* link the elements */
g_assert (gst_element_link_many (filesrc, tag_changer, filesink));
if (!gst_element_link_many (filesrc, tag_changer, filesink, NULL))
g_assert_not_reached ();
/* start playing */
gst_element_set_state (bin, GST_STATE_PLAYING);

View file

@ -190,9 +190,9 @@ main (int argc, char *argv[])
bs = gst_element_factory_make ("bstest", "bs");
g_assert (bs);
gst_element_link_many (src, bs, sink);
gst_element_link_many (src, bs, sink, NULL);
gst_bin_add_many (GST_BIN (pipeline), src, bs, sink);
gst_bin_add_many (GST_BIN (pipeline), src, bs, sink, NULL);
walk = params;

View file

@ -10,4 +10,6 @@ fake
name
property
tee
gst-inspect-check
gst-compprep-check

View file

@ -190,9 +190,9 @@ main (int argc, char *argv[])
bs = gst_element_factory_make ("bstest", "bs");
g_assert (bs);
gst_element_link_many (src, bs, sink);
gst_element_link_many (src, bs, sink, NULL);
gst_bin_add_many (GST_BIN (pipeline), src, bs, sink);
gst_bin_add_many (GST_BIN (pipeline), src, bs, sink, NULL);
walk = params;

View file

@ -10,4 +10,6 @@ fake
name
property
tee
gst-inspect-check
gst-compprep-check