summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2020-02-16 17:19:04 +0100
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2020-02-21 15:11:31 +0000
commit57e792136c0036e39bcf69011324cf05642b6641 (patch)
treefb0bf9590b16b99f5b5141f4d6daba9c0c9a08d3 /gst-libs
parent13c3b8ba5bdb8cad9857447b83741c7a8aa86a93 (diff)
libs: blend: filter: handle finalize() if display isn't assigned
I've just discovered iHD driver in Skylake doesn't have VideoProc entry point, hence, in this platform, when vaapioverlay is tried to be registered, critical warnings are raised because blend doesn't have a display assigned. As it is possible to have drivers without EntryPointVideoProc it is required to handle it gracefully. This patch does that: only tries to register vaapioverlay if the testing display has VPP and finalize() vmethods, in filter and blend, bail out if display is NULL.
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/vaapi/gstvaapiblend.c4
-rw-r--r--gst-libs/gst/vaapi/gstvaapifilter.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiblend.c b/gst-libs/gst/vaapi/gstvaapiblend.c
index 5b093d4d..07a1ab6e 100644
--- a/gst-libs/gst/vaapi/gstvaapiblend.c
+++ b/gst-libs/gst/vaapi/gstvaapiblend.c
@@ -105,6 +105,9 @@ gst_vaapi_blend_finalize (GObject * object)
{
GstVaapiBlend *const blend = GST_VAAPI_BLEND (object);
+ if (!blend->display)
+ goto bail;
+
GST_VAAPI_DISPLAY_LOCK (blend->display);
if (blend->va_context != VA_INVALID_ID) {
@@ -123,6 +126,7 @@ gst_vaapi_blend_finalize (GObject * object)
gst_vaapi_display_replace (&blend->display, NULL);
+bail:
G_OBJECT_CLASS (gst_vaapi_blend_parent_class)->finalize (object);
}
diff --git a/gst-libs/gst/vaapi/gstvaapifilter.c b/gst-libs/gst/vaapi/gstvaapifilter.c
index e25b7bc1..891e95af 100644
--- a/gst-libs/gst/vaapi/gstvaapifilter.c
+++ b/gst-libs/gst/vaapi/gstvaapifilter.c
@@ -1232,6 +1232,9 @@ gst_vaapi_filter_finalize (GObject * object)
GstVaapiFilter *const filter = GST_VAAPI_FILTER (object);
guint i;
+ if (!filter->display)
+ goto bail;
+
GST_VAAPI_DISPLAY_LOCK (filter->display);
if (filter->operations) {
for (i = 0; i < filter->operations->len; i++) {
@@ -1255,6 +1258,7 @@ gst_vaapi_filter_finalize (GObject * object)
GST_VAAPI_DISPLAY_UNLOCK (filter->display);
gst_vaapi_display_replace (&filter->display, NULL);
+bail:
if (filter->forward_references) {
g_array_unref (filter->forward_references);
filter->forward_references = NULL;