summaryrefslogtreecommitdiff
path: root/tests/test-subpicture.c
diff options
context:
space:
mode:
authorHolger Kaelberer <holger.k@elberer.de>2012-07-20 12:36:33 +0200
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2013-01-11 15:47:46 +0100
commit082a56599b021b0b459ee6168dbbaa42f283db40 (patch)
tree2c5951164ef595c37b53548ce000a3d58dc84db1 /tests/test-subpicture.c
parentbfc4e6e4f6108e7077287fce37d3804132342cef (diff)
downloadgst-vaapi-082a56599b021b0b459ee6168dbbaa42f283db40.tar.gz
overlay: fix build without advanced GstVideoOverlayFormatFlags.
Check for global-alpha support in GstVideoOverlayComposition API. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Diffstat (limited to 'tests/test-subpicture.c')
-rw-r--r--tests/test-subpicture.c6
1 files changed, 6 insertions, 0 deletions
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)