From bfc4e6e4f6108e7077287fce37d3804132342cef Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Fri, 4 Jan 2013 10:19:56 +0100 Subject: [PATCH] tests: add support for global-alpha subpictures. Add --global-alpha option to test-subpicture. --- tests/test-subpicture.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test-subpicture.c b/tests/test-subpicture.c index bba341b3a9..32c9c1918f 100644 --- a/tests/test-subpicture.c +++ b/tests/test-subpicture.c @@ -34,12 +34,17 @@ static inline void pause(void) } static gchar *g_codec_str; +static gdouble g_global_alpha = 1.0; static GOptionEntry g_options[] = { { "codec", 'c', 0, G_OPTION_ARG_STRING, &g_codec_str, "codec to test", NULL }, + { "global-alpha", 'g', + 0, + G_OPTION_ARG_DOUBLE, &g_global_alpha, + "global-alpha value", NULL }, { NULL, } }; @@ -77,6 +82,9 @@ main(int argc, char *argv[]) if (!video_output_init(&argc, argv, g_options)) g_error("failed to initialize video output subsystem"); + if (g_global_alpha != 1.0) + flags |= GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA; + g_print("Test subpicture\n"); display = video_output_create_display(NULL); @@ -115,6 +123,9 @@ main(int argc, char *argv[]) g_error("could not create video overlay"); gst_buffer_unref(buffer); + if (flags & GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA) + gst_video_overlay_rectangle_set_global_alpha(overlay, g_global_alpha); + compo = gst_video_overlay_composition_new(overlay); if (!compo) g_error("could not create video overlay composition");