GNOME Bugzilla – Bug 780948
pluginutils.c assumes GST_GL_HAVE_WINDOW_* are defined
Last modified: 2017-04-11 14:39:31 UTC
../subprojects/gstreamer-vaapi/gst/vaapi/gstvaapipluginutil.c: In function ‘gst_vaapi_create_display_from_gl_context’: ../subprojects/gstreamer-vaapi/gst/vaapi/gstvaapipluginutil.c:185:30: error: ‘GST_GL_HAVE_WINDOW_WAYLAND’ undeclared (first use in this function); did you mean ‘GST_GL_HAVE_WINDOW_X11’? if (!display_type && GST_GL_HAVE_WINDOW_WAYLAND) ^~~~~~~~~~~~~~~~~~~~~~~~~~ GST_GL_HAVE_WINDOW_X11
Created attachment 349317 [details] [review] [PATCH] plugins: Fix usage of GST_GL_HAVE_WINDOW_* defines When these definitions are false, they are undef in the preprocessor, not a defined value of 0. When they are unset the compile fails with: 'GST_GL_HAVE_WINDOW_WAYLAND' undeclared (first use in this function)
(In reply to Scott D Phillips from comment #1) > Created attachment 349317 [details] [review] [review] > [PATCH] plugins: Fix usage of GST_GL_HAVE_WINDOW_* defines > > When these definitions are false, they are undef in the > preprocessor, not a defined value of 0. When they are unset the > compile fails with: Pretty sure that's not true. i.e. GST_GL_HAVE_WINDOW_* are always defined to either 0 or 1 in gstglconfig.h.
(In reply to Matthew Waters (ystreet00) from comment #2) > (In reply to Scott D Phillips from comment #1) > > Created attachment 349317 [details] [review] [review] [review] > > [PATCH] plugins: Fix usage of GST_GL_HAVE_WINDOW_* defines > > > > When these definitions are false, they are undef in the > > preprocessor, not a defined value of 0. When they are unset the > > compile fails with: > > Pretty sure that's not true. i.e. GST_GL_HAVE_WINDOW_* are always defined > to either 0 or 1 in gstglconfig.h. Ah, in that case then I think there's a bug in the meson generation of gstglconfig.h. Here's part of my gstglconfig.h from a meson build: > #define GST_GL_HAVE_WINDOW_X11 1 > /* #undef GST_GL_HAVE_WINDOW_COCOA */ > /* #undef GST_GL_HAVE_WINDOW_WIN32 */ > /* #undef GST_GL_HAVE_WINDOW_WAYLAND */ > /* #undef GST_GL_HAVE_WINDOW_ANDROID */ > /* #undef GST_GL_HAVE_WINDOW_DISPMANX */ > /* #undef GST_GL_HAVE_WINDOW_EAGL */ I guess we need to sprinkle some glconf.set('GST_GL_HAVE_WINDOW_...', 0) in the meson.build there. I think we still need this change though or something like it, even after meson's gstglconfig.h is fixed. The vaapi plugin should be buildable without gstgl at all.
To be honest, I would still make this change. Doing run-time check on something that will never change is just a waste. It's better to out-compile in this case.
(In reply to Nicolas Dufresne (stormer) from comment #4) > To be honest, I would still make this change. Doing run-time check on > something that will never change is just a waste. It's better to out-compile > in this case. The flip-side of that is that if it's if-ed out, the compile will still check it for valid syntax whereas if it's #ifdef-ed out, there is no syntax checking ;)
Though what Matthew said is a nice trick to verify syntax while coding, I'm leaned with Nicolas. Also, as Scott said there's a bug in gstgl meson, still the patch applies. Pushing :)
Comment on attachment 349317 [details] [review] [PATCH] plugins: Fix usage of GST_GL_HAVE_WINDOW_* defines since the window is closed now, let's commit it after the release 1.11.90
commit 0343649667d58dfb24d002e9cc924fd356a1dd9f