From 082a56599b021b0b459ee6168dbbaa42f283db40 Mon Sep 17 00:00:00 2001 From: Holger Kaelberer Date: Fri, 20 Jul 2012 12:36:33 +0200 Subject: overlay: fix build without advanced GstVideoOverlayFormatFlags. Check for global-alpha support in GstVideoOverlayComposition API. Signed-off-by: Gwenole Beauchesne --- tests/test-subpicture.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/test-subpicture.c') diff --git a/tests/test-subpicture.c b/tests/test-subpicture.c index 32c9c191..c94ddb9c 100644 --- a/tests/test-subpicture.c +++ b/tests/test-subpicture.c @@ -41,10 +41,12 @@ static GOptionEntry g_options[] = { 0, G_OPTION_ARG_STRING, &g_codec_str, "codec to test", NULL }, +#ifdef HAVE_GST_VIDEO_OVERLAY_HWCAPS { "global-alpha", 'g', 0, G_OPTION_ARG_DOUBLE, &g_global_alpha, "global-alpha value", NULL }, +#endif { NULL, } }; @@ -82,8 +84,10 @@ main(int argc, char *argv[]) if (!video_output_init(&argc, argv, g_options)) g_error("failed to initialize video output subsystem"); +#ifdef HAVE_GST_VIDEO_OVERLAY_HWCAPS if (g_global_alpha != 1.0) flags |= GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA; +#endif g_print("Test subpicture\n"); @@ -123,8 +127,10 @@ main(int argc, char *argv[]) g_error("could not create video overlay"); gst_buffer_unref(buffer); +#ifdef HAVE_GST_VIDEO_OVERLAY_HWCAPS if (flags & GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA) gst_video_overlay_rectangle_set_global_alpha(overlay, g_global_alpha); +#endif compo = gst_video_overlay_composition_new(overlay); if (!compo) -- cgit v1.2.1