From 3a1acca5830916612e5ab96a9a72ae17d3afaa8b Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Thu, 10 Nov 2011 23:15:30 +0200 Subject: [PATCH] controller: port api changes --- tests/examples/shapewipe/shapewipe-example.c | 6 ++---- tests/examples/v4l2/camctrl.c | 11 +++++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/tests/examples/shapewipe/shapewipe-example.c b/tests/examples/shapewipe/shapewipe-example.c index 1b2a69d..855ea40 100644 --- a/tests/examples/shapewipe/shapewipe-example.c +++ b/tests/examples/shapewipe/shapewipe-example.c @@ -63,7 +63,6 @@ main (gint argc, gchar ** argv) { GstElement *pipeline; GstElement *shapewipe; - GstController *ctrl; GstLFOControlSource *csource; GValue val = { 0, }; GMainLoop *loop; @@ -97,14 +96,14 @@ main (gint argc, gchar ** argv) 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); @@ -138,7 +137,6 @@ main (gint argc, gchar ** argv) g_main_loop_unref (loop); - g_object_unref (G_OBJECT (ctrl)); gst_object_unref (G_OBJECT (pipeline)); return 0; diff --git a/tests/examples/v4l2/camctrl.c b/tests/examples/v4l2/camctrl.c index af75d69..2819967 100644 --- a/tests/examples/v4l2/camctrl.c +++ b/tests/examples/v4l2/camctrl.c @@ -68,7 +68,7 @@ event_loop (GstElement * bin) } static void -set_program (GstController * ctrl, GstStructure * prog) +set_program (GstObject * elem, GstStructure * prog) { const GstStructure *s; GstInterpolationControlSource *cs; @@ -99,7 +99,7 @@ set_program (GstController * ctrl, GstStructure * prog) 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); @@ -124,7 +124,6 @@ main (gint argc, gchar ** argv) GstElement *bin; GstElement *src, *fmt, *enc, *sink; GstCaps *caps; - GstController *ctrl; GstStructure *prog; /* init gstreamer */ @@ -170,8 +169,8 @@ main (gint argc, gchar ** argv) } /* 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; } @@ -192,7 +191,7 @@ main (gint argc, gchar ** argv) ", 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 */ -- 2.7.4