After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 780948 - pluginutils.c assumes GST_GL_HAVE_WINDOW_* are defined
pluginutils.c assumes GST_GL_HAVE_WINDOW_* are defined
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
unspecified
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-04-05 18:33 UTC by Scott D Phillips
Modified: 2017-04-11 14:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] plugins: Fix usage of GST_GL_HAVE_WINDOW_* defines (1.35 KB, patch)
2017-04-05 18:33 UTC, Scott D Phillips
committed Details | Review

Description Scott D Phillips 2017-04-05 18:33:04 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
Comment 1 Scott D Phillips 2017-04-05 18:33:54 UTC
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)
Comment 2 Matthew Waters (ystreet00) 2017-04-06 01:08:25 UTC
(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.
Comment 3 Scott D Phillips 2017-04-06 01:24:46 UTC
(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.
Comment 4 Nicolas Dufresne (ndufresne) 2017-04-06 01:29:31 UTC
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.
Comment 5 Matthew Waters (ystreet00) 2017-04-06 03:58:02 UTC
(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 ;)
Comment 6 Víctor Manuel Jáquez Leal 2017-04-06 09:48:50 UTC
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 7 Víctor Manuel Jáquez Leal 2017-04-07 10:32:57 UTC
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
Comment 8 Víctor Manuel Jáquez Leal 2017-04-11 14:39:31 UTC
commit 0343649667d58dfb24d002e9cc924fd356a1dd9f