[PATCH] util: Fix build error when GL is enabled while EGL is disabled.

junyan.he at hotmail.com junyan.he at hotmail.com
Wed Oct 31 04:29:07 UTC 2018


From: Junyan He <junyan.he at intel.com>

gl_platform_type in gst_vaapi_get_display_type_from_gl_env generate
unused-variable warning and may block build when Werror enabled.
Add a statement to kill unused-value warning.
Several functions like gst_vaapi_display_egl_new_with_native_display
have no prototype warning and link error when GL is enabled but EGL
is disabled.

https://bugzilla.gnome.org/show_bug.cgi?id=797358

Signed-off-by: Junyan He <junyan.he at intel.com>
---
 gst/vaapi/gstvaapipluginutil.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/gst/vaapi/gstvaapipluginutil.c b/gst/vaapi/gstvaapipluginutil.c
index 8632da8..a7bc2c9 100644
--- a/gst/vaapi/gstvaapipluginutil.c
+++ b/gst/vaapi/gstvaapipluginutil.c
@@ -193,11 +193,14 @@ gst_vaapi_get_display_type_from_gl_env (void)
 #if USE_EGL
   if (g_strcmp0 (gl_platform_type, "egl") == 0)
     return GST_VAAPI_DISPLAY_TYPE_EGL;
+#else
+  (void) gl_platform_type;
 #endif
 
   return GST_VAAPI_DISPLAY_TYPE_ANY;
 }
 
+#if USE_EGL
 static gint
 gst_vaapi_get_gles_version_from_gl_api (GstGLAPI gl_api)
 {
@@ -220,7 +223,7 @@ gst_vaapi_get_egl_handle_from_gl_display (GstGLDisplay * gl_display)
 {
   guintptr egl_handle = 0;
 
-#if USE_EGL && GST_GL_HAVE_PLATFORM_EGL
+#if GST_GL_HAVE_PLATFORM_EGL
   GstGLDisplayEGL *egl_display;
   egl_display = gst_gl_display_egl_from_gl_display (gl_display);
   if (egl_display) {
@@ -270,7 +273,18 @@ gst_vaapi_create_display_from_egl (GstGLDisplay * gl_display,
   }
 
   return display;
+
 }
+#else
+static GstVaapiDisplay *
+gst_vaapi_create_display_from_egl (GstGLDisplay * gl_display,
+    GstGLContext * gl_context, GstVaapiDisplayType display_type,
+    gpointer native_display)
+{
+  return NULL;
+}
+#endif /* USE_EGL */
+
 #endif /* USE_GST_GL_HELPERS */
 
 static GstVaapiDisplay *
-- 
2.7.4



More information about the gstreamer-devel mailing list