Brand new source, the cdparanoia source. Reads audio data from a CD, writes out...
authorErik Walthinsen <omega@temple-baptist.org>
Tue, 12 Dec 2000 06:49:26 +0000 (06:49 +0000)
committerErik Walthinsen <omega@temple-baptist.org>
Tue, 12 Dec 2000 06:49:26 +0000 (06:49 +0000)
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
editor/gstelementselect.c
tests/Makefile.am
tests/paranoia.c [new file with mode: 0644]

index 91073cb..d9f045f 100644 (file)
@@ -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
index 36276dd..a137f5a 100644 (file)
@@ -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 */
index a67b1d8..22b404d 100644 (file)
@@ -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 (file)
index 0000000..44bbcd5
--- /dev/null
@@ -0,0 +1,42 @@
+#include <gst/gst.h>
+
+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));
+  }
+}