3 if meson.is_cross_build()
4 if get_option('doc').enabled()
5 error('Documentation enabled but building the doc while cross building is not supported yet.')
8 message('Documentation not built as building it while cross building is not supported yet.')
13 if get_option('doc').enabled()
14 error('Documentation enabled but not supported when building statically.')
17 message('Building statically, can\'t build the documentation')
22 if get_option('doc').enabled()
23 error('Documentation enabled but introspection not built.')
26 message('Introspection not built, won\'t build documentation requiring it')
29 required_hotdoc_extensions = ['gi-extension', 'c-extension', 'gst-extension']
30 if gst_dep.type_name() == 'internal'
31 gst_proj = subproject('gstreamer')
32 plugins_cache_generator = gst_proj.get_variable('plugins_cache_generator')
34 plugins_cache_generator = find_program(join_paths(gst_dep.get_pkgconfig_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'),
38 plugins_cache = join_paths(meson.current_source_dir(), 'plugins', 'gst_plugins_cache.json')
40 if plugins.length() == 0
41 message('All bad plugins have been disabled')
42 elif plugins_cache_generator.found()
43 plugins_doc_dep = custom_target('bad-plugins-doc-cache',
44 command: [plugins_cache_generator, plugins_cache, '@OUTPUT@', '@INPUT@'],
46 output: 'gst_plugins_cache.json',
47 build_always_stale: true,
50 warning('GStreamer plugin inspector for documentation not found, can\'t update the cache')
53 hotdoc_p = find_program('hotdoc', required: get_option('doc'))
54 if not hotdoc_p.found()
55 message('Hotdoc not found, not building the documentation')
59 hotdoc_req = '>= 0.11.0'
60 hotdoc_version = run_command(hotdoc_p, '--version').stdout()
61 if not hotdoc_version.version_compare(hotdoc_req)
62 if get_option('doc').enabled()
63 error('Hotdoc version @0@ not found, got @1@'.format(hotdoc_req, hotdoc_version))
65 message('Hotdoc version @0@ not found, got @1@'.format(hotdoc_req, hotdoc_version))
70 hotdoc = import('hotdoc')
71 foreach extension: required_hotdoc_extensions
72 if not hotdoc.has_extensions(extension)
73 if get_option('doc').enabled()
74 error('Documentation enabled but @0@ missing'.format(extension))
77 message('@0@ extensions not found, not building documentation requiring it'.format(extension))
83 docconf = configuration_data()
84 docconf.set('GST_API_VERSION', api_version)
86 configure_file(input : 'gst_api_version.in',
87 output : 'gst_api_version.md',
88 configuration : docconf)
93 'gst/frei0r/frei0r.h',
95 'gst-libs/gst/*/*-private.h',
96 'gst-libs/gst/codecparsers/nalutils.h',
97 'ext/closedcaption/bcd.h',
98 'ext/closedcaption/bit_slicer.[ch]',
99 'ext/closedcaption/decoder.[ch]',
100 'ext/closedcaption/macros.h',
101 'ext/closedcaption/misc.h',
102 'ext/closedcaption/raw_decoder.[ch]',
103 'ext/closedcaption/sampling_par.[ch]',
104 'ext/closedcaption/sliced.[ch]',
108 'gst-libs/gst/*/*-prelude.h',
109 'gst-libs/gst/vulkan/vulkan_fwd.h'
111 excludes += [join_paths(meson.current_source_dir(), root_rel, f)]
117 {'name': 'mpegts', 'gir': mpegts_gir, 'lib': gstmpegts_dep},
118 {'name': 'play', 'gir': play_gir, 'lib': gstplay_dep},
119 {'name': 'player', 'gir': player_gir, 'lib': gstplayer_dep},
120 {'name': 'insertbin', 'gir': insertbin_gir, 'lib': gstinsertbin_dep},
121 {'name': 'codecparsers', 'lib': gstcodecparsers_dep},
122 {'name': 'adaptivedemux', 'lib': gstadaptivedemux_dep},
123 {'name': 'basecamerabinsrc', 'gir': basecamerabin_gir, 'lib': gstbasecamerabin_dep},
124 {'name': 'webrtc', 'gir': webrtc_gir, 'lib': gstwebrtc_dep, 'suffix': 'lib'},
125 {'name': 'audio', 'gir': audio_gir, 'lib': gstbadaudio_dep, 'prefix': 'bad-'},
126 {'name': 'transcoder', 'gir': transcoder_gir, 'lib': gst_transcoder_dep},
127 {'name': 'codecs', 'gir': codecs_gir, 'lib': gstcodecs_dep},
130 if gstopencv_dep.found()
132 {'name': 'opencv', 'lib': gstopencv_dep, 'c_source_patterns': ['*.h', '*.cpp'], 'extra_c_flags': ['-x c++']},
136 if gstvulkan_dep.found()
138 {'name': 'vulkan', 'gir': vulkan_gir, 'lib': gstvulkan_dep, 'suffix': 'lib'},
140 if enabled_vulkan_winsys.contains('xcb')
142 {'name': 'vulkan-xcb', 'gir': vulkan_xcb_gir, 'lib': gstvulkanxcb_dep, 'extra_sources' : [
143 join_paths(root_rel, 'gst-libs/gst/vulkan/xcb/gstvkdisplay_xcb.[ch]'),
147 if enabled_vulkan_winsys.contains('wayland')
149 {'name': 'vulkan-wayland', 'gir': vulkan_wayland_gir, 'lib': gstvulkanwayland_dep, 'extra_sources' : [
150 join_paths(root_rel, 'gst-libs/gst/vulkan/wayland/gstvkdisplay_wayland.[ch]'),
157 has_gi_extension = hotdoc.has_extensions('gi-extension')
158 has_c_extension = hotdoc.has_extensions('c-extension')
160 foreach lib_def: libs
161 name = lib_def['name']
163 extra_sources = lib_def.get('extra_sources', [])
165 c_source_patterns = lib_def.get('c_source_patterns', ['*.[hc]'])
167 foreach pattern: c_source_patterns
168 c_sources += join_paths(root_rel, 'gst-libs/gst', name, pattern)
170 c_sources += extra_sources
172 if lib_def.has_key('gir')
175 prefix = lib_def.get('prefix', '')
176 suffix = lib_def.get('suffix', '')
177 libs_doc += [hotdoc.generate_doc(prefix + name + suffix,
178 project_version: api_version,
179 gi_c_sources: c_sources,
180 gi_sources: gir[0].full_path(),
181 gi_c_source_filters: excludes,
182 sitemap: join_paths('libs', name, 'sitemap.txt'),
183 index: join_paths('libs/', name, 'index.md'),
184 gi_index: join_paths('libs/', name, 'index.md'),
185 gi_smart_index: true,
186 gi_order_generated_subpages: true,
187 dependencies: [lib, gir],
188 c_flags: '-DGST_USE_UNSTABLE_API',
194 libs_doc += [hotdoc.generate_doc('gst-plugins-bad-' + name,
195 sitemap: join_paths('libs', name, 'sitemap.txt'),
196 index: join_paths('libs', name, 'index.md'),
197 project_version: api_version,
198 c_sources: c_sources,
199 c_source_filters: excludes,
200 c_index: join_paths('libs', name, 'index.md'),
202 c_order_generated_subpages: true,
203 extra_c_flags: ['-DGST_USE_UNSTABLE_API'] + lib_def.get('extra_c_flags', []),
211 list_plugin_res = run_command(python3, '-c',
216 with open("@0@") as f:
217 print(':'.join(json.load(f).keys()), end='')
218 '''.format(plugins_cache))
220 assert(list_plugin_res.returncode() == 0,
221 'Could not list plugins from @0@'.format(plugins_cache))
224 foreach plugin_name: list_plugin_res.stdout().split(':')
225 plugins_doc += [hotdoc.generate_doc(plugin_name,
226 project_version: api_version,
227 sitemap: 'plugins/sitemap.txt',
228 index: 'plugins/index.md',
229 c_flags: '-DGST_USE_UNSTABLE_API',
230 gst_index: 'plugins/index.md',
231 gst_smart_index: true,
233 join_paths(root_rel, 'sys/*/*.[ch]'),
234 join_paths(root_rel, 'sys/*/*.cpp'),
235 join_paths(root_rel, 'sys/*/*.cc'),
236 join_paths(root_rel, 'sys/*/*.hh'),
237 join_paths(root_rel, 'ext/*/*.[ch]'),
238 join_paths(root_rel, 'ext/*/*.cpp'),
239 join_paths(root_rel, 'ext/*/*.cc'),
240 join_paths(root_rel, 'ext/*/*.hh'),
241 join_paths(root_rel, 'gst/*/*.[ch]'),
242 join_paths(root_rel, 'gst/rtmp2/*/*.[ch]'),
244 dependencies: [gst_dep, plugins],
246 disable_incremental_build: true,
247 gst_cache_file: plugins_cache,
248 gst_c_source_filters: excludes,
249 gst_order_generated_subpages: true,
250 gst_plugin_name: plugin_name,
251 include_paths: join_paths(meson.current_source_dir(), '..'),