tests/examples/transition.c: make -t option work with values supported by

smpte + "crossfade"
This commit is contained in:
Brandon Lewis 2010-05-26 13:05:18 +02:00 committed by Edward Hervey
parent 6943fe1b42
commit 498414e782

View file

@ -155,14 +155,14 @@ main (int argc, char **argv)
GOptionContext *ctx;
GESTimelinePipeline *pipeline;
GMainLoop *mainloop;
gint type;
gchar *type = "crossfade";
gchar *uri = NULL;
gdouble tdur;
GOptionEntry options[] = {
{"type", 't', 0, G_OPTION_ARG_INT, &type,
"type of transition to create (smpte numeric)", "<smpte" "transition>"},
{"duration", 'd', 0.0, G_OPTION_ARG_DOUBLE, &tdur,
{"type", 't', 0, G_OPTION_ARG_STRING, &type,
"type of transition to create", "<smpte-transition>"},
{"duration", 'd', 0, G_OPTION_ARG_DOUBLE, &tdur,
"duration of transition", "seconds"},
{NULL}
};
@ -188,6 +188,18 @@ main (int argc, char **argv)
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 bdur = (gdouble) atof (argv[4]);