From 78d1f5d026ba19f1090209227013429d7f7db30d Mon Sep 17 00:00:00 2001 From: He Junyan Date: Wed, 21 Dec 2022 14:36:31 +0800 Subject: [PATCH] va: Delay the VAProcPipelineCaps query after context created. The VAAPI vaQueryVideoProcPipelineCaps() requires the context as the parameter. So far, we always pass VA_INVALID_ID and it can succeed. But the API does not say that and in theory, a valid context is required. Now the new platform really needs a valid context and so we have to delay that query until the context is created. Part-of: --- subprojects/gst-plugins-bad/sys/va/gstvafilter.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/va/gstvafilter.c b/subprojects/gst-plugins-bad/sys/va/gstvafilter.c index cb41c2a58c..6a16af4f89 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvafilter.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvafilter.c @@ -363,9 +363,6 @@ gst_va_filter_open (GstVaFilter * self) if (!gst_va_filter_ensure_config_attributes (self, &attrib.value)) return FALSE; - if (!gst_va_filter_ensure_pipeline_caps (self)) - return FALSE; - self->image_formats = gst_va_display_get_image_formats (self->display); if (!self->image_formats) return FALSE; @@ -393,6 +390,11 @@ gst_va_filter_open (GstVaFilter * self) goto bail; } + if (!gst_va_filter_ensure_pipeline_caps (self)) { + vaDestroyContext (dpy, self->context); + goto bail; + } + return TRUE; bail: