From: Stefan Kost Date: Tue, 21 Sep 2010 20:23:07 +0000 (+0300) Subject: shapewipe: add optional border parameter and slowdown animation X-Git-Tag: RELEASE-0.10.26~111 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=78d03537452d4dc91c212722bd914dbe397b1165;p=platform%2Fupstream%2Fgst-plugins-good.git shapewipe: add optional border parameter and slowdown animation Allow to play with the border property (sharp/soft edges). --- diff --git a/tests/examples/shapewipe/shapewipe-example.c b/tests/examples/shapewipe/shapewipe-example.c index 94f7175..e3b49fe 100644 --- a/tests/examples/shapewipe/shapewipe-example.c +++ b/tests/examples/shapewipe/shapewipe-example.c @@ -21,6 +21,8 @@ #include #include +#include + static gboolean on_message (GstBus * bus, GstMessage * message, gpointer user_data) { @@ -68,19 +70,24 @@ main (gint argc, gchar ** argv) GMainLoop *loop; GstBus *bus; gchar *pipeline_string; + gfloat border = 0.05; - if (argc != 2) { - g_print ("Usage: shapewipe mask.png\n"); + if (argc < 2) { + g_print ("Usage: shapewipe mask.png \n"); return -1; } gst_init (&argc, &argv); gst_controller_init (&argc, &argv); + if (argc > 2) { + border = atof (argv[2]); + } + pipeline_string = g_strdup_printf - ("videotestsrc ! video/x-raw-yuv,format=(fourcc)AYUV,width=640,height=480 ! shapewipe name=shape border=0.05 ! videomixer name=mixer ! ffmpegcolorspace ! autovideosink filesrc location=%s ! typefind ! decodebin2 ! ffmpegcolorspace ! videoscale ! queue ! shape.mask_sink videotestsrc pattern=snow ! video/x-raw-yuv,format=(fourcc)AYUV,width=640,height=480 ! queue ! mixer.", - argv[1]); + ("videotestsrc ! video/x-raw-yuv,format=(fourcc)AYUV,width=640,height=480 ! shapewipe name=shape border=%f ! videomixer name=mixer ! ffmpegcolorspace ! autovideosink filesrc location=%s ! typefind ! decodebin2 ! ffmpegcolorspace ! videoscale ! queue ! shape.mask_sink videotestsrc pattern=snow ! video/x-raw-yuv,format=(fourcc)AYUV,width=640,height=480 ! queue ! mixer.", + border, argv[1]); pipeline = gst_parse_launch (pipeline_string, NULL); g_free (pipeline_string); @@ -109,7 +116,7 @@ main (gint argc, gchar ** argv) g_object_set (G_OBJECT (csource), "offset", &val, NULL); g_value_unset (&val); - g_object_set (G_OBJECT (csource), "frequency", 0.5, NULL); + g_object_set (G_OBJECT (csource), "frequency", 0.25, NULL); g_object_set (G_OBJECT (csource), "timeshift", 500 * GST_MSECOND, NULL); g_object_unref (csource);