test: vaapioverlay: bail test if not available

vaapioverlay is only registered if the VA driver support the blend
operation.

This patch only executes the test if vaapioverlay is available,
otherwise the test is bail out without raising an error.
This commit is contained in:
Víctor Manuel Jáquez Leal 2020-01-06 19:39:06 +01:00
parent e4b4836170
commit 742d7e17e6

View file

@ -85,6 +85,12 @@ GST_START_TEST (test_overlay_position)
GstVideoFrame frame; GstVideoFrame frame;
GstVideoInfo vinfo; GstVideoInfo vinfo;
/* Check if vaapioverlay is available, since it is only available
* for iHD vaapi driver */
overlay = gst_element_factory_make ("vaapioverlay", "overlay");
if (!overlay)
return;
/* build pipeline */ /* build pipeline */
bin = gst_pipeline_new ("pipeline"); bin = gst_pipeline_new ("pipeline");
bus = gst_element_get_bus (bin); bus = gst_element_get_bus (bin);
@ -108,7 +114,6 @@ GST_START_TEST (test_overlay_position)
g_object_set (filter2, "caps", caps, NULL); g_object_set (filter2, "caps", caps, NULL);
gst_caps_unref (caps); gst_caps_unref (caps);
overlay = gst_element_factory_make ("vaapioverlay", "overlay");
sink = gst_element_factory_make ("vaapisink", "sink"); sink = gst_element_factory_make ("vaapisink", "sink");
g_object_set (sink, "display", 4, "signal-handoffs", TRUE, NULL); g_object_set (sink, "display", 4, "signal-handoffs", TRUE, NULL);
g_signal_connect (sink, "handoff", G_CALLBACK (on_handoff), NULL); g_signal_connect (sink, "handoff", G_CALLBACK (on_handoff), NULL);