Commit c227d51f authored by Stefan Sauer's avatar Stefan Sauer

controller: remove convenience api for control sources

This is needed to support multiple kinds of control-bindings.
parent c6ac51e7
......@@ -1487,8 +1487,6 @@ gst_object_set_control_bindings_disabled
gst_object_set_control_binding_disabled
gst_object_set_control_binding
gst_object_get_control_binding
gst_object_get_control_source
gst_object_set_control_source
gst_object_get_value
gst_object_get_value_array
gst_object_get_control_rate
......
......@@ -45,8 +45,8 @@ static void gst_control_binding_finalize (GObject * object);
GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "gstcontrolbinding", 0, \
"dynamic parameter control source attachment");
G_DEFINE_TYPE_WITH_CODE (GstControlBinding, gst_control_binding, G_TYPE_OBJECT,
_do_init);
G_DEFINE_TYPE_WITH_CODE (GstControlBinding, gst_control_binding,
GST_TYPE_OBJECT, _do_init);
static void
gst_control_binding_class_init (GstControlBindingClass * klass)
......@@ -364,8 +364,6 @@ gst_control_binding_get_value_array (GstControlBinding * self,
return res;
}
/**
* gst_control_binding_get_control_source:
* @self: the control binding
......
......@@ -64,7 +64,7 @@ typedef void (* GstControlBindingConvert) (GstControlBinding *self, gdouble src_
* The instance structure of #GstControlBinding.
*/
struct _GstControlBinding {
GObject parent;
GstObject parent;
/*< public >*/
const gchar *name; /* name of the property */
......@@ -91,7 +91,13 @@ struct _GstControlBinding {
struct _GstControlBindingClass
{
GObjectClass parent_class;
GstObjectClass parent_class;
/* need vfuncs for:
_sync_values
_get_value
_get_value_array
*/
/*< private >*/
gpointer _gst_reserved[GST_PADDING];
......
......@@ -117,7 +117,7 @@
* </para></listitem>
* <listitem><para>
* Attach the #GstControlSource on the controller to a property.
* gst_object_set_control_source (object, "prop1", csource);
* gst_object_set_control_binding (object, gst_control_binding_new (objetct, "prop1", csource));
* </para></listitem>
* <listitem><para>
* Set the control values
......@@ -1269,86 +1269,6 @@ gst_object_get_control_binding (GstObject * object, const gchar * property_name)
return binding;
}
/**
* gst_object_set_control_source:
* @object: the controller object
* @property_name: name of the property for which the #GstControlSource should be set
* @csource: the #GstControlSource that should be used for the property
*
* Sets the #GstControlSource for @property_name. If there already was a #GstControlSource
* for this property it will be unreferenced.
*
* This is a convenience function for gst_object_set_control_binding().
*
* Returns: %FALSE if the given property isn't handled by the controller or the new #GstControlSource
* couldn't be bound to the property, %TRUE if everything worked as expected.
*/
gboolean
gst_object_set_control_source (GstObject * object, const gchar * property_name,
GstControlSource * csource)
{
GstControlBinding *binding;
gboolean ret = FALSE;
g_return_val_if_fail (GST_IS_OBJECT (object), FALSE);
g_return_val_if_fail (property_name, FALSE);
g_return_val_if_fail ((!csource || GST_IS_CONTROL_SOURCE (csource)), FALSE);
GST_OBJECT_LOCK (object);
if ((binding = gst_object_find_control_binding (object, property_name))) {
object->control_bindings =
g_list_remove (object->control_bindings, binding);
g_object_unref (binding);
GST_DEBUG_OBJECT (object, "controlled property %s removed", property_name);
ret = TRUE;
}
if (csource) {
if ((binding = gst_control_binding_new (object, property_name, csource))) {
object->control_bindings =
g_list_prepend (object->control_bindings, binding);
GST_DEBUG_OBJECT (object, "controlled property %s added", property_name);
ret = TRUE;
} else {
ret = FALSE;
}
}
GST_OBJECT_UNLOCK (object);
return ret;
}
/**
* gst_object_get_control_source:
* @object: the object
* @property_name: name of the property
*
* Gets the corresponding #GstControlSource for the property. This should be
* unreferenced again after use.
*
* This is a convenience function for gst_object_get_control_binding().
*
* Returns: (transfer full): the #GstControlSource for @property_name or %NULL if
* the property is not controlled.
*/
GstControlSource *
gst_object_get_control_source (GstObject * object, const gchar * property_name)
{
GstControlBinding *binding;
GstControlSource *ret = NULL;
g_return_val_if_fail (GST_IS_OBJECT (object), NULL);
g_return_val_if_fail (property_name, NULL);
GST_OBJECT_LOCK (object);
if ((binding = gst_object_find_control_binding (object, property_name))) {
ret = gst_control_binding_get_control_source (binding);
}
GST_OBJECT_UNLOCK (object);
return ret;
}
/**
* gst_object_get_value:
* @object: the object that has controlled properties
......
......@@ -248,11 +248,6 @@ gboolean gst_object_set_control_binding (GstObject * object, GstControlB
GstControlBinding *
gst_object_get_control_binding (GstObject *object, const gchar * property_name);
gboolean gst_object_set_control_source (GstObject *object, const gchar * property_name,
GstControlSource *csource);
GstControlSource *
gst_object_get_control_source (GstObject *object, const gchar * property_name);
GValue * gst_object_get_value (GstObject * object, const gchar * property_name,
GstClockTime timestamp);
gboolean gst_object_get_value_array (GstObject * object, const gchar * property_name,
......
......@@ -111,8 +111,9 @@ main (gint argc, gchar * argv[])
/* create and configure control source */
csource = gst_interpolation_control_source_new ();
gst_object_set_control_source (GST_OBJECT (src), "freq",
GST_CONTROL_SOURCE (csource));
gst_object_set_control_binding (GST_OBJECT (src),
gst_control_binding_new (GST_OBJECT (src), "freq",
GST_CONTROL_SOURCE (csource)));
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
......
......@@ -322,15 +322,15 @@ GST_START_TEST (controller_new_fail1)
{
GstElement *elem;
GstTestControlSource *cs;
gboolean res;
GstControlBinding *cb;
elem = gst_element_factory_make ("fakesrc", NULL);
cs = gst_test_control_source_new ();
/* that property should not exist */
res = gst_object_set_control_source (GST_OBJECT (elem), "_schrompf_",
cb = gst_control_binding_new (GST_OBJECT (elem), "_schrompf_",
GST_CONTROL_SOURCE (cs));
fail_unless (res == FALSE, NULL);
fail_unless (cb == NULL, NULL);
gst_object_unref (cs);
gst_object_unref (elem);
......@@ -343,15 +343,15 @@ GST_START_TEST (controller_new_fail2)
{
GstElement *elem;
GstTestControlSource *cs;
gboolean res;
GstControlBinding *cb;
elem = gst_element_factory_make ("testobj", NULL);
cs = gst_test_control_source_new ();
/* that property should exist and but is readonly */
ASSERT_CRITICAL (res = gst_object_set_control_source (GST_OBJECT (elem),
ASSERT_CRITICAL (cb = gst_control_binding_new (GST_OBJECT (elem),
"readonly", GST_CONTROL_SOURCE (cs)));
fail_unless (res == FALSE, NULL);
fail_unless (cb == NULL, NULL);
gst_object_unref (cs);
gst_object_unref (elem);
......@@ -364,15 +364,15 @@ GST_START_TEST (controller_new_fail3)
{
GstElement *elem;
GstTestControlSource *cs;
gboolean res;
GstControlBinding *cb;
elem = gst_element_factory_make ("testobj", NULL);
cs = gst_test_control_source_new ();
/* that property should exist and but is not controlable */
ASSERT_CRITICAL (res = gst_object_set_control_source (GST_OBJECT (elem),
ASSERT_CRITICAL (cb = gst_control_binding_new (GST_OBJECT (elem),
"static", GST_CONTROL_SOURCE (cs)));
fail_unless (res == FALSE, NULL);
fail_unless (cb == NULL, NULL);
gst_object_unref (cs);
gst_object_unref (elem);
......@@ -385,16 +385,16 @@ GST_START_TEST (controller_new_fail4)
{
GstElement *elem;
GstTestControlSource *cs;
gboolean res;
GstControlBinding *cb;
elem = gst_element_factory_make ("testobj", NULL);
cs = gst_test_control_source_new ();
/* that property should exist and but is construct-only */
ASSERT_CRITICAL (res =
gst_object_set_control_source (GST_OBJECT (elem), "construct-only",
ASSERT_CRITICAL (cb =
gst_control_binding_new (GST_OBJECT (elem), "construct-only",
GST_CONTROL_SOURCE (cs)));
fail_unless (res == FALSE, NULL);
fail_unless (cb == NULL, NULL);
gst_object_unref (cs);
gst_object_unref (elem);
......@@ -408,16 +408,17 @@ GST_START_TEST (controller_new_okay1)
{
GstElement *elem;
GstTestControlSource *cs;
gboolean res;
GstControlBinding *cb;
elem = gst_element_factory_make ("testobj", NULL);
cs = gst_test_control_source_new ();
/* that property should exist and should be controllable */
res = gst_object_set_control_source (GST_OBJECT (elem), "int",
cb = gst_control_binding_new (GST_OBJECT (elem), "int",
GST_CONTROL_SOURCE (cs));
fail_unless (res == TRUE, NULL);
fail_unless (cb != NULL, NULL);
gst_object_unref (cb);
gst_object_unref (cs);
gst_object_unref (elem);
}
......@@ -429,21 +430,23 @@ GST_START_TEST (controller_new_okay2)
{
GstElement *elem;
GstTestControlSource *cs1, *cs2;
gboolean res;
GstControlBinding *cb1, *cb2;
elem = gst_element_factory_make ("testobj", NULL);
cs1 = gst_test_control_source_new ();
cs2 = gst_test_control_source_new ();
/* these properties should exist and should be controllable */
res = gst_object_set_control_source (GST_OBJECT (elem), "int",
cb1 = gst_control_binding_new (GST_OBJECT (elem), "int",
GST_CONTROL_SOURCE (cs1));
fail_unless (res == TRUE, NULL);
fail_unless (cb1 != NULL, NULL);
res = gst_object_set_control_source (GST_OBJECT (elem), "boolean",
cb2 = gst_control_binding_new (GST_OBJECT (elem), "boolean",
GST_CONTROL_SOURCE (cs2));
fail_unless (res == TRUE, NULL);
fail_unless (cb2 != NULL, NULL);
gst_object_unref (cb1);
gst_object_unref (cb2);
gst_object_unref (cs1);
gst_object_unref (cs2);
gst_object_unref (elem);
......@@ -456,30 +459,35 @@ GST_START_TEST (controller_param_twice)
{
GstElement *elem;
GstTestControlSource *cs;
GstControlBinding *cb;
gboolean res;
elem = gst_element_factory_make ("testobj", NULL);
cs = gst_test_control_source_new ();
/* that property should exist and should be controllable */
res = gst_object_set_control_source (GST_OBJECT (elem), "int",
cb = gst_control_binding_new (GST_OBJECT (elem), "int",
GST_CONTROL_SOURCE (cs));
fail_unless (cb != NULL, NULL);
res = gst_object_set_control_binding (GST_OBJECT (elem), cb);
fail_unless (res, NULL);
/* setting it again will just unset the old and set it again
* this might cause some trouble with binding the control source again
*/
res = gst_object_set_control_source (GST_OBJECT (elem), "int",
GST_CONTROL_SOURCE (cs));
res = gst_object_set_control_binding (GST_OBJECT (elem), cb);
fail_unless (res, NULL);
#if 0 /* FIXME(ensonic): need new API */
/* it should have been added at least once, let remove it */
res = gst_object_set_control_source (GST_OBJECT (elem), "int", NULL);
res = gst_object_remove_control_binding (GST_OBJECT (elem), "int");
fail_unless (res, NULL);
/* removing it again should not work */
res = gst_object_set_control_source (GST_OBJECT (elem), "int", NULL);
res = gst_object_remove_control_binding (GST_OBJECT (elem), "int");
fail_unless (!res, NULL);
#endif
gst_object_unref (cs);
gst_object_unref (elem);
......@@ -509,24 +517,32 @@ GST_END_TEST;
GST_START_TEST (controller_controlsource_refcounts)
{
GstElement *elem;
GstControlSource *csource, *test_csource;
GstControlBinding *cb, *test_cb;
GstControlSource *cs, *test_cs;
elem = gst_element_factory_make ("testobj", NULL);
csource = (GstControlSource *) gst_test_control_source_new ();
fail_unless (csource != NULL, NULL);
cs = (GstControlSource *) gst_test_control_source_new ();
fail_unless (cs != NULL, NULL);
fail_unless_equals_int (G_OBJECT (csource)->ref_count, 1);
fail_unless (gst_object_set_control_source (GST_OBJECT (elem), "int",
csource));
fail_unless_equals_int (G_OBJECT (csource)->ref_count, 2);
fail_unless_equals_int (G_OBJECT (cs)->ref_count, 1);
test_csource = gst_object_get_control_source (GST_OBJECT (elem), "int");
fail_unless (test_csource != NULL, NULL);
fail_unless (test_csource == csource);
fail_unless_equals_int (G_OBJECT (csource)->ref_count, 3);
gst_object_unref (test_csource);
gst_object_unref (csource);
cb = gst_control_binding_new (GST_OBJECT (elem), "int", cs);
fail_unless (cb != NULL, NULL);
fail_unless_equals_int (G_OBJECT (cs)->ref_count, 2);
fail_unless (gst_object_set_control_binding (GST_OBJECT (elem), cb));
test_cb = gst_object_get_control_binding (GST_OBJECT (elem), "int");
fail_unless (test_cb != NULL, NULL);
test_cs = gst_control_binding_get_control_source (cb);
fail_unless (test_cs != NULL, NULL);
fail_unless (test_cs == cs);
fail_unless_equals_int (G_OBJECT (cs)->ref_count, 3);
gst_object_unref (test_cs);
gst_object_unref (test_cb);
gst_object_unref (cs);
gst_object_unref (cb);
gst_object_unref (elem);
}
......@@ -537,20 +553,22 @@ GST_END_TEST;
GST_START_TEST (controller_bind_twice)
{
GstElement *elem;
GstControlSource *csource;
GstControlSource *cs;
GstControlBinding *cb1, *cb2;
elem = gst_element_factory_make ("testobj", NULL);
csource = (GstControlSource *) gst_test_control_source_new ();
fail_unless (csource != NULL, NULL);
cs = (GstControlSource *) gst_test_control_source_new ();
fail_unless (cs != NULL, NULL);
fail_unless (gst_object_set_control_source (GST_OBJECT (elem), "int",
csource));
fail_unless (gst_object_set_control_source (GST_OBJECT (elem), "double",
csource));
gst_object_unref (csource);
cb1 = gst_control_binding_new (GST_OBJECT (elem), "int", cs);
fail_unless (cb1 != NULL, NULL);
cb2 = gst_control_binding_new (GST_OBJECT (elem), "double", cs);
fail_unless (cb2 != NULL, NULL);
gst_object_unref (cb1);
gst_object_unref (cb2);
gst_object_unref (cs);
gst_object_unref (elem);
}
......@@ -567,8 +585,9 @@ GST_START_TEST (controller_sync1)
csource = gst_test_control_source_new ();
fail_unless (csource != NULL, NULL);
fail_unless (gst_object_set_control_source (GST_OBJECT (elem), "int",
(GstControlSource *) csource));
fail_unless (gst_object_set_control_binding (GST_OBJECT (elem),
gst_control_binding_new (GST_OBJECT (elem), "int",
(GstControlSource *) csource)));
csource->value = 0.5;
fail_unless (gst_object_sync_values (GST_OBJECT (elem), 0LL));
......@@ -592,10 +611,12 @@ GST_START_TEST (controller_sync2)
csource = gst_test_control_source_new ();
fail_unless (csource != NULL, NULL);
fail_unless (gst_object_set_control_source (GST_OBJECT (elem), "int",
(GstControlSource *) csource));
fail_unless (gst_object_set_control_source (GST_OBJECT (elem), "double",
(GstControlSource *) csource));
fail_unless (gst_object_set_control_binding (GST_OBJECT (elem),
gst_control_binding_new (GST_OBJECT (elem), "int",
(GstControlSource *) csource)));
fail_unless (gst_object_set_control_binding (GST_OBJECT (elem),
gst_control_binding_new (GST_OBJECT (elem), "double",
(GstControlSource *) csource)));
csource->value = 0.5;
fail_unless (gst_object_sync_values (GST_OBJECT (elem), 0LL));
......
......@@ -285,8 +285,9 @@ GST_START_TEST (controller_controlsource_empty1)
csource = (GstControlSource *) gst_interpolation_control_source_new ();
fail_unless (csource != NULL, NULL);
fail_unless (gst_object_set_control_source (GST_OBJECT (elem), "int",
csource));
fail_unless (gst_object_set_control_binding (GST_OBJECT (elem),
gst_control_binding_new (GST_OBJECT (elem), "int",
(GstControlSource *) csource)));
/* don't fail on empty control point lists */
gst_object_sync_values (GST_OBJECT (elem), 0 * GST_SECOND);
......@@ -310,8 +311,9 @@ GST_START_TEST (controller_controlsource_empty2)
csource = gst_interpolation_control_source_new ();
fail_unless (csource != NULL, NULL);
fail_unless (gst_object_set_control_source (GST_OBJECT (elem), "int",
(GstControlSource *) csource));
fail_unless (gst_object_set_control_binding (GST_OBJECT (elem),
gst_control_binding_new (GST_OBJECT (elem), "int",
(GstControlSource *) csource)));
/* set control values */
cs = (GstTimedValueControlSource *) csource;
......@@ -347,7 +349,8 @@ GST_START_TEST (controller_interpolation_none)
cs = (GstControlSource *) csource;
fail_unless (csource != NULL);
fail_unless (gst_object_set_control_source (GST_OBJECT (elem), "int", cs));
fail_unless (gst_object_set_control_binding (GST_OBJECT (elem),
gst_control_binding_new (GST_OBJECT (elem), "int", cs)));
/* set interpolation mode */
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_NONE, NULL);
......@@ -398,7 +401,8 @@ GST_START_TEST (controller_interpolation_linear)
cs = (GstControlSource *) csource;
fail_unless (csource != NULL);
fail_unless (gst_object_set_control_source (GST_OBJECT (elem), "int", cs));
fail_unless (gst_object_set_control_binding (GST_OBJECT (elem),
gst_control_binding_new (GST_OBJECT (elem), "int", cs)));
/* set interpolation mode */
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
......@@ -437,7 +441,8 @@ GST_START_TEST (controller_interpolation_cubic)
cs = (GstControlSource *) csource;
fail_unless (csource != NULL);
fail_unless (gst_object_set_control_source (GST_OBJECT (elem), "double", cs));
fail_unless (gst_object_set_control_binding (GST_OBJECT (elem),
gst_control_binding_new (GST_OBJECT (elem), "double", cs)));
/* set interpolation mode */
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_CUBIC, NULL);
......@@ -485,7 +490,8 @@ GST_START_TEST (controller_interpolation_cubic_too_few_cp)
cs = (GstControlSource *) csource;
fail_unless (csource != NULL);
fail_unless (gst_object_set_control_source (GST_OBJECT (elem), "double", cs));
fail_unless (gst_object_set_control_binding (GST_OBJECT (elem),
gst_control_binding_new (GST_OBJECT (elem), "double", cs)));
/* set interpolation mode */
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_CUBIC, NULL);
......@@ -526,7 +532,8 @@ GST_START_TEST (controller_interpolation_unset)
cs = (GstControlSource *) csource;
fail_unless (csource != NULL);
fail_unless (gst_object_set_control_source (GST_OBJECT (elem), "int", cs));
fail_unless (gst_object_set_control_binding (GST_OBJECT (elem),
gst_control_binding_new (GST_OBJECT (elem), "int", cs)));
/* set interpolation mode */
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_NONE, NULL);
......@@ -581,7 +588,8 @@ GST_START_TEST (controller_interpolation_unset_all)
cs = (GstControlSource *) csource;
fail_unless (csource != NULL);
fail_unless (gst_object_set_control_source (GST_OBJECT (elem), "int", cs));
fail_unless (gst_object_set_control_binding (GST_OBJECT (elem),
gst_control_binding_new (GST_OBJECT (elem), "int", cs)));
/* set interpolation mode */
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_NONE, NULL);
......@@ -628,7 +636,8 @@ GST_START_TEST (controller_interpolation_linear_value_array)
cs = (GstControlSource *) csource;
fail_unless (csource != NULL);
fail_unless (gst_object_set_control_source (GST_OBJECT (elem), "int", cs));
fail_unless (gst_object_set_control_binding (GST_OBJECT (elem),
gst_control_binding_new (GST_OBJECT (elem), "int", cs)));
/* set interpolation mode */
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
......@@ -681,7 +690,8 @@ GST_START_TEST (controller_interpolation_linear_invalid_values)
cs = (GstControlSource *) csource;
fail_unless (csource != NULL);
fail_unless (gst_object_set_control_source (GST_OBJECT (elem), "float", cs));
fail_unless (gst_object_set_control_binding (GST_OBJECT (elem),
gst_control_binding_new (GST_OBJECT (elem), "float", cs)));
/* set interpolation mode */
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
......@@ -732,7 +742,8 @@ GST_START_TEST (controller_interpolation_linear_default_values)
cs = (GstControlSource *) csource;
fail_unless (csource != NULL);
fail_unless (gst_object_set_control_source (GST_OBJECT (elem), "int", cs));
fail_unless (gst_object_set_control_binding (GST_OBJECT (elem),
gst_control_binding_new (GST_OBJECT (elem), "int", cs)));
/* set interpolation mode */
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
......@@ -802,10 +813,11 @@ GST_START_TEST (controller_interpolation_linear_disabled)
cs2 = (GstControlSource *) csource2;
fail_unless (csource1 != NULL);
fail_unless (gst_object_set_control_source (GST_OBJECT (elem), "int", cs1));
fail_unless (gst_object_set_control_binding (GST_OBJECT (elem),
gst_control_binding_new (GST_OBJECT (elem), "int", cs1)));
fail_unless (csource2 != NULL);
fail_unless (gst_object_set_control_source (GST_OBJECT (elem), "double",
cs2));
fail_unless (gst_object_set_control_binding (GST_OBJECT (elem),
gst_control_binding_new (GST_OBJECT (elem), "double", cs2)));
/* set interpolation mode */
g_object_set (csource1, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
......@@ -926,7 +938,8 @@ GST_START_TEST (controller_interpolation_set_from_list)
cs = (GstControlSource *) csource;
fail_unless (csource != NULL);
fail_unless (gst_object_set_control_source (GST_OBJECT (elem), "int", cs));
fail_unless (gst_object_set_control_binding (GST_OBJECT (elem),
gst_control_binding_new (GST_OBJECT (elem), "int", cs)));
/* set interpolation mode */
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
......@@ -970,7 +983,8 @@ GST_START_TEST (controller_interpolation_linear_before_ts0)
cs = (GstControlSource *) csource;
fail_unless (csource != NULL);
fail_unless (gst_object_set_control_source (GST_OBJECT (elem), "int", cs));
fail_unless (gst_object_set_control_binding (GST_OBJECT (elem),
gst_control_binding_new (GST_OBJECT (elem), "int", cs)));
/* set interpolation mode */
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
......@@ -1016,7 +1030,8 @@ GST_START_TEST (controller_interpolation_linear_enums)
cs = (GstControlSource *) csource;
fail_unless (csource != NULL);
fail_unless (gst_object_set_control_source (GST_OBJECT (elem), "enum", cs));
fail_unless (gst_object_set_control_binding (GST_OBJECT (elem),
gst_control_binding_new (GST_OBJECT (elem), "enum", cs)));
/* set interpolation mode */
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL);
......@@ -1059,7 +1074,8 @@ GST_START_TEST (controller_timed_value_count)
cs = (GstControlSource *) csource;
fail_unless (csource != NULL);
fail_unless (gst_object_set_control_source (GST_OBJECT (elem), "int", cs));
fail_unless (gst_object_set_control_binding (GST_OBJECT (elem),
gst_control_binding_new (GST_OBJECT (elem), "int", cs)));
/* set interpolation mode */
g_object_set (csource, "mode", GST_INTERPOLATION_MODE_NONE, NULL);
......@@ -1099,7 +1115,8 @@ GST_START_TEST (controller_lfo_sine)
cs = (GstControlSource *) csource;
fail_unless (csource != NULL);
fail_unless (gst_object_set_control_source (GST_OBJECT (elem), "int", cs));
fail_unless (gst_object_set_control_binding (GST_OBJECT (elem),
gst_control_binding_new (GST_OBJECT (elem), "int", cs)));