mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
controller: port to new control source api
This commit is contained in:
parent
2214657113
commit
bf4c6bd92b
1 changed files with 12 additions and 18 deletions
|
@ -73,8 +73,7 @@ set_program (GstObject * elem, GstStructure * prog)
|
||||||
const GstStructure *s;
|
const GstStructure *s;
|
||||||
GstInterpolationControlSource *cs;
|
GstInterpolationControlSource *cs;
|
||||||
GstClockTime ts, dur;
|
GstClockTime ts, dur;
|
||||||
GValue val = { 0, };
|
gdouble v;
|
||||||
gint v;
|
|
||||||
const GValue *frame;
|
const GValue *frame;
|
||||||
GHashTable *css;
|
GHashTable *css;
|
||||||
gint i, j;
|
gint i, j;
|
||||||
|
@ -82,8 +81,6 @@ set_program (GstObject * elem, GstStructure * prog)
|
||||||
|
|
||||||
css = g_hash_table_new (g_str_hash, g_str_equal);
|
css = g_hash_table_new (g_str_hash, g_str_equal);
|
||||||
|
|
||||||
g_value_init (&val, G_TYPE_INT);
|
|
||||||
|
|
||||||
ts = 0;
|
ts = 0;
|
||||||
dur = gst_util_uint64_scale_int (GST_SECOND, 1, 15);
|
dur = gst_util_uint64_scale_int (GST_SECOND, 1, 15);
|
||||||
|
|
||||||
|
@ -104,17 +101,14 @@ set_program (GstObject * elem, GstStructure * prog)
|
||||||
g_hash_table_insert (css, (gpointer) name, cs);
|
g_hash_table_insert (css, (gpointer) name, cs);
|
||||||
g_object_unref (cs);
|
g_object_unref (cs);
|
||||||
}
|
}
|
||||||
gst_structure_get_int (s, name, &v);
|
gst_structure_get_double (s, name, &v);
|
||||||
g_value_set_int (&val, v);
|
|
||||||
gst_timed_value_control_source_set ((GstTimedValueControlSource *) cs, ts,
|
gst_timed_value_control_source_set ((GstTimedValueControlSource *) cs, ts,
|
||||||
&val);
|
v);
|
||||||
GST_DEBUG (" %s = %d", name, v);
|
GST_DEBUG (" %s = %lf", name, v);
|
||||||
}
|
}
|
||||||
ts += dur;
|
ts += dur;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_value_unset (&val);
|
|
||||||
|
|
||||||
g_hash_table_unref (css);
|
g_hash_table_unref (css);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,17 +165,17 @@ main (gint argc, gchar ** argv)
|
||||||
/* programm a pattern of events */
|
/* programm a pattern of events */
|
||||||
#if 0
|
#if 0
|
||||||
prog = gst_structure_from_string ("program"
|
prog = gst_structure_from_string ("program"
|
||||||
", image00=(structure)\"image\\,contrast\\=0\\;\""
|
", image00=(structure)\"image\\,contrast\\=0.0\\;\""
|
||||||
", image01=(structure)\"image\\,contrast\\=79\\;\""
|
", image01=(structure)\"image\\,contrast\\=0.3\\;\""
|
||||||
", image02=(structure)\"image\\,contrast\\=255\\;\""
|
", image02=(structure)\"image\\,contrast\\=1.0\\;\""
|
||||||
", image03=(structure)\"image\\,contrast\\=15\\;\";", NULL);
|
", image03=(structure)\"image\\,contrast\\=0.05\\;\";", NULL);
|
||||||
#endif
|
#endif
|
||||||
#if 1
|
#if 1
|
||||||
prog = gst_structure_from_string ("program"
|
prog = gst_structure_from_string ("program"
|
||||||
", image00=(structure)\"image\\,brightness\\=255\\,contrast\\=0\\;\""
|
", image00=(structure)\"image\\,brightness\\=1.0\\,contrast\\=0.0\\;\""
|
||||||
", image01=(structure)\"image\\,brightness\\=127\\,contrast\\=79\\;\""
|
", image01=(structure)\"image\\,brightness\\=0.5\\,contrast\\=0.3\\;\""
|
||||||
", image02=(structure)\"image\\,brightness\\=64\\,contrast\\=255\\;\""
|
", image02=(structure)\"image\\,brightness\\=0.25\\,contrast\\=1.0\\;\""
|
||||||
", image03=(structure)\"image\\,brightness\\=0\\,contrast\\=15\\;\";",
|
", image03=(structure)\"image\\,brightness\\=0.0\\,contrast\\=0.05\\;\";",
|
||||||
NULL);
|
NULL);
|
||||||
#endif
|
#endif
|
||||||
set_program (GST_OBJECT (src), prog);
|
set_program (GST_OBJECT (src), prog);
|
||||||
|
|
Loading…
Reference in a new issue