From: Thomas Vander Stichele Date: Fri, 15 Jun 2001 16:42:12 +0000 (+0000) Subject: added some minor stuff X-Git-Tag: BRANCH-GOBJECT1-200106241-ROOT~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=710fb2ad9f2fdf24308e60e282f008fc7bca5f6a;p=platform%2Fupstream%2Fgstreamer.git added some minor stuff Original commit message from CVS: added some minor stuff --- diff --git a/examples/cutter/cutter.c b/examples/cutter/cutter.c index c9cfe0f..7062722 100644 --- a/examples/cutter/cutter.c +++ b/examples/cutter/cutter.c @@ -12,6 +12,7 @@ #include #include #include +#include #define DEBUG @@ -41,7 +42,16 @@ void cut_start (GstElement *element) gst_element_set_state (main_bin, GST_STATE_PAUSED); g_print ("DEBUG: cut_start: main_bin paused\n"); - sprintf (buffer, "/tmp/test%d.wav", id); + { + long seconds; + struct tm *ct; + time (&seconds); + ct = localtime (&seconds); +// sprintf (buffer, "/news/incoming/audio/cutter.%06d.wav", id); + sprintf (buffer, "/news/incoming/audio/cutter.%04d%02d%02d.%02d%02d%02d.wav", + ct->tm_year + 1900, ct->tm_mon, ct->tm_mday, + ct->tm_hour, ct->tm_min, ct->tm_sec); + } g_print ("DEBUG: cut_start: setting new location to %s\n", buffer); gtk_object_set (GTK_OBJECT (disksink), "location", buffer, NULL); gtk_object_set (GTK_OBJECT (disksink), "type", 4, NULL); @@ -107,8 +117,8 @@ int main (int argc, char *argv[]) cutter = gst_elementfactory_make ("cutter", "cutter"); gtk_object_set (GTK_OBJECT (cutter), - "threshold_dB", -60.0, - "runlength", 2.0, + "threshold_dB", -40.0, + "runlength", 0.5, NULL); /* create an audio src */ @@ -117,7 +127,7 @@ int main (int argc, char *argv[]) /* set params */ gtk_object_set (GTK_OBJECT (audiosrc), "frequency", 44100, - "channels", 2, + "channels", 1, "format", 16, NULL); encoder = gst_elementfactory_make ("passthrough", "encoder"); @@ -172,9 +182,9 @@ int main (int argc, char *argv[]) */ while (playing) { - g_print ("> "); +// g_print ("> "); gst_bin_iterate (GST_BIN (main_bin)); - g_print (" <"); +// g_print (" <"); if (cut_start_signalled) { g_print ("\nDEBUG: main: cut_start_signalled true !\n"); diff --git a/tests/old/examples/cutter/cutter.c b/tests/old/examples/cutter/cutter.c index c9cfe0f..7062722 100644 --- a/tests/old/examples/cutter/cutter.c +++ b/tests/old/examples/cutter/cutter.c @@ -12,6 +12,7 @@ #include #include #include +#include #define DEBUG @@ -41,7 +42,16 @@ void cut_start (GstElement *element) gst_element_set_state (main_bin, GST_STATE_PAUSED); g_print ("DEBUG: cut_start: main_bin paused\n"); - sprintf (buffer, "/tmp/test%d.wav", id); + { + long seconds; + struct tm *ct; + time (&seconds); + ct = localtime (&seconds); +// sprintf (buffer, "/news/incoming/audio/cutter.%06d.wav", id); + sprintf (buffer, "/news/incoming/audio/cutter.%04d%02d%02d.%02d%02d%02d.wav", + ct->tm_year + 1900, ct->tm_mon, ct->tm_mday, + ct->tm_hour, ct->tm_min, ct->tm_sec); + } g_print ("DEBUG: cut_start: setting new location to %s\n", buffer); gtk_object_set (GTK_OBJECT (disksink), "location", buffer, NULL); gtk_object_set (GTK_OBJECT (disksink), "type", 4, NULL); @@ -107,8 +117,8 @@ int main (int argc, char *argv[]) cutter = gst_elementfactory_make ("cutter", "cutter"); gtk_object_set (GTK_OBJECT (cutter), - "threshold_dB", -60.0, - "runlength", 2.0, + "threshold_dB", -40.0, + "runlength", 0.5, NULL); /* create an audio src */ @@ -117,7 +127,7 @@ int main (int argc, char *argv[]) /* set params */ gtk_object_set (GTK_OBJECT (audiosrc), "frequency", 44100, - "channels", 2, + "channels", 1, "format", 16, NULL); encoder = gst_elementfactory_make ("passthrough", "encoder"); @@ -172,9 +182,9 @@ int main (int argc, char *argv[]) */ while (playing) { - g_print ("> "); +// g_print ("> "); gst_bin_iterate (GST_BIN (main_bin)); - g_print (" <"); +// g_print (" <"); if (cut_start_signalled) { g_print ("\nDEBUG: main: cut_start_signalled true !\n");