tests/examples/: convert comments again

Original commit message from CVS:
* tests/examples/controller/audio-example.c: (main):
* tests/examples/launch/Makefile.am:
convert comments again
This commit is contained in:
Stefan Kost 2005-12-12 14:46:06 +00:00
parent 98522fc638
commit a84923e6cc
3 changed files with 25 additions and 12 deletions

View file

@ -1,3 +1,9 @@
2005-12-12 Stefan Kost <ensonic@users.sf.net>
* tests/examples/controller/audio-example.c: (main):
* tests/examples/launch/Makefile.am:
convert comments again
2005-12-12 Wim Taymans <wim@fluendo.com> 2005-12-12 Wim Taymans <wim@fluendo.com>
* libs/gst/base/gstpushsrc.c: * libs/gst/base/gstpushsrc.c:

View file

@ -24,7 +24,7 @@ main (gint argc, gchar ** argv)
gst_init (&argc, &argv); gst_init (&argc, &argv);
gst_controller_init (&argc, &argv); gst_controller_init (&argc, &argv);
// build pipeline /* build pipeline */
bin = gst_pipeline_new ("pipeline"); bin = gst_pipeline_new ("pipeline");
clock = gst_pipeline_get_clock (GST_PIPELINE (bin)); clock = gst_pipeline_get_clock (GST_PIPELINE (bin));
src = gst_element_factory_make ("audiotestsrc", "gen_audio"); src = gst_element_factory_make ("audiotestsrc", "gen_audio");
@ -34,44 +34,51 @@ main (gint argc, gchar ** argv)
GST_WARNING ("can't link elements"); GST_WARNING ("can't link elements");
goto Error; goto Error;
} }
// add a controller to the source
/* square wave
g_object_set (G_OBJECT(src), "wave", 1, NULL);
*/
/* add a controller to the source */
if (!(ctrl = gst_controller_new (G_OBJECT (src), "freq", "volume", NULL))) { if (!(ctrl = gst_controller_new (G_OBJECT (src), "freq", "volume", NULL))) {
GST_WARNING ("can't control source element"); GST_WARNING ("can't control source element");
goto Error; goto Error;
} }
// set interpolation
/* set interpolation */
gst_controller_set_interpolation_mode (ctrl, "volume", gst_controller_set_interpolation_mode (ctrl, "volume",
GST_INTERPOLATE_LINEAR); GST_INTERPOLATE_LINEAR);
gst_controller_set_interpolation_mode (ctrl, "freq", GST_INTERPOLATE_LINEAR); gst_controller_set_interpolation_mode (ctrl, "freq", GST_INTERPOLATE_LINEAR);
// set control values /* set control values */
g_value_init (&vol, G_TYPE_DOUBLE); g_value_init (&vol, G_TYPE_DOUBLE);
g_value_set_double (&vol, 0.0); g_value_set_double (&vol, 0.0);
gst_controller_set (ctrl, "volume", 0 * GST_SECOND, &vol); gst_controller_set (ctrl, "volume", 0 * GST_SECOND, &vol);
g_value_set_double (&vol, 1.0); g_value_set_double (&vol, 1.0);
gst_controller_set (ctrl, "volume", 5 * GST_SECOND, &vol); gst_controller_set (ctrl, "volume", 5 * GST_SECOND, &vol);
g_value_set_double (&vol, 440.0); g_value_set_double (&vol, 220.0);
gst_controller_set (ctrl, "freq", 0 * GST_SECOND, &vol); gst_controller_set (ctrl, "freq", 0 * GST_SECOND, &vol);
g_value_set_double (&vol, 3520.0); g_value_set_double (&vol, 3520.0);
gst_controller_set (ctrl, "freq", 3 * GST_SECOND, &vol); gst_controller_set (ctrl, "freq", 3 * GST_SECOND, &vol);
g_value_set_double (&vol, 880.0); g_value_set_double (&vol, 440.0);
gst_controller_set (ctrl, "freq", 6 * GST_SECOND, &vol); gst_controller_set (ctrl, "freq", 6 * GST_SECOND, &vol);
clock_id = clock_id =
gst_clock_new_single_shot_id (clock, gst_clock_new_single_shot_id (clock,
gst_clock_get_time (clock) + (7 * GST_SECOND)); gst_clock_get_time (clock) + (7 * GST_SECOND));
// run for 7 seconds /* run for 7 seconds */
if (gst_element_set_state (bin, GST_STATE_PLAYING)) { if (gst_element_set_state (bin, GST_STATE_PLAYING)) {
if ((wait_ret = gst_clock_id_wait (clock_id, NULL)) != GST_CLOCK_OK) { if ((wait_ret = gst_clock_id_wait (clock_id, NULL)) != GST_CLOCK_OK) {
GST_WARNING ("clock_id_wait returned: %d", wait_ret); GST_WARNING ("clock_id_wait returned: %d", wait_ret);
} }
gst_element_set_state (bin, GST_STATE_NULL); gst_element_set_state (bin, GST_STATE_NULL);
} }
// cleanup
/* cleanup */
g_object_unref (G_OBJECT (ctrl)); g_object_unref (G_OBJECT (ctrl));
g_object_unref (G_OBJECT (clock)); gst_object_unref (G_OBJECT (clock));
g_object_unref (G_OBJECT (bin)); gst_object_unref (G_OBJECT (bin));
res = 0; res = 0;
Error: Error:
return (res); return (res);

View file

@ -3,5 +3,5 @@ noinst_PROGRAMS = mp3parselaunch
mp3parselaunch_LDADD = $(GST_OBJ_LIBS) mp3parselaunch_LDADD = $(GST_OBJ_LIBS)
mp3parselaunch_CFLAGS = $(GST_OBJ_CFLAGS) mp3parselaunch_CFLAGS = $(GST_OBJ_CFLAGS)
noinst_SCRIPTS = mp3play #noinst_SCRIPTS = mp3play
EXTRA_DIST = mp3play #EXTRA_DIST = mp3play