{
GstElement *pipeline;
GstElement *shapewipe;
- GstController *ctrl;
GstLFOControlSource *csource;
GValue val = { 0, };
GMainLoop *loop;
shapewipe = gst_bin_get_by_name (GST_BIN (pipeline), "shape");
- if (!(ctrl = gst_controller_new (GST_OBJECT (shapewipe), "position", NULL))) {
+ if (!gst_object_control_properties (GST_OBJECT (shapewipe), "position", NULL)) {
g_print ("can't control shapewipe element\n");
return -3;
}
csource = gst_lfo_control_source_new ();
- gst_controller_set_control_source (ctrl, "position",
+ gst_object_set_control_source (GST_OBJECT (shapewipe), "position",
GST_CONTROL_SOURCE (csource));
g_value_init (&val, G_TYPE_FLOAT);
g_main_loop_unref (loop);
- g_object_unref (G_OBJECT (ctrl));
gst_object_unref (G_OBJECT (pipeline));
return 0;
}
static void
-set_program (GstController * ctrl, GstStructure * prog)
+set_program (GstObject * elem, GstStructure * prog)
{
const GstStructure *s;
GstInterpolationControlSource *cs;
cs = g_hash_table_lookup (css, name);
if (!cs) {
cs = gst_interpolation_control_source_new ();
- gst_controller_set_control_source (ctrl, name, GST_CONTROL_SOURCE (cs));
+ gst_object_set_control_source (elem, name, GST_CONTROL_SOURCE (cs));
gst_interpolation_control_source_set_interpolation_mode (cs,
GST_INTERPOLATE_NONE);
g_hash_table_insert (css, (gpointer) name, cs);
GstElement *bin;
GstElement *src, *fmt, *enc, *sink;
GstCaps *caps;
- GstController *ctrl;
GstStructure *prog;
/* init gstreamer */
}
/* get the controller */
- if (!(ctrl = gst_controller_new (GST_OBJECT (src), "brightness", "contrast",
- "saturation", NULL))) {
+ if (!gst_object_control_properties (GST_OBJECT (src), "brightness",
+ "contrast", "saturation", NULL)) {
GST_WARNING ("can't control source element");
return -1;
}
", image03=(structure)\"image\\,brightness\\=0\\,contrast\\=15\\;\";",
NULL);
#endif
- set_program (ctrl, prog);
+ set_program (GST_OBJECT (src), prog);
g_object_set (src, "num-buffers", gst_structure_n_fields (prog), NULL);
/* prepare playback */