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 778250 - vaapi: build: support meson
vaapi: build: support meson
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
unspecified
Other Linux
: Normal enhancement
: 1.11.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-02-06 15:18 UTC by Víctor Manuel Jáquez Leal
Modified: 2017-02-09 11:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] vaapi: add meson build (17.30 KB, patch)
2017-02-06 23:48 UTC, Scott D Phillips
none Details | Review
[PATCH v2] vaapi: add meson build (17.42 KB, patch)
2017-02-07 00:22 UTC, Scott D Phillips
none Details | Review
[PATCH v2] vaapi: add meson build (17.87 KB, patch)
2017-02-07 00:55 UTC, Scott D Phillips
none Details | Review
[PATCH v3] vaapi: add meson build (18.03 KB, patch)
2017-02-07 19:00 UTC, Scott D Phillips
none Details | Review
[PATCH v4] vaapi: add meson build (18.09 KB, patch)
2017-02-07 19:07 UTC, Scott D Phillips
none Details | Review
[PATCH 1/2] make: remove gstvaapiversion.h generation (5.12 KB, patch)
2017-02-08 19:36 UTC, Scott D Phillips
committed Details | Review
[PATCH v5 2/2] vaapi: add meson build (17.36 KB, patch)
2017-02-08 19:36 UTC, Scott D Phillips
committed Details | Review

Description Víctor Manuel Jáquez Leal 2017-02-06 15:18:03 UTC
Add meson build system, as the rest of the GStreamer project.

https://github.com/mesonbuild/meson/wiki
Comment 1 Scott D Phillips 2017-02-06 23:48:38 UTC
Created attachment 345065 [details] [review]
[PATCH] vaapi: add meson build

Here's a first crack at it.
Comment 2 Scott D Phillips 2017-02-07 00:22:19 UTC
Created attachment 345066 [details] [review]
[PATCH v2] vaapi: add meson build

Changes since v1:
 - Set USE_GST_GL_HELPERS when gstgl_dep is present
 - Set the GLES_VERSION_MASK used by egl code
Comment 3 Scott D Phillips 2017-02-07 00:55:44 UTC
Created attachment 345067 [details] [review]
[PATCH v2] vaapi: add meson build

Changes since v1:
 - Set USE_GST_GL_HELPERS when gstgl_dep is present
 - Set the GLES_VERSION_MASK used by egl code

345066 was botched :-/
Comment 4 sreerenj 2017-02-07 01:08:54 UTC
Nice !
Comment 5 Víctor Manuel Jáquez Leal 2017-02-07 11:13:14 UTC
wow! 

What an unexpected surprise. Thanks, Scott!
Comment 6 Víctor Manuel Jáquez Leal 2017-02-07 11:48:25 UTC
Review of attachment 345067 [details] [review]:

I had to make some changes in order to make it work. In the comments are those changes.

And, bikeshedding a bit, there a couple of trailing white spaces that we could remove.

::: gst-libs/gst/base/meson.build
@@ +15,3 @@
+  version : libversion,
+  soversion : soversion,
+  install : true,

install : false,

::: gst-libs/gst/vaapi/Makefile.am
@@ +25,3 @@
 	-DIN_LIBGSTVAAPI_CORE			\
 	-DGST_USE_UNSTABLE_API			\
+	-DHAVE_GSTVAAPIVERSION_H		\

Is this a workaround because meson cannot generate the version header yet?

::: gst-libs/gst/vaapi/meson.build
@@ +204,3 @@
+endif
+if USE_EGL
+  gstlibvaapi_deps  += [egl_dep]

this needs the glib's gmodule dependency. Or better yet, delete that dead code.

@@ +222,3 @@
+  version : libversion,
+  soversion : soversion,
+  install : true,

install : false,

::: gst/vaapi/meson.build
@@ +46,3 @@
+  include_directories : [configinc, libsinc],
+  dependencies : [gstbase_dep, gstvideo_dep, gstallocators_dep, gstpbutils_dep,
+    libva_dep, gstlibvaapi_dep, gstgl_dep],

we need libm_dep too

