mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 23:18:52 +00:00
controller: adapt to control-source type changes
This commit is contained in:
parent
80494c6318
commit
e83c53790f
2 changed files with 9 additions and 17 deletions
|
@ -64,8 +64,7 @@ main (gint argc, gchar ** argv)
|
||||||
{
|
{
|
||||||
GstElement *pipeline;
|
GstElement *pipeline;
|
||||||
GstElement *shapewipe;
|
GstElement *shapewipe;
|
||||||
GstLFOControlSource *csource;
|
GstControlSource *cs;
|
||||||
GValue val = { 0, };
|
|
||||||
GMainLoop *loop;
|
GMainLoop *loop;
|
||||||
GstBus *bus;
|
GstBus *bus;
|
||||||
gchar *pipeline_string;
|
gchar *pipeline_string;
|
||||||
|
@ -97,23 +96,17 @@ main (gint argc, gchar ** argv)
|
||||||
|
|
||||||
shapewipe = gst_bin_get_by_name (GST_BIN (pipeline), "shape");
|
shapewipe = gst_bin_get_by_name (GST_BIN (pipeline), "shape");
|
||||||
|
|
||||||
csource = gst_lfo_control_source_new ();
|
cs = gst_lfo_control_source_new ();
|
||||||
|
|
||||||
gst_object_add_control_binding (GST_OBJECT_CAST (shapewipe),
|
gst_object_add_control_binding (GST_OBJECT_CAST (shapewipe),
|
||||||
gst_direct_control_binding_new (GST_OBJECT_CAST (shapewipe), "position",
|
gst_direct_control_binding_new (GST_OBJECT_CAST (shapewipe), "position",
|
||||||
GST_CONTROL_SOURCE (csource)));
|
cs));
|
||||||
|
|
||||||
g_value_init (&val, G_TYPE_FLOAT);
|
g_object_set (cs,
|
||||||
g_value_set_float (&val, 0.5);
|
"amplitude", 0.5,
|
||||||
g_object_set (G_OBJECT (csource), "amplitude", &val, NULL);
|
"offset", 0.5, "frequency", 0.25, "timeshift", 500 * GST_MSECOND, NULL);
|
||||||
g_value_set_float (&val, 0.5);
|
|
||||||
g_object_set (G_OBJECT (csource), "offset", &val, NULL);
|
|
||||||
g_value_unset (&val);
|
|
||||||
|
|
||||||
g_object_set (G_OBJECT (csource), "frequency", 0.25, NULL);
|
g_object_unref (cs);
|
||||||
g_object_set (G_OBJECT (csource), "timeshift", 500 * GST_MSECOND, NULL);
|
|
||||||
|
|
||||||
g_object_unref (csource);
|
|
||||||
|
|
||||||
loop = g_main_loop_new (NULL, FALSE);
|
loop = g_main_loop_new (NULL, FALSE);
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ static void
|
||||||
set_program (GstObject * elem, GstStructure * prog)
|
set_program (GstObject * elem, GstStructure * prog)
|
||||||
{
|
{
|
||||||
const GstStructure *s;
|
const GstStructure *s;
|
||||||
GstInterpolationControlSource *cs;
|
GstControlSource *cs;
|
||||||
GstClockTime ts, dur;
|
GstClockTime ts, dur;
|
||||||
gdouble v;
|
gdouble v;
|
||||||
const GValue *frame;
|
const GValue *frame;
|
||||||
|
@ -98,8 +98,7 @@ set_program (GstObject * elem, GstStructure * prog)
|
||||||
if (!cs) {
|
if (!cs) {
|
||||||
cs = gst_interpolation_control_source_new ();
|
cs = gst_interpolation_control_source_new ();
|
||||||
gst_object_add_control_binding (elem,
|
gst_object_add_control_binding (elem,
|
||||||
gst_direct_control_binding_new (elem, name,
|
gst_direct_control_binding_new (elem, name, cs));
|
||||||
GST_CONTROL_SOURCE (cs)));
|
|
||||||
g_object_set (cs, "mode", GST_INTERPOLATION_MODE_NONE, NULL);
|
g_object_set (cs, "mode", GST_INTERPOLATION_MODE_NONE, NULL);
|
||||||
g_hash_table_insert (css, (gpointer) name, cs);
|
g_hash_table_insert (css, (gpointer) name, cs);
|
||||||
gst_object_unref (cs);
|
gst_object_unref (cs);
|
||||||
|
|
Loading…
Reference in a new issue