summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Sauer <ensonic@users.sf.net>2012-01-31 12:28:30 +0100
committerStefan Sauer <ensonic@users.sf.net>2012-01-31 12:28:30 +0100
commitace90e6e2bc8336e2550fceac34bcc303b558fe1 (patch)
tree7059083ba91603579066319b43d9bd8a78b4f06e
parent1696b14f8f184aba9dc1ad6499caf2ec6c5def1d (diff)
controller: adapt to control-source type changes
-rw-r--r--tests/check/elements/volume.c32
-rw-r--r--tests/icles/audio-trickplay.c40
2 files changed, 34 insertions, 38 deletions
diff --git a/tests/check/elements/volume.c b/tests/check/elements/volume.c
index 04e675f9b..260c948ce 100644
--- a/tests/check/elements/volume.c
+++ b/tests/check/elements/volume.c
@@ -1695,25 +1695,24 @@ GST_END_TEST;
GST_START_TEST (test_controller_usability)
{
- GstInterpolationControlSource *csource;
- GstTimedValueControlSource *cs;
+ GstControlSource *cs;
+ GstTimedValueControlSource *tvcs;
GstElement *volume;
volume = setup_volume ();
/* this shouldn't crash, whether this mode is implemented or not */
- csource = gst_interpolation_control_source_new ();
- g_object_set (csource, "mode", GST_INTERPOLATION_MODE_CUBIC, NULL);
+ cs = gst_interpolation_control_source_new ();
+ g_object_set (cs, "mode", GST_INTERPOLATION_MODE_CUBIC, NULL);
gst_object_add_control_binding (GST_OBJECT_CAST (volume),
- gst_direct_control_binding_new (GST_OBJECT_CAST (volume), "volume",
- GST_CONTROL_SOURCE (csource)));
+ gst_direct_control_binding_new (GST_OBJECT_CAST (volume), "volume", cs));
- cs = (GstTimedValueControlSource *) csource;
- gst_timed_value_control_source_set (cs, 0 * GST_SECOND, 0.0);
- gst_timed_value_control_source_set (cs, 5 * GST_SECOND, 1.0);
- gst_timed_value_control_source_set (cs, 10 * GST_SECOND, 0.0);
+ tvcs = (GstTimedValueControlSource *) cs;
+ gst_timed_value_control_source_set (tvcs, 0 * GST_SECOND, 0.0);
+ gst_timed_value_control_source_set (tvcs, 5 * GST_SECOND, 1.0);
+ gst_timed_value_control_source_set (tvcs, 10 * GST_SECOND, 0.0);
- gst_object_unref (csource);
+ gst_object_unref (cs);
cleanup_volume (volume);
}
@@ -1722,7 +1721,7 @@ GST_END_TEST;
GST_START_TEST (test_controller_processing)
{
- GstInterpolationControlSource *csource;
+ GstControlSource *cs;
GstElement *volume;
GstBuffer *inbuffer, *outbuffer;
GstCaps *caps;
@@ -1731,11 +1730,10 @@ GST_START_TEST (test_controller_processing)
volume = setup_volume ();
- csource = gst_interpolation_control_source_new ();
- g_object_set (csource, "mode", GST_INTERPOLATION_MODE_CUBIC, NULL);
+ cs = gst_interpolation_control_source_new ();
+ g_object_set (cs, "mode", GST_INTERPOLATION_MODE_CUBIC, NULL);
gst_object_add_control_binding (GST_OBJECT_CAST (volume),
- gst_direct_control_binding_new (GST_OBJECT_CAST (volume), "volume",
- GST_CONTROL_SOURCE (csource)));
+ gst_direct_control_binding_new (GST_OBJECT_CAST (volume), "volume", cs));
fail_unless (gst_element_set_state (volume,
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
@@ -1762,7 +1760,7 @@ GST_START_TEST (test_controller_processing)
fail_unless (memcmp (map.data, in, 4) == 0);
gst_buffer_unmap (outbuffer, &map);
- gst_object_unref (csource);
+ gst_object_unref (cs);
cleanup_volume (volume);
}
diff --git a/tests/icles/audio-trickplay.c b/tests/icles/audio-trickplay.c
index 20139b896..3665faa80 100644
--- a/tests/icles/audio-trickplay.c
+++ b/tests/icles/audio-trickplay.c
@@ -49,8 +49,8 @@ main (gint argc, gchar ** argv)
gint res = 1;
GstElement *src, *mix = NULL, *sink;
GstElement *bin;
- GstInterpolationControlSource *csource1, *csource2;
- GstTimedValueControlSource *cs;
+ GstControlSource *cs1, *cs2;
+ GstTimedValueControlSource *tvcs;
GstClock *clock;
GstClockID clock_id;
GstClockReturn wait_ret;
@@ -125,34 +125,32 @@ main (gint argc, gchar ** argv)
NULL);
gst_object_unref (src_pad);
- csource1 = gst_interpolation_control_source_new ();
- csource2 = gst_interpolation_control_source_new ();
+ cs1 = gst_interpolation_control_source_new ();
+ cs2 = gst_interpolation_control_source_new ();
gst_object_add_control_binding (GST_OBJECT_CAST (src),
- gst_direct_control_binding_new (GST_OBJECT_CAST (src), "volume",
- GST_CONTROL_SOURCE (csource1)));
+ gst_direct_control_binding_new (GST_OBJECT_CAST (src), "volume", cs1));
gst_object_add_control_binding (GST_OBJECT_CAST (src),
- gst_direct_control_binding_new (GST_OBJECT_CAST (src), "freq",
- GST_CONTROL_SOURCE (csource2)));
+ gst_direct_control_binding_new (GST_OBJECT_CAST (src), "freq", cs2));
/* Set interpolation mode */
- g_object_set (csource1, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
- g_object_set (csource2, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
+ g_object_set (cs1, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
+ g_object_set (cs2, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
/* set control values */
- cs = (GstTimedValueControlSource *) csource1;
- gst_timed_value_control_source_set (cs, 0 * GST_SECOND, 0.0);
- gst_timed_value_control_source_set (cs, 5 * GST_SECOND, 1.0);
+ tvcs = (GstTimedValueControlSource *) cs1;
+ gst_timed_value_control_source_set (tvcs, 0 * GST_SECOND, 0.0);
+ gst_timed_value_control_source_set (tvcs, 5 * GST_SECOND, 1.0);
- gst_object_unref (csource1);
+ gst_object_unref (cs1);
- cs = (GstTimedValueControlSource *) csource2;
- gst_timed_value_control_source_set (cs, 0 * GST_SECOND, 20000.0 / 220.0);
- gst_timed_value_control_source_set (cs, 2 * GST_SECOND, 20000.0 / 3520.0);
- gst_timed_value_control_source_set (cs, 6 * GST_SECOND, 20000.0 / 440.0);
+ tvcs = (GstTimedValueControlSource *) cs2;
+ gst_timed_value_control_source_set (tvcs, 0 * GST_SECOND, 20000.0 / 220.0);
+ gst_timed_value_control_source_set (tvcs, 2 * GST_SECOND, 20000.0 / 3520.0);
+ gst_timed_value_control_source_set (tvcs, 6 * GST_SECOND, 20000.0 / 440.0);
- gst_object_unref (csource2);
+ gst_object_unref (cs2);
/* prepare events */
flags = use_flush ? GST_SEEK_FLAG_FLUSH : GST_SEEK_FLAG_NONE;
@@ -248,8 +246,8 @@ main (gint argc, gchar ** argv)
/* cleanup */
gst_query_unref (pos);
- gst_object_unref (G_OBJECT (clock));
- gst_object_unref (G_OBJECT (bin));
+ gst_object_unref (clock);
+ gst_object_unref (bin);
res = 0;
Error:
return (res);