controller: port controller api changes

This commit is contained in:
Stefan Sauer 2011-11-10 23:02:35 +02:00
parent e338792ab0
commit e32ccd8e4e
2 changed files with 6 additions and 6 deletions

View file

@ -268,7 +268,8 @@ volume_update_volume (GstVolume * self, gfloat volume, gboolean mute)
* because the property can change from 1.0 to something * because the property can change from 1.0 to something
* else in the middle of a buffer. * else in the middle of a buffer.
*/ */
passthrough &= gst_object_has_active_automation (GST_OBJECT (self)); passthrough &=
!gst_object_has_active_controlled_properties (GST_OBJECT (self));
GST_DEBUG_OBJECT (self, "set passthrough %d", passthrough); GST_DEBUG_OBJECT (self, "set passthrough %d", passthrough);

View file

@ -15,6 +15,7 @@
* GST_DEBUG_NO_COLOR=1 GST_DEBUG="*:2,default:3,*sink*:4,*ring*:4,*pulse*:5" ./audio-trickplay -a -f 2>log-af.txt * GST_DEBUG_NO_COLOR=1 GST_DEBUG="*:2,default:3,*sink*:4,*ring*:4,*pulse*:5" ./audio-trickplay -a -f 2>log-af.txt
*/ */
#include <string.h>
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/controller/gstinterpolationcontrolsource.h> #include <gst/controller/gstinterpolationcontrolsource.h>
@ -47,7 +48,6 @@ main (gint argc, gchar ** argv)
gint res = 1; gint res = 1;
GstElement *src, *mix = NULL, *sink; GstElement *src, *mix = NULL, *sink;
GstElement *bin; GstElement *bin;
GstController *ctrl;
GstInterpolationControlSource *csource1, *csource2; GstInterpolationControlSource *csource1, *csource2;
GstClock *clock; GstClock *clock;
GstClockID clock_id; GstClockID clock_id;
@ -125,7 +125,7 @@ main (gint argc, gchar ** argv)
gst_object_unref (src_pad); gst_object_unref (src_pad);
/* add a controller to the source */ /* add a controller to the source */
if (!(ctrl = gst_controller_new (GST_OBJECT (src), "freq", "volume", NULL))) { if (!gst_object_control_properties (GST_OBJECT (src), "freq", "volume", NULL)) {
GST_WARNING ("can't control source element"); GST_WARNING ("can't control source element");
goto Error; goto Error;
} }
@ -133,9 +133,9 @@ main (gint argc, gchar ** argv)
csource1 = gst_interpolation_control_source_new (); csource1 = gst_interpolation_control_source_new ();
csource2 = gst_interpolation_control_source_new (); csource2 = gst_interpolation_control_source_new ();
gst_controller_set_control_source (ctrl, "volume", gst_object_set_control_source (GST_OBJECT (src), "volume",
GST_CONTROL_SOURCE (csource1)); GST_CONTROL_SOURCE (csource1));
gst_controller_set_control_source (ctrl, "freq", gst_object_set_control_source (GST_OBJECT (src), "freq",
GST_CONTROL_SOURCE (csource2)); GST_CONTROL_SOURCE (csource2));
/* Set interpolation mode */ /* Set interpolation mode */
@ -257,7 +257,6 @@ main (gint argc, gchar ** argv)
/* cleanup */ /* cleanup */
gst_query_unref (pos); gst_query_unref (pos);
g_object_unref (G_OBJECT (ctrl));
gst_object_unref (G_OBJECT (clock)); gst_object_unref (G_OBJECT (clock));
gst_object_unref (G_OBJECT (bin)); gst_object_unref (G_OBJECT (bin));
res = 0; res = 0;