From: Stefan Sauer Date: Fri, 30 Dec 2011 17:36:37 +0000 (+0100) Subject: controller: port to latest API changes X-Git-Tag: 1.19.3~511^2~7007 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=68c362c0e53e80de0afdec5142237fb43f267d95;p=platform%2Fupstream%2Fgstreamer.git controller: port to latest API changes --- diff --git a/tests/check/elements/volume.c b/tests/check/elements/volume.c index aac28ab..47f97f9 100644 --- a/tests/check/elements/volume.c +++ b/tests/check/elements/volume.c @@ -1710,36 +1710,24 @@ GST_END_TEST; GST_START_TEST (test_controller_usability) { GstInterpolationControlSource *csource; - GstController *c; + GstTimedValueControlSource *cs; GstElement *volume; GValue value = { 0, }; - /* note: the volume element should init the controller library for us */ volume = setup_volume (); - c = gst_controller_new (G_OBJECT (volume), "volume", NULL); - - fail_unless (GST_IS_CONTROLLER (c)); - /* 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); - gst_controller_set_control_source (c, "volume", GST_CONTROL_SOURCE (csource)); - - g_value_init (&value, G_TYPE_DOUBLE); - g_value_set_double (&value, 0.0); - gst_timed_value_control_source_set ((GstTimedValueControlSource *) csource, - 0 * GST_SECOND, &value); - g_value_set_double (&value, 1.0); - gst_timed_value_control_source_set ((GstTimedValueControlSource *) csource, - 5 * GST_SECOND, &value); - g_value_set_double (&value, 0.0); - gst_timed_value_control_source_set ((GstTimedValueControlSource *) csource, - 10 * GST_SECOND, &value); - g_value_unset (&value); - - g_object_unref (c); - g_object_unref (csource); + gst_object_set_control_source (volume, "volume", + GST_CONTROL_SOURCE (csource)); + + 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); + + gst_object_unref (csource); cleanup_volume (volume); } @@ -1749,7 +1737,6 @@ GST_END_TEST; GST_START_TEST (test_controller_processing) { GstInterpolationControlSource *csource; - GstController *c; GstElement *volume; GstBuffer *inbuffer, *outbuffer; GstCaps *caps; @@ -1759,14 +1746,10 @@ GST_START_TEST (test_controller_processing) volume = setup_volume (); - c = gst_controller_new (G_OBJECT (volume), "volume", NULL); - - fail_unless (GST_IS_CONTROLLER (c)); - csource = gst_interpolation_control_source_new (); g_object_set (csource, "mode", GST_INTERPOLATION_MODE_CUBIC, NULL); - gst_controller_set_control_source (c, "volume", GST_CONTROL_SOURCE (csource)); - g_object_unref (csource); + gst_object_set_control_source (volume, "volume", + GST_CONTROL_SOURCE (csource)); fail_unless (gst_element_set_state (volume, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, @@ -1792,8 +1775,7 @@ GST_START_TEST (test_controller_processing) fail_unless (memcmp (res, in, 4) == 0); gst_buffer_unmap (outbuffer, res, size); - g_object_unref (c); - + gst_object_unref (csource); cleanup_volume (volume); } diff --git a/tests/icles/audio-trickplay.c b/tests/icles/audio-trickplay.c index 086cf67..acdb328 100644 --- a/tests/icles/audio-trickplay.c +++ b/tests/icles/audio-trickplay.c @@ -142,14 +142,14 @@ main (gint argc, gchar ** argv) gst_timed_value_control_source_set (cs, 0 * GST_SECOND, 0.0); gst_timed_value_control_source_set (cs, 5 * GST_SECOND, 1.0); - g_object_unref (csource1); + gst_object_unref (csource1); 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); - g_object_unref (csource2); + gst_object_unref (csource2); /* prepare events */ flags = use_flush ? GST_SEEK_FLAG_FLUSH : GST_SEEK_FLAG_NONE;