mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
tests/examples/transition.c: make -t option work with values supported by
smpte + "crossfade"
This commit is contained in:
parent
6943fe1b42
commit
498414e782
1 changed files with 16 additions and 4 deletions
|
@ -155,14 +155,14 @@ main (int argc, char **argv)
|
||||||
GOptionContext *ctx;
|
GOptionContext *ctx;
|
||||||
GESTimelinePipeline *pipeline;
|
GESTimelinePipeline *pipeline;
|
||||||
GMainLoop *mainloop;
|
GMainLoop *mainloop;
|
||||||
gint type;
|
gchar *type = "crossfade";
|
||||||
gchar *uri = NULL;
|
gchar *uri = NULL;
|
||||||
gdouble tdur;
|
gdouble tdur;
|
||||||
|
|
||||||
GOptionEntry options[] = {
|
GOptionEntry options[] = {
|
||||||
{"type", 't', 0, G_OPTION_ARG_INT, &type,
|
{"type", 't', 0, G_OPTION_ARG_STRING, &type,
|
||||||
"type of transition to create (smpte numeric)", "<smpte" "transition>"},
|
"type of transition to create", "<smpte-transition>"},
|
||||||
{"duration", 'd', 0.0, G_OPTION_ARG_DOUBLE, &tdur,
|
{"duration", 'd', 0, G_OPTION_ARG_DOUBLE, &tdur,
|
||||||
"duration of transition", "seconds"},
|
"duration of transition", "seconds"},
|
||||||
{NULL}
|
{NULL}
|
||||||
};
|
};
|
||||||
|
@ -188,6 +188,18 @@ main (int argc, char **argv)
|
||||||
|
|
||||||
ges_init ();
|
ges_init ();
|
||||||
|
|
||||||
|
/* get list of available transitions */
|
||||||
|
GstElement *element = gst_element_factory_make ("smpte", NULL);
|
||||||
|
GstElementClass *element_class = GST_ELEMENT_GET_CLASS (element);
|
||||||
|
|
||||||
|
GParamSpec *pspec =
|
||||||
|
g_object_class_find_property (G_OBJECT_CLASS (element_class), "type");
|
||||||
|
|
||||||
|
GEnumClass *smpte_enum_class =
|
||||||
|
G_ENUM_CLASS (g_type_class_ref (pspec->value_type));
|
||||||
|
|
||||||
|
GEnumValue *ttype = get_transition_type (type, smpte_enum_class);
|
||||||
|
|
||||||
gdouble adur = (gdouble) atof (argv[2]);
|
gdouble adur = (gdouble) atof (argv[2]);
|
||||||
gdouble bdur = (gdouble) atof (argv[4]);
|
gdouble bdur = (gdouble) atof (argv[4]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue