Audio transcoding works correctly. Added a bunch of cleanup functions

This commit is contained in:
Jaime Thomas
2008-06-04 01:12:34 +00:00
parent 8e69faf23e
commit 4601df797e
11 changed files with 106 additions and 14 deletions

View File

@ -71,6 +71,7 @@ main (int argc, char ** argv)
GstCaps *filtercaps;
GstPad *audiopad;
GstBus *bus;
gchar *path, *filename;
gst_init (&argc, &argv);
loop = g_main_loop_new (NULL, FALSE);
@ -113,7 +114,15 @@ main (int argc, char ** argv)
audiopad = gst_element_get_static_pad(conv, "sink");
sink = gst_element_factory_make ("filesink", NULL);
g_object_set(G_OBJECT(sink), "location", "/home/jaime/test.wav", NULL);
/* Generate filename */
filename = g_path_get_basename(argv[1]);
path = g_strconcat("/tmp/ecdb/", filename, ".wav", NULL);
g_object_set(G_OBJECT(sink), "location", path, NULL);
free(filename);
free(path);
gst_bin_add_many(GST_BIN (audio), conv, resample, filter, sink, NULL);
gst_element_link_many(conv, resample, filter, sink, NULL);
gst_element_add_pad (audio, gst_ghost_pad_new ("sink", audiopad));