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.')
12 required_hotdoc_extensions = ['gi-extension', 'c-extension', 'gst-extension']
13 if gst_dep.type_name() == 'internal'
14 gst_proj = subproject('gstreamer')
15 plugins_cache_generator = gst_proj.get_variable('plugins_cache_generator')
17 plugins_cache_generator = find_program(join_paths(gst_dep.get_pkgconfig_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'),
21 plugins_cache = join_paths(meson.current_source_dir(), 'plugins', 'gst_plugins_cache.json')
23 if plugins.length() == 0
24 message('All bad plugins have been disabled')
25 elif plugins_cache_generator.found()
26 plugins_doc_dep = custom_target('bad-plugins-doc-cache',
27 command: [plugins_cache_generator, plugins_cache, '@OUTPUT@', '@INPUT@'],
29 output: 'gst_plugins_cache.json',
30 build_always_stale: true,
33 warning('GStreamer plugin inspector for documentation not found, can\'t update the cache')
36 hotdoc_p = find_program('hotdoc', required: get_option('doc'))
37 if not hotdoc_p.found()
38 message('Hotdoc not found, not building the documentation')
42 hotdoc_req = '>= 0.11.0'
43 hotdoc_version = run_command(hotdoc_p, '--version').stdout()
44 if not hotdoc_version.version_compare(hotdoc_req)
45 if get_option('doc').enabled()
46 error('Hotdoc version @0@ not found, got @1@'.format(hotdoc_req, hotdoc_version))
48 message('Hotdoc version @0@ not found, got @1@'.format(hotdoc_req, hotdoc_version))
53 hotdoc = import('hotdoc')
54 foreach extension: required_hotdoc_extensions
55 if not hotdoc.has_extensions(extension)
56 if get_option('doc').enabled()
57 error('Documentation enabled but @0@ missing'.format(extension))
60 message('@0@ extensions not found, not building documentation requiring it'.format(extension))
65 if get_option('doc').enabled()
66 error('Documentation enabled but introspection not built.')
69 message('Introspection not built, won\'t build documentation requiring it')
75 docconf = configuration_data()
76 docconf.set('GST_API_VERSION', api_version)
78 configure_file(input : 'gst_api_version.in',
79 output : 'gst_api_version.md',
80 configuration : docconf)
85 'gst/frei0r/frei0r.h',
87 'gst-libs/gst/*/*-private.h',
88 'gst-libs/gst/codecparsers/nalutils.h',
89 'ext/closedcaption/bcd.h',
90 'ext/closedcaption/bit_slicer.[ch]',
91 'ext/closedcaption/decoder.[ch]',
92 'ext/closedcaption/macros.h',
93 'ext/closedcaption/misc.h',
94 'ext/closedcaption/raw_decoder.[ch]',
95 'ext/closedcaption/sampling_par.[ch]',
96 'ext/closedcaption/sliced.[ch]',
100 'gst-libs/gst/*/*-prelude.h',
101 'gst-libs/gst/vulkan/vulkan_fwd.h'
103 excludes += [join_paths(meson.current_source_dir(), root_rel, f)]
109 {'name': 'mpegts', 'gir': mpegts_gir, 'lib': gstmpegts_dep},
110 {'name': 'play', 'gir': play_gir, 'lib': gstplay_dep},
111 {'name': 'player', 'gir': player_gir, 'lib': gstplayer_dep},
112 {'name': 'insertbin', 'gir': insertbin_gir, 'lib': gstinsertbin_dep},
113 {'name': 'codecparsers', 'lib': gstcodecparsers_dep},
114 {'name': 'adaptivedemux', 'lib': gstadaptivedemux_dep},
115 {'name': 'basecamerabinsrc', 'gir': basecamerabin_gir, 'lib': gstbasecamerabin_dep},
116 {'name': 'webrtc', 'gir': webrtc_gir, 'lib': gstwebrtc_dep, 'suffix': 'lib'},
117 {'name': 'audio', 'gir': audio_gir, 'lib': gstbadaudio_dep, 'prefix': 'bad-'},
118 {'name': 'transcoder', 'gir': transcoder_gir, 'lib': gst_transcoder_dep},
119 {'name': 'codecs', 'gir': codecs_gir, 'lib': gstcodecs_dep},
122 if gstopencv_dep.found()
124 {'name': 'opencv', 'lib': gstopencv_dep, 'c_source_patterns': ['*.h', '*.cpp'], 'extra_c_flags': ['-x c++']},
128 if gstvulkan_dep.found()
130 {'name': 'vulkan', 'gir': vulkan_gir, 'lib': gstvulkan_dep, 'suffix': 'lib'},
132 if enabled_vulkan_winsys.contains('xcb')
134 {'name': 'vulkan-xcb', 'gir': vulkan_xcb_gir, 'lib': gstvulkanxcb_dep, 'extra_sources' : [
135 join_paths(root_rel, 'gst-libs/gst/vulkan/xcb/gstvkdisplay_xcb.[ch]'),
139 if enabled_vulkan_winsys.contains('wayland')
141 {'name': 'vulkan-wayland', 'gir': vulkan_wayland_gir, 'lib': gstvulkanwayland_dep, 'extra_sources' : [
142 join_paths(root_rel, 'gst-libs/gst/vulkan/wayland/gstvkdisplay_wayland.[ch]'),
149 has_gi_extension = hotdoc.has_extensions('gi-extension')
150 has_c_extension = hotdoc.has_extensions('c-extension')
152 foreach lib_def: libs
153 name = lib_def['name']
155 extra_sources = lib_def.get('extra_sources', [])
157 c_source_patterns = lib_def.get('c_source_patterns', ['*.[hc]'])
159 foreach pattern: c_source_patterns
160 c_sources += join_paths(root_rel, 'gst-libs/gst', name, pattern)
162 c_sources += extra_sources
164 if lib_def.has_key('gir')
167 prefix = lib_def.get('prefix', '')
168 suffix = lib_def.get('suffix', '')
169 libs_doc += [hotdoc.generate_doc(prefix + name + suffix,
170 project_version: api_version,
171 gi_c_sources: c_sources,
172 gi_sources: gir[0].full_path(),
173 gi_c_source_filters: excludes,
174 sitemap: join_paths('libs', name, 'sitemap.txt'),
175 index: join_paths('libs/', name, 'index.md'),
176 gi_index: join_paths('libs/', name, 'index.md'),
177 gi_smart_index: true,
178 gi_order_generated_subpages: true,
179 dependencies: [lib, gir],
180 c_flags: '-DGST_USE_UNSTABLE_API',
186 libs_doc += [hotdoc.generate_doc('gst-plugins-bad-' + name,
187 sitemap: join_paths('libs', name, 'sitemap.txt'),
188 index: join_paths('libs', name, 'index.md'),
189 project_version: api_version,
190 c_sources: c_sources,
191 c_source_filters: excludes,
192 c_index: join_paths('libs', name, 'index.md'),
194 c_order_generated_subpages: true,
195 extra_c_flags: ['-DGST_USE_UNSTABLE_API'] + lib_def.get('extra_c_flags', []),
203 list_plugin_res = run_command(python3, '-c',
208 with open("@0@") as f:
209 print(':'.join(json.load(f).keys()), end='')
210 '''.format(plugins_cache))
212 assert(list_plugin_res.returncode() == 0,
213 'Could not list plugins from @0@'.format(plugins_cache))
216 foreach plugin_name: list_plugin_res.stdout().split(':')
217 plugins_doc += [hotdoc.generate_doc(plugin_name,
218 project_version: api_version,
219 sitemap: 'plugins/sitemap.txt',
220 index: 'plugins/index.md',
221 c_flags: '-DGST_USE_UNSTABLE_API',
222 gst_index: 'plugins/index.md',
223 gst_smart_index: true,
225 join_paths(root_rel, 'sys/*/*.[ch]'),
226 join_paths(root_rel, 'sys/*/*.cpp'),
227 join_paths(root_rel, 'sys/*/*.cc'),
228 join_paths(root_rel, 'sys/*/*.hh'),
229 join_paths(root_rel, 'ext/*/*.[ch]'),
230 join_paths(root_rel, 'ext/*/*.cpp'),
231 join_paths(root_rel, 'ext/*/*.cc'),
232 join_paths(root_rel, 'ext/*/*.hh'),
233 join_paths(root_rel, 'gst/*/*.[ch]'),
234 join_paths(root_rel, 'gst/rtmp2/*/*.[ch]'),
236 dependencies: [gst_dep, plugins],
238 disable_incremental_build: true,
239 gst_cache_file: plugins_cache,
240 gst_c_source_filters: excludes,
241 gst_order_generated_subpages: true,
242 gst_plugin_name: plugin_name,
243 include_paths: join_paths(meson.current_source_dir(), '..'),