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_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 gst_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', check: false).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]',
105 'ext/lv2/gstlv2utils.h',
106 'ext/closedcaption/hamm.h',
107 'ext/closedcaption/io-sim.h',
108 'ext/avtp/gstavtpcrfbase.h',
109 'sys/nvcodec/nvEncodeAPI.h',
110 'sys/nvcodec/cuviddec.h',
111 'sys/nvcodec/nvcuvid.h',
112 'sys/winks/ksvideohelpers.h',
113 'gst/videoparsers/gstjpeg2000parse.h',
114 'gst-libs/gst/*/*-prelude.h',
115 'gst-libs/gst/vulkan/vulkan_fwd.h'
117 excludes += [join_paths(meson.current_source_dir(), root_rel, f)]
123 {'name': 'mpegts', 'gir': mpegts_gir, 'lib': gstmpegts_dep},
124 {'name': 'play', 'gir': play_gir, 'lib': gstplay_dep},
125 {'name': 'player', 'gir': player_gir, 'lib': gstplayer_dep},
126 {'name': 'insertbin', 'gir': insertbin_gir, 'lib': gstinsertbin_dep},
127 {'name': 'codecparsers', 'lib': gstcodecparsers_dep},
128 {'name': 'adaptivedemux', 'lib': gstadaptivedemux_dep},
129 {'name': 'basecamerabinsrc', 'gir': basecamerabin_gir, 'lib': gstbasecamerabin_dep},
130 {'name': 'webrtc', 'gir': webrtc_gir, 'lib': gstwebrtc_dep, 'suffix': 'lib'},
131 {'name': 'audio', 'gir': audio_gir, 'lib': gstbadaudio_dep, 'prefix': 'bad-'},
132 {'name': 'transcoder', 'gir': transcoder_gir, 'lib': gst_transcoder_dep},
133 {'name': 'codecs', 'gir': codecs_gir, 'lib': gstcodecs_dep},
134 {'name': 'cuda', 'gir': gst_cuda_gir, 'lib': gstcuda_dep},
137 if gstopencv_dep.found()
139 {'name': 'opencv', 'lib': gstopencv_dep, 'c_source_patterns': ['*.h', '*.cpp'], 'extra_c_flags': ['-x c++']},
144 libs += [{'name': 'va', 'gir': va_gir, 'lib': gstva_dep, 'suffix': 'lib'}]
147 if gstvulkan_dep.found()
149 {'name': 'vulkan', 'gir': vulkan_gir, 'lib': gstvulkan_dep, 'suffix': 'lib'},
151 if enabled_vulkan_winsys.contains('xcb')
153 {'name': 'vulkan-xcb', 'gir': vulkan_xcb_gir, 'lib': gstvulkanxcb_dep, 'extra_sources' : [
154 join_paths(root_rel, 'gst-libs/gst/vulkan/xcb/gstvkdisplay_xcb.[ch]'),
158 if enabled_vulkan_winsys.contains('wayland')
160 {'name': 'vulkan-wayland', 'gir': vulkan_wayland_gir, 'lib': gstvulkanwayland_dep, 'extra_sources' : [
161 join_paths(root_rel, 'gst-libs/gst/vulkan/wayland/gstvkdisplay_wayland.[ch]'),
168 has_gi_extension = hotdoc.has_extensions('gi-extension')
169 has_c_extension = hotdoc.has_extensions('c-extension')
171 foreach lib_def: libs
172 name = lib_def['name']
174 extra_sources = lib_def.get('extra_sources', [])
176 c_source_patterns = lib_def.get('c_source_patterns', ['*.[hc]'])
178 foreach pattern: c_source_patterns
179 c_sources += join_paths(root_rel, 'gst-libs/gst', name, pattern)
181 c_sources += extra_sources
183 if lib_def.has_key('gir')
186 prefix = lib_def.get('prefix', '')
187 suffix = lib_def.get('suffix', '')
188 libs_doc += [hotdoc.generate_doc(prefix + name + suffix,
189 project_version: api_version,
190 gi_c_sources: c_sources,
191 gi_sources: gir[0].full_path(),
192 gi_c_source_filters: excludes,
193 sitemap: join_paths('libs', name, 'sitemap.txt'),
194 index: join_paths('libs/', name, 'index.md'),
195 gi_index: join_paths('libs/', name, 'index.md'),
196 gi_smart_index: true,
197 gi_order_generated_subpages: true,
198 dependencies: [lib, gir],
199 c_flags: '-DGST_USE_UNSTABLE_API',
206 libs_doc += [hotdoc.generate_doc('gst-plugins-bad-' + name,
207 sitemap: join_paths('libs', name, 'sitemap.txt'),
208 index: join_paths('libs', name, 'index.md'),
209 project_version: api_version,
210 c_sources: c_sources,
211 c_source_filters: excludes,
212 c_index: join_paths('libs', name, 'index.md'),
214 c_order_generated_subpages: true,
215 extra_c_flags: ['-DGST_USE_UNSTABLE_API'] + lib_def.get('extra_c_flags', []),
223 list_plugin_res = run_command(python3, '-c',
228 with open("@0@") as f:
229 print(':'.join(json.load(f).keys()), end='')
230 '''.format(plugins_cache),
234 foreach plugin_name: list_plugin_res.stdout().split(':')
235 plugins_doc += [hotdoc.generate_doc(plugin_name,
236 project_version: api_version,
237 sitemap: 'plugins/sitemap.txt',
238 index: 'plugins/index.md',
239 c_flags: '-DGST_USE_UNSTABLE_API',
240 gst_index: 'plugins/index.md',
241 gst_smart_index: true,
243 join_paths(root_rel, 'sys/*/*.[cmh]'),
244 join_paths(root_rel, 'sys/*/*.cpp'),
245 join_paths(root_rel, 'sys/*/*.cc'),
246 join_paths(root_rel, 'sys/*/*.mm'),
247 join_paths(root_rel, 'sys/*/*.hh'),
248 join_paths(root_rel, 'ext/*/*.[ch]'),
249 join_paths(root_rel, 'ext/*/*.cpp'),
250 join_paths(root_rel, 'ext/*/*.cc'),
251 join_paths(root_rel, 'ext/*/*.hh'),
252 join_paths(root_rel, 'gst/*/*.[ch]'),
253 join_paths(root_rel, 'gst/rtmp2/*/*.[ch]'),
255 dependencies: [gst_dep],
257 disable_incremental_build: true,
258 gst_cache_file: plugins_cache,
259 gst_c_source_filters: excludes,
260 gst_order_generated_subpages: true,
261 gst_plugin_name: plugin_name,
262 include_paths: join_paths(meson.current_source_dir(), '..'),