summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2002-05-04 18:57:44 +0000
committerAndy Wingo <wingo@pobox.com>2002-05-04 18:57:44 +0000
commit773b7da81f44165aa50fbc7a1e5c1ad629c959cc (patch)
tree6a7812755f792574540382621542250ab800f5e2 /ext
parent1c087c8a15062bec8bd616e9dfff7a7d4498f908 (diff)
downloadgst-plugins-bad-773b7da81f44165aa50fbc7a1e5c1ad629c959cc.tar.gz
gst-plugins-bad-773b7da81f44165aa50fbc7a1e5c1ad629c959cc.tar.bz2
gst-plugins-bad-773b7da81f44165aa50fbc7a1e5c1ad629c959cc.zip
some jack fixes, alsa touchups, and add rtp by default to the build if there are any problems building rtp, we're mov...
Original commit message from CVS: some jack fixes, alsa touchups, and add rtp by default to the build if there are any problems building rtp, we're moving it back to experimental ;)
Diffstat (limited to 'ext')
-rw-r--r--ext/jack/gstjack.c1
-rw-r--r--ext/jack/gstjack.h5
-rw-r--r--ext/jack/gstjackbin.c49
3 files changed, 38 insertions, 17 deletions
diff --git a/ext/jack/gstjack.c b/ext/jack/gstjack.c
index 87ce638c..1258e233 100644
--- a/ext/jack/gstjack.c
+++ b/ext/jack/gstjack.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C; c-basic-offset: 4 -*- */
/*
Copyright (C) 2002 Andy Wingo <wingo@pobox.com>
diff --git a/ext/jack/gstjack.h b/ext/jack/gstjack.h
index 38763cd6..9d07f869 100644
--- a/ext/jack/gstjack.h
+++ b/ext/jack/gstjack.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C; c-basic-offset: 4 -*- */
/*
Copyright (C) 2002 Andy Wingo <wingo@pobox.com>
@@ -109,6 +110,10 @@ struct _GstJackBin {
guint rate;
nframes_t nframes;
+
+ /* the scheduler needs to be setup from within the jack client thread; this
+ variable is to keep track of whether or not we have been set up yet */
+ gboolean sched_setup;
};
struct _GstJackBinClass {
diff --git a/ext/jack/gstjackbin.c b/ext/jack/gstjackbin.c
index 8a4cc763..dbaac665 100644
--- a/ext/jack/gstjackbin.c
+++ b/ext/jack/gstjackbin.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C; c-basic-offset: 4 -*- */
/*
Copyright (C) 2002 Andy Wingo <wingo@pobox.com>
@@ -37,23 +38,23 @@ static void shutdown (void *arg);
GType
gst_jack_bin_get_type (void)
{
- static GType jack_bin_type = 0;
-
- if (!jack_bin_type) {
- static const GTypeInfo jack_bin_info = {
- sizeof(GstJackBinClass),
- NULL,
- NULL,
- (GClassInitFunc)gst_jack_bin_class_init,
- NULL,
- NULL,
- sizeof(GstJackBin),
- 0,
- (GInstanceInitFunc)gst_jack_bin_init,
- };
- jack_bin_type = g_type_register_static (GST_TYPE_BIN, "GstJackBin", &jack_bin_info, 0);
- }
- return jack_bin_type;
+ static GType jack_bin_type = 0;
+
+ if (!jack_bin_type) {
+ static const GTypeInfo jack_bin_info = {
+ sizeof(GstJackBinClass),
+ NULL,
+ NULL,
+ (GClassInitFunc)gst_jack_bin_class_init,
+ NULL,
+ NULL,
+ sizeof(GstJackBin),
+ 0,
+ (GInstanceInitFunc)gst_jack_bin_init,
+ };
+ jack_bin_type = g_type_register_static (GST_TYPE_BIN, "GstJackBin", &jack_bin_info, 0);
+ }
+ return jack_bin_type;
}
static void
@@ -73,6 +74,14 @@ gst_jack_bin_class_init(GstJackClass *klass)
static void
gst_jack_bin_init(GstJack *this)
{
+ GST_DEBUG (GST_CAT_THREAD, "initializing jack bin");
+
+ /* jack bins are managing bins and iterate themselves */
+ GST_FLAG_SET (this, GST_BIN_FLAG_MANAGER);
+ GST_FLAG_SET (this, GST_BIN_SELF_SCHEDULABLE);
+
+ /* make a new scheduler and associate it with the bin */
+ gst_scheduler_factory_make (NULL, GST_ELEMENT (this));
}
static GstElementStateReturn
@@ -237,6 +246,12 @@ sample_rate (nframes_t nframes, void *arg)
GstJackBin *bin = (GstJackBin*) arg;
printf ("the sample rate is now %lu/sec\n", nframes);
bin->rate = nframes;
+
+ if (!bin->sched_setup) {
+ gst_scheduler_setup (GST_ELEMENT_SCHED (bin));
+ bin->sched_setup = TRUE;
+ }
+
return 0;
}