1 From def285f623bc30b9d1acede00393188e693cc741 Mon Sep 17 00:00:00 2001
2 From: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
3 Date: Sat, 22 Feb 2020 13:22:57 +0000
4 Subject: [PATCH] gstreamer-plugins-base: fix meson build in nxp fork
6 - Add missing IMX header file into istall target;
7 - Allocator's meta data files are missing in meson.build, bring them back;
8 - Add ION NXP-specific allocator to meson.build;
9 - Introduce additional configuration option to pass extra include paths,
10 which are required to build ION allocator;
11 - Some video sources are missing, bring them also into the build;
13 Upstream-Status: Pending
15 Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
17 gst-libs/gst/allocators/meson.build | 30 +++++++++++++++++++++++++++--
18 gst-libs/gst/gl/gstglconfig.h.meson | 2 ++
19 gst-libs/gst/gl/meson.build | 20 +++++++++++++++++++
20 gst-libs/gst/meson.build | 6 ++++++
21 gst-libs/gst/video/meson.build | 11 +++++++++++
23 meson_options.txt | 4 ++++
24 7 files changed, 74 insertions(+), 2 deletions(-)
26 diff --git a/gst-libs/gst/allocators/meson.build b/gst-libs/gst/allocators/meson.build
27 index 364baeebf..30b1495c9 100644
28 --- a/gst-libs/gst/allocators/meson.build
29 +++ b/gst-libs/gst/allocators/meson.build
30 @@ -5,18 +5,44 @@ gst_allocators_headers = [
35 +imx_gst_allocators_headers = [
38 + 'gstallocatorphymem.h',
41 +if cc.has_header('linux/ion.h', include_directories : imx_includes)
42 + imx_gst_allocators_headers += [
47 +gst_allocators_headers += imx_gst_allocators_headers
49 install_headers(gst_allocators_headers, subdir : 'gstreamer-1.0/gst/allocators/')
51 gst_allocators_sources = [ 'gstdmabuf.c', 'gstfdmemory.c', 'gstphysmemory.c']
53 +imx_gst_allocators_sources = ['gstdmabufmeta.c', 'gstphymemmeta.c', 'gstallocatorphymem.c']
55 +if cc.has_header('linux/ion.h', include_directories : imx_includes)
56 + imx_gst_allocators_sources += [
61 +gst_allocators_sources += imx_gst_allocators_sources
63 gstallocators = library('gstallocators-@0@'.format(api_version),
64 gst_allocators_sources,
65 c_args : gst_plugins_base_args + ['-DBUILDING_GST_ALLOCATORS'],
66 - include_directories: [configinc, libsinc],
67 + include_directories: [configinc, libsinc, imx_includes],
69 soversion : soversion,
70 darwin_versions : osxversion,
72 - dependencies : [gst_dep],
73 + dependencies : [video_dep, gst_dep],
76 allocators_gen_sources = []
77 diff --git a/gst-libs/gst/gl/gstglconfig.h.meson b/gst-libs/gst/gl/gstglconfig.h.meson
78 index 11795c16c..66cd54a7e 100644
79 --- a/gst-libs/gst/gl/gstglconfig.h.meson
80 +++ b/gst-libs/gst/gl/gstglconfig.h.meson
81 @@ -32,8 +32,10 @@ G_BEGIN_DECLS
82 #mesondefine GST_GL_HAVE_PLATFORM_CGL
83 #mesondefine GST_GL_HAVE_PLATFORM_EAGL
85 +#mesondefine GST_GL_HAVE_IONDMA
86 #mesondefine GST_GL_HAVE_DMABUF
87 #mesondefine GST_GL_HAVE_VIV_DIRECTVIV
88 +#mesondefine GST_GL_HAVE_PHYMEM
90 #mesondefine GST_GL_HAVE_GLEGLIMAGEOES
91 #mesondefine GST_GL_HAVE_GLCHAR
92 diff --git a/gst-libs/gst/gl/meson.build b/gst-libs/gst/gl/meson.build
93 index 0e0ba1b7d..6f6c6866d 100644
94 --- a/gst-libs/gst/gl/meson.build
95 +++ b/gst-libs/gst/gl/meson.build
96 @@ -123,8 +123,10 @@ glconf_options = [
97 'GST_GL_HAVE_PLATFORM_CGL',
98 'GST_GL_HAVE_PLATFORM_EAGL',
100 + 'GST_GL_HAVE_IONDMA',
101 'GST_GL_HAVE_DMABUF',
102 'GST_GL_HAVE_VIV_DIRECTVIV',
103 + 'GST_GL_HAVE_PHYMEM',
105 'GST_GL_HAVE_GLEGLIMAGEOES',
106 'GST_GL_HAVE_GLCHAR',
107 @@ -146,6 +148,18 @@ if unneeded_dep.found()
108 error ('Found unfindable dependency')
111 +if cc.has_header('linux/ion.h', include_directories : imx_includes)
112 + glconf.set10('GST_GL_HAVE_IONDMA', 1)
114 + 'gstglmemorydma.c',
117 + 'gstglmemorydma.h',
120 + error('i.MX platform requires ION support to be enabled!')
123 # OpenGL/GLES2 libraries
125 # GL platform - EGL, GLX, CGL, WGL, etc
126 @@ -501,6 +515,7 @@ if need_platform_egl != 'no'
127 glconf.set10('GST_GL_HAVE_DMABUF', 1)
133 #include <EGL/eglext.h>
134 @@ -808,9 +823,14 @@ if need_platform_egl != 'no' and need_win_viv_fb != 'no'
135 enabled_gl_winsys += 'viv-fb'
136 glconf.set10('GST_GL_HAVE_WINDOW_VIV_FB', 1)
137 glconf.set10('GST_GL_HAVE_VIV_DIRECTVIV', 1)
138 + glconf.set10('GST_GL_HAVE_PHYMEM', 1)
140 'viv-fb/gstgldisplay_viv_fb.c',
141 'viv-fb/gstglwindow_viv_fb_egl.c',
142 + 'gstglphymemory.c',
145 + 'gstglphymemory.h',
147 gl_cpp_args += ['-DEGL_API_FB']
149 diff --git a/gst-libs/gst/meson.build b/gst-libs/gst/meson.build
150 index cd3b5b043..1935f46e5 100644
151 --- a/gst-libs/gst/meson.build
152 +++ b/gst-libs/gst/meson.build
153 @@ -11,3 +11,9 @@ subdir('app')
155 # FIXME: gl deps are automagic
158 +# Install dangling imx header, required by other plugins
162 +install_headers(gst_imx_header, subdir : 'gstreamer-1.0/')
163 diff --git a/gst-libs/gst/video/meson.build b/gst-libs/gst/video/meson.build
164 index b4dfcdf65..d8531f199 100644
165 --- a/gst-libs/gst/video/meson.build
166 +++ b/gst-libs/gst/video/meson.build
167 @@ -35,6 +35,11 @@ video_sources = [
171 +imx_video_sources = [
172 + 'gstvideohdr10meta.c',
174 +video_sources += imx_video_sources
178 'colorbalancechannel.h',
179 @@ -70,6 +75,12 @@ video_headers = [
180 'video-overlay-composition.h',
184 +imx_video_headers = [
185 + 'gstvideohdr10meta.h',
187 +video_headers += imx_video_headers
189 install_headers(video_headers, subdir : 'gstreamer-1.0/gst/video/')
191 video_mkenum_headers = [
192 diff --git a/meson.build b/meson.build
193 index 2fca28205..7781934cd 100644
196 @@ -103,6 +103,9 @@ if glib_checks.disabled() or (glib_checks.auto() and not gst_version_is_dev)
197 add_project_arguments('-DG_DISABLE_CHECKS', language: 'c')
200 +# Define i.MX-specific include path as variable from options
201 +imx_includes = include_directories(get_option('extra_imx_incdir'))
204 ['HAVE_DLFCN_H', 'dlfcn.h'],
205 ['HAVE_EMMINTRIN_H', 'emmintrin.h'],
206 diff --git a/meson_options.txt b/meson_options.txt
207 index e7af4dd45..d44401ca6 100644
208 --- a/meson_options.txt
209 +++ b/meson_options.txt
210 @@ -85,3 +85,7 @@ option('package-name', type : 'string', yield : true,
211 description : 'package name to use in plugins')
212 option('package-origin', type : 'string', value : 'Unknown package origin', yield : true,
213 description : 'package origin URL to use in plugins')
215 +# NXP specific options
216 +option('extra_imx_incdir', type : 'string', yield : true, description : 'i.MX specific header include path')