mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-23 04:20:17 +00:00
ffbc7201a7
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.
42 lines
1.4 KiB
C
42 lines
1.4 KiB
C
#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));
|
|
}
|
|
}
|