From: Víctor Manuel Jáquez Leal Date: Thu, 28 Sep 2017 16:58:17 +0000 (+0200) Subject: libs: display: egl: avoid two vaDisplay instantiates X-Git-Tag: 1.19.3~503^2~818 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=66e4593c33a55933d9736fc9989e3cdb0a8a628b;p=platform%2Fupstream%2Fgstreamer.git libs: display: egl: avoid two vaDisplay instantiates GstVaapiDisplayEGL is a wrapper of another GstVaapiDisplay, either X11 or Wayland. Nonetheless it created another vaDisplay for it, instead of using the wrapped one. This patch enables the reuse of the wrapped vaDisplay avoiding instantiating two. https://bugzilla.gnome.org/show_bug.cgi?id=782212 --- diff --git a/gst-libs/gst/vaapi/gstvaapidisplay_egl.c b/gst-libs/gst/vaapi/gstvaapidisplay_egl.c index 7d3d27e..fd5814e 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay_egl.c +++ b/gst-libs/gst/vaapi/gstvaapidisplay_egl.c @@ -189,6 +189,8 @@ gst_vaapi_display_egl_get_display_info (GstVaapiDisplay * base_display, GstVaapiDisplayClass *const klass = GST_VAAPI_DISPLAY_GET_CLASS (display->display); + info->va_display = GST_VAAPI_DISPLAY_VADISPLAY (display->display); + if (klass->get_display && !klass->get_display (display->display, info)) return FALSE; return TRUE; @@ -279,6 +281,11 @@ gst_vaapi_display_egl_finalize (GObject * object) if (dpy->texture_map) gst_object_unref (dpy->texture_map); + + /* HACK to avoid to call twice vaTerminate() since this and the + * proxied display share the same vaDisplay */ + GST_VAAPI_DISPLAY_VADISPLAY (object) = NULL; + G_OBJECT_CLASS (gst_vaapi_display_egl_parent_class)->finalize (object); }