From ffbc7201a75ff912d334f1ae166d62543666bc99 Mon Sep 17 00:00:00 2001 From: Erik Walthinsen Date: Tue, 12 Dec 2000 06:49:26 +0000 Subject: [PATCH] Brand new source, the cdparanoia source. Reads audio data from a CD, writes out raw audio. The tests/paranoia.c pro... Original commit message from CVS: Brand new source, the cdparanoia source. Reads audio data from a CD, writes out raw audio. The tests/paranoia.c program will simply hook this up to a sound card. It works perfectly. Next step is to flesh out the rest of the element, including pad caps, better seek and playout control, signals, and whatever else comes up. A minor patch to the editor is included here, the GstElementFactory details struct has a name change from 'class' to 'klass' that wasn't reflected in the elementselect widget. Fixd. --- configure.in | 1 + editor/gstelementselect.c | 4 ++-- tests/Makefile.am | 2 +- tests/paranoia.c | 42 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 tests/paranoia.c diff --git a/configure.in b/configure.in index 91073cbecb..d9f045f76d 100644 --- a/configure.in +++ b/configure.in @@ -469,6 +469,7 @@ plugins/rtjpeg/Makefile plugins/vorbis/Makefile plugins/capture/Makefile plugins/capture/v4l/Makefile +plugins/cdparanoia/Makefile gstplay/Makefile components/bonobo-gstmediaplay/Makefile test/Makefile diff --git a/editor/gstelementselect.c b/editor/gstelementselect.c index 36276dd86e..a137f5a39b 100644 --- a/editor/gstelementselect.c +++ b/editor/gstelementselect.c @@ -200,9 +200,9 @@ GstElementFactory *element_select_dialog() { elements = gst_elementfactory_get_list(); while (elements) { element = (GstElementFactory *)(elements->data); - printf("%s %s\n", element->name, element->details->class); + printf("%s %s\n", element->name, element->details->klass); /* split up the factory's class */ - classes = g_strsplit(element->details->class,"/",0); + classes = g_strsplit(element->details->klass,"/",0); class = classes; curlist = &classtree; /* walk down the class tree to find where to place this element */ diff --git a/tests/Makefile.am b/tests/Makefile.am index a67b1d8e12..22b404d58f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,4 +1,4 @@ -noinst_PROGRAMS = init loadall simplefake states caps queue registry +noinst_PROGRAMS = init loadall simplefake states caps queue registry paranoia LDADD = $(GLIB_LIBS) $(GTK_LIBS) $(top_builddir)/gst/libgst.la CFLAGS = -Wall diff --git a/tests/paranoia.c b/tests/paranoia.c new file mode 100644 index 0000000000..44bbcd5ad3 --- /dev/null +++ b/tests/paranoia.c @@ -0,0 +1,42 @@ +#include + +int main(int argc,char *argv[]) { + GstPipeline *pipeline; + GstElement *paranoia,*queue,*audio_thread,*audiosink; + int i; + + DEBUG_ENTER("(%d)",argc); + + gst_init(&argc,&argv); + + pipeline = GST_PIPELINE(gst_pipeline_new("paranoia")); + g_return_if_fail(pipeline != NULL); + audio_thread = gst_thread_new("audio_thread"); + g_return_if_fail(audio_thread != NULL); + + paranoia = gst_elementfactory_make("cdparanoia","paranoia"); + g_return_val_if_fail(1,paranoia != NULL); +// gtk_object_set(GTK_OBJECT(paranoia),"extra_paranoia",FALSE,"cdda2wav_paranoia",FALSE,NULL); + + queue = gst_elementfactory_make("queue","queue"); + g_return_val_if_fail(2,queue != NULL); + + audiosink = gst_elementfactory_make("audiosink","audiosink"); + g_return_val_if_fail(2,audiosink != NULL); + + gst_bin_add(GST_BIN(pipeline),paranoia); + gst_bin_add(GST_BIN(pipeline),queue); + gst_bin_add(GST_BIN(audio_thread),audiosink); + gst_bin_add(GST_BIN(pipeline),audio_thread); + gst_element_add_ghost_pad(GST_ELEMENT(audio_thread),gst_element_get_pad(audiosink,"sink")); + + gst_element_connect(paranoia,"src",queue,"sink"); + gst_element_connect(queue,"src",audio_thread,"sink"); + + gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_PLAYING); + if (GST_STATE(paranoia) != GST_STATE_PLAYING) fprintf(stderr,"error: state not set\n"); + + while (1) { + gst_bin_iterate(GST_BIN(pipeline)); + } +}