docs: generate documentation for libgstopencv
authorMathieu Duponchelle <mathieu@centricular.com>
Sat, 20 Jun 2020 23:32:29 +0000 (01:32 +0200)
committerThibault Saunier <tsaunier@igalia.com>
Tue, 23 Jun 2020 16:10:17 +0000 (12:10 -0400)
docs/libs/opencv/index.md [new file with mode: 0644]
docs/libs/opencv/sitemap.txt [new file with mode: 0644]
docs/meson.build
gst-libs/gst/opencv/meson.build

diff --git a/docs/libs/opencv/index.md b/docs/libs/opencv/index.md
new file mode 100644 (file)
index 0000000..552662b
--- /dev/null
@@ -0,0 +1,7 @@
+# Opencv Library
+
+This library should be linked to by getting cflags and libs from
+gstreamer-plugins-bad-{{ gst_api_version.md }}.pc and adding
+-lgstopencv-{{ gst_api_version.md }} to the library flags.
+
+> NOTE: This library API is considered *unstable*
diff --git a/docs/libs/opencv/sitemap.txt b/docs/libs/opencv/sitemap.txt
new file mode 100644 (file)
index 0000000..e3577f1
--- /dev/null
@@ -0,0 +1 @@
+c-index
index 94023d511e3f0d363013ff145babaf11769f227e..35a86d0a20b46948153e83813e792c78214ecde1 100644 (file)
@@ -111,6 +111,7 @@ if build_gir
         {'name': 'player', 'gir': player_gir, 'lib': gstplayer_dep},
         {'name': 'insertbin', 'gir': insertbin_gir, 'lib': gstinsertbin_dep},
         {'name': 'codecparsers', 'lib': gstcodecparsers_dep},
+        {'name': 'opencv', 'lib': gstopencv_dep, 'c_source_patterns': ['*.h', '*.cpp'], 'extra_c_flags': ['-x c++']},
         {'name': 'adaptivedemux', 'lib': gstadaptivedemux_dep},
         {'name': 'webrtc', 'gir': webrtc_gir, 'lib': gstwebrtc_dep, 'suffix': 'lib'},
         {'name': 'audio', 'gir': audio_gir, 'lib': gstbadaudio_dep, 'prefix': 'bad-'},
@@ -125,6 +126,13 @@ libs_doc = []
 foreach lib_def: libs
   name = lib_def['name']
   lib = lib_def['lib']
+
+  c_source_patterns = lib_def.get('c_source_patterns', ['*.[hc]'])
+  c_sources = []
+  foreach pattern: c_source_patterns
+    c_sources += join_paths(root_rel, 'gst-libs/gst', name, pattern)
+  endforeach
+
     if lib_def.has_key('gir')
         if has_gi_extension
             gir = lib_def['gir']
@@ -132,7 +140,7 @@ foreach lib_def: libs
             suffix = lib_def.get('suffix', '')
             libs_doc += [hotdoc.generate_doc(prefix + name + suffix,
                 project_version: api_version,
-                gi_c_sources: [join_paths(root_rel, 'gst-libs/gst', name, '*.[hc]')],
+                gi_c_sources: c_sources,
                 gi_sources: gir[0].full_path(),
                 gi_c_source_filters: excludes,
                 sitemap: join_paths('libs', name, 'sitemap.txt'),
@@ -151,12 +159,12 @@ foreach lib_def: libs
                 sitemap: join_paths('libs', name, 'sitemap.txt'),
                 index: join_paths('libs', name, 'index.md'),
                 project_version: api_version,
-                c_sources: [join_paths(root_rel, 'gst-libs/gst/', name, '*.[hc]')],
+                c_sources: c_sources,
                 c_source_filters: excludes,
                 c_index: join_paths('libs', name, 'index.md'),
                 c_smart_index: true,
                 c_order_generated_subpages: true,
-                extra_c_flags: ' -DGST_USE_UNSTABLE_API',
+                extra_c_flags: ['-DGST_USE_UNSTABLE_API'] + lib_def.get('extra_c_flags', []),
                 dependencies: lib,
                 install: false,
             )]
index f659d57786d1caeb33594b9acab0e3ad60d1e13c..80b0531aa09cd061b1c47631c38d00b6a5aae603 100644 (file)
@@ -33,4 +33,6 @@ if opencv_dep.found()
   install_headers(opencv_headers, subdir : 'gstreamer-1.0/gst/opencv')
 elif get_option('opencv').enabled()
   error('OpenCV support enabled but required dependencies were not found.')
+else
+  gstopencv_dep = disabler()
 endif