mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 13:06:23 +00:00
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.
This commit is contained in:
parent
13c3b8ba5b
commit
57e792136c
3 changed files with 10 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -202,7 +202,8 @@ plugin_init (GstPlugin * plugin)
|
|||
g_array_unref (decoders);
|
||||
}
|
||||
|
||||
gst_vaapioverlay_register (plugin, display);
|
||||
if (_gst_vaapi_has_video_processing)
|
||||
gst_vaapioverlay_register (plugin, display);
|
||||
|
||||
gst_element_register (plugin, "vaapipostproc",
|
||||
GST_RANK_PRIMARY, GST_TYPE_VAAPIPOSTPROC);
|
||||
|
|
Loading…
Reference in a new issue