::: meson.build
@@ +30,3 @@
+gstvideo_dep = dependency('gstreamer-video-1.0', version : gst_req,
+    fallback : ['gst-plugins-base', 'video_dep'])
+gstcodecparsers_dep = dependency('gstcodecparsers-1.0', version : gst_req,

the dependency name is gstreamer-codecparsers-1.0

@@ +32,3 @@
+gstcodecparsers_dep = dependency('gstcodecparsers-1.0', version : gst_req,
+    fallback : ['gst-plugins-bad', 'gstcodecparsers_dep'], required: false)
+gstgl_dep = dependency('gstgl-1.0', version : gst_req,

the dependency name is gstreamer-gl-1.0

@@ +36,3 @@
+libva_dep = dependency('libva', version: '>= 0.30.4', required: false)
+
+if libva_dep.found() 

Why not, instead of branching, make libva a required dependency?

@@ +37,3 @@
+
+if libva_dep.found() 
+  cc = meson.get_compiler('c')

add libm_dep = cc.find_library('m', required : true)
Comment 7 Scott D Phillips 2017-02-07 19:00:48 UTC
Created attachment 345134 [details] [review]
[PATCH v3] vaapi: add meson build

Changes since v2:
 - Mark gst-lib libraries as install: false
 - Add gmodule dependency for egl
 - Add libm dependency for the plugin
 - Fix the names of gl and codecparsers dependencies
 - make libva_dep required
Comment 8 Scott D Phillips 2017-02-07 19:07:19 UTC
Created attachment 345136 [details] [review]
[PATCH v4] vaapi: add meson build

Changes since v3:
 - fix placement of meson.get_compiler

Got carried away moving stuff around after testing it and wound up uploading v3 in a busted state :-(
Comment 9 Víctor Manuel Jáquez Leal 2017-02-08 11:51:45 UTC
Review of attachment 345136 [details] [review]:

::: gst-libs/gst/base/meson.build
@@ +15,3 @@
+  version : libversion,
+  soversion : soversion,
+  install : false,

nitpick: 'install: false' is the default, so perhaps we could just remove it (less code to maintain).

::: gst-libs/gst/vaapi/gstvaapidisplay.c
@@ +36,3 @@
 #include "gstvaapidisplay_priv.h"
 #include "gstvaapiworkarounds.h"
+#ifdef HAVE_GSTVAAPIVERSION_H

I guess this header can be autogenerated with custom_target()

::: gst-libs/gst/vaapi/meson.build
@@ +222,3 @@
+  version : libversion,
+  soversion : soversion,
+  install : false,

ditto

::: meson.build
@@ +60,3 @@
+GLES_VERSION_MASK += glesv3_dep.found() ? 8 : 0
+
+USE_ENCODERS = libva_dep.version().version_compare('>= 0.34.0')

It is missing to honor the 'with_encoders' option

USE_ENCODERS = libva_dep.version().version_compare('>= 0.34.0') and get_option('with_encoders') != 'no'
Comment 10 Scott D Phillips 2017-02-08 19:36:17 UTC
Created attachment 345263 [details] [review]
[PATCH 1/2] make: remove gstvaapiversion.h generation

hmm, instead of adding gstvaapiversion.h to the meson build, how about we just remove it. It looks funny to me and nothing like that is in the rest of the gstreamer codebase.
Comment 11 Scott D Phillips 2017-02-08 19:36:50 UTC
Created attachment 345264 [details] [review]
[PATCH v5 2/2] vaapi: add meson build

Changes since v4:
 - remove explicit install: false from static_libraries
 - gate USE_ENCODERS on the with_encoders option
 - gate USE_*_ENCODER on USE_ENCODERS
Comment 12 Tim-Philipp Müller 2017-02-08 20:16:21 UTC
There are similar generated version headers in gstreamer and gst-plugins-base, but here it's not really needed since the lib isn't public any more.
Comment 13 Tim-Philipp Müller 2017-02-08 20:17:43 UTC
For an uninstalled static library, we probably don't need the api-version suffix and the various versioning kwargs (but then they shouldn't hurt either).
Comment 14 Víctor Manuel Jáquez Leal 2017-02-09 10:35:49 UTC
Review of attachment 345263 [details] [review]:

I kept it when we did the upstream because I assumed that a user library will reemerge in order to expose the GstVaapiDisplay. But that library-to-be needs be discussed with the community, thus, this is dead code for now.

So yeah, I love the smell of removed code in the mornings <3
Comment 15 Víctor Manuel Jáquez Leal 2017-02-09 11:19:02 UTC
Comment on attachment 345264 [details] [review]
[PATCH v5 2/2] vaapi: add meson build

lgtm
Comment 16 Víctor Manuel Jáquez Leal 2017-02-09 11:27:04 UTC
commit 412dd13e86e834a846a26983470876ba36eace1c
Author: Scott D Phillips <scott.d.phillips@intel.com>
Date:   Mon Feb 6 15:46:20 2017 -0800

    vaapi: add meson build

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

commit 3cc4eb7b8138089b8cb64e3ca754784d9c194b59
Author: Scott D Phillips <scott.d.phillips@intel.com>
Date:   Wed Feb 8 10:17:40 2017 -0800

    make: remove gstvaapiversion.h generation

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