summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2002-06-12 03:32:02 +0000
committerAndy Wingo <wingo@pobox.com>2002-06-12 03:32:02 +0000
commitdb515dbd19baf2d2d1fe4b653f4de5f728c274d1 (patch)
tree881cd51e04f686bfc371870f72db860c72c3657f
parent9f08fd8e6a90f42cca922d6b92412fbbed4cc597 (diff)
downloadgst-plugins-bad-db515dbd19baf2d2d1fe4b653f4de5f728c274d1.tar.gz
gst-plugins-bad-db515dbd19baf2d2d1fe4b653f4de5f728c274d1.tar.bz2
gst-plugins-bad-db515dbd19baf2d2d1fe4b653f4de5f728c274d1.zip
working jack elements (fixed a problem in upstream jack) random other fixen...
Original commit message from CVS: * working jack elements (fixed a problem in upstream jack) * random other fixen...
-rw-r--r--examples/seeking/spider_seek.c2
-rw-r--r--ext/jack/gstjack.c18
-rw-r--r--ext/jack/gstjackbin.c13
-rw-r--r--gst/speed/Makefile.am2
-rw-r--r--gst/speed/demo-mp3.c17
5 files changed, 26 insertions, 26 deletions
diff --git a/examples/seeking/spider_seek.c b/examples/seeking/spider_seek.c
index b7b37529..b138356f 100644
--- a/examples/seeking/spider_seek.c
+++ b/examples/seeking/spider_seek.c
@@ -41,7 +41,7 @@ make_spider_pipeline (const gchar *location, gboolean thread)
v_thread = gst_thread_new ("v_thread");
v_queue = gst_element_factory_make ("queue", "v_queue");
- videosink = gst_element_factory_make ("xvideosink", "v_sink");
+ videosink = gst_element_factory_make ("videosink", "v_sink");
//g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
g_object_set (G_OBJECT (src), "location", location, NULL);
diff --git a/ext/jack/gstjack.c b/ext/jack/gstjack.c
index 4cf4df58..9311ff52 100644
--- a/ext/jack/gstjack.c
+++ b/ext/jack/gstjack.c
@@ -400,7 +400,7 @@ gst_jack_loop (GstElement *element)
{
GstJack *this;
GList *pads;
- gint len;
+ gint len, peeked_len;
gchar *peeked;
gint avail;
GstEvent *event;
@@ -421,7 +421,9 @@ gst_jack_loop (GstElement *element)
if (!pad->bs)
pad->bs = gst_bytestream_new (pad->pad);
- if (gst_bytestream_peek_bytes (pad->bs, (guint8**)&peeked, len) < len) {
+ read:
+ peeked_len = gst_bytestream_peek_bytes (pad->bs, (guint8**)&peeked, len);
+ if (peeked_len < len) {
gst_bytestream_get_status(pad->bs, &avail, &event);
if (event) {
g_warning("got an event on jacksink");
@@ -430,9 +432,12 @@ gst_jack_loop (GstElement *element)
* me know when this is needed ;)
* also, for sample accuracy etc, we should play avail
* bytes, but hey. */
- gst_element_set_eos(GST_ELEMENT(this));
- gst_event_free(event);
+ gst_element_set_eos (element);
+ gst_event_free (event);
+ gst_element_yield (element); /* shouldn't return */
+ return;
}
+ goto read;
} else {
/* the element at the top of the chain did not emit an eos
* event. this is a Bug(tm) */
@@ -440,8 +445,9 @@ gst_jack_loop (GstElement *element)
}
}
- memcpy (pad->data, peeked, len);
- gst_bytestream_flush (pad->bs, len);
+
+ memcpy (pad->data, peeked, peeked_len);
+ gst_bytestream_flush (pad->bs, peeked_len);
} else {
buffer = gst_buffer_new ();
GST_BUFFER_DATA (buffer) = pad->data;
diff --git a/ext/jack/gstjackbin.c b/ext/jack/gstjackbin.c
index 49ecca70..5aee2924 100644
--- a/ext/jack/gstjackbin.c
+++ b/ext/jack/gstjackbin.c
@@ -102,7 +102,7 @@ gst_jack_bin_change_state (GstElement *element)
switch (GST_STATE_PENDING (element)) {
case GST_STATE_NULL:
- g_message ("jack: NULL state");
+ g_message ("jackbin: NULL state");
if (this->client) {
g_message ("jack: closing client");
jack_client_close (this->client);
@@ -113,7 +113,7 @@ gst_jack_bin_change_state (GstElement *element)
break;
case GST_STATE_READY:
- g_message ("jack: READY");
+ g_message ("jackbin: READY");
if (!this->client) {
if (!(this->client = jack_client_new ("gst-jack"))) {
g_warning ("jack server not running?");
@@ -154,24 +154,25 @@ gst_jack_bin_change_state (GstElement *element)
break;
case GST_STATE_PAUSED:
- g_message ("jack: PAUSED");
+ g_message ("jackbin: PAUSED");
if (!GST_FLAG_IS_SET (GST_OBJECT (this), GST_JACK_OPEN)) {
l = this->src_pads;
while (l) {
pad = GST_JACK_PAD (l);
g_message ("jack: registering pad %s:%s", pad->name, pad->peer_name);
- pad->port = jack_port_register (this->client, pad->name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0);
+ pad->port = jack_port_register (this->client, pad->name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput|JackPortIsTerminal, 0);
l = g_list_next (l);
}
l = this->sink_pads;
while (l) {
pad = GST_JACK_PAD (l);
g_message ("jack: registering pad %s:%s", pad->name, pad->peer_name);
- pad->port = jack_port_register (this->client, pad->name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0);
+ pad->port = jack_port_register (this->client, pad->name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput|JackPortIsTerminal, 0);
l = g_list_next (l);
}
+ /* must activate before connecting */
if (!GST_FLAG_IS_SET (GST_OBJECT (this), GST_JACK_ACTIVE)) {
g_message ("jack: activating client");
jack_activate (this->client);
@@ -201,7 +202,7 @@ gst_jack_bin_change_state (GstElement *element)
l = g_list_next (l);
}
- g_message ("jack: setting OPEN flag");
+ g_message ("jackbin: setting OPEN flag");
GST_FLAG_SET (GST_OBJECT (this), GST_JACK_OPEN);
} else {
g_cond_wait (this->cond, this->lock);
diff --git a/gst/speed/Makefile.am b/gst/speed/Makefile.am
index 6a75868f..7ab9f2cb 100644
--- a/gst/speed/Makefile.am
+++ b/gst/speed/Makefile.am
@@ -10,7 +10,7 @@ libgstspeed_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
noinst_HEADERS = gstspeed.h filter.func
if HAVE_GTK
-noinst_PROGRAMS = demo_mp3
+noinst_PROGRAMS = demo-mp3
endif
demo_mp3_SOURCES = demo-mp3.c
diff --git a/gst/speed/demo-mp3.c b/gst/speed/demo-mp3.c
index 31f15da9..3e81853b 100644
--- a/gst/speed/demo-mp3.c
+++ b/gst/speed/demo-mp3.c
@@ -4,7 +4,7 @@
void set_speed (GtkAdjustment *adj, gpointer data)
{
GstElement *speed = GST_ELEMENT(data);
- gtk_object_set(GTK_OBJECT(speed), "speed", adj->value, NULL);
+ g_object_set (speed, "speed", adj->value, NULL);
}
int main(int argc, char **argv)
@@ -41,22 +41,15 @@ int main(int argc, char **argv)
stereo2mono = gst_element_factory_make("stereo2mono", "stereo2mono");
speed = gst_element_factory_make("speed", "speed");
osssink = gst_element_factory_make("osssink", "osssink");
- gtk_object_set(GTK_OBJECT(osssink), "fragment", 0x00180008, NULL);
+ g_object_set(osssink, "fragment", 0x00180008, NULL);
gtk_signal_connect(GTK_OBJECT(gtk_range_get_adjustment(GTK_RANGE(hscale))),
"value_changed", G_CALLBACK (set_speed), speed);
pipeline = gst_pipeline_new("app");
- gst_bin_add(GST_BIN(pipeline), filesrc);
- gst_bin_add(GST_BIN(pipeline), mad);
- gst_bin_add(GST_BIN(pipeline), stereo2mono);
- gst_bin_add(GST_BIN(pipeline), speed);
- gst_bin_add(GST_BIN(pipeline), osssink);
- gst_element_connect(filesrc, mad);
- gst_element_connect(mad, stereo2mono);
- gst_element_connect(stereo2mono, speed);
- gst_element_connect(speed, osssink);
- gtk_object_set(GTK_OBJECT(filesrc), "location", argv[1], NULL);
+ gst_bin_add_many (GST_BIN(pipeline), filesrc, mad, stereo2mono, speed, osssink, NULL);
+ gst_element_connect_many (filesrc, mad, stereo2mono, speed, osssink, NULL);
+ g_object_set(G_OBJECT(filesrc), "location", argv[1], NULL);
gst_element_set_state(pipeline, GST_STATE_PLAYING);