diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2018-03-15 12:04:00 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2018-03-15 16:37:04 +0200 |
commit | b35b01ad090970439462f1c60e85d9f74f17452c (patch) | |
tree | 1f8f6f1f0a171bf570cfb7efce6513f2d923cb30 /gst-libs | |
parent | 7da65ab6d5474f754bb0dc0c4b6dc4e560211387 (diff) |
webrtc: Add gobject-introspection integration
https://bugzilla.gnome.org/show_bug.cgi?id=794347
Diffstat (limited to 'gst-libs')
-rw-r--r-- | gst-libs/gst/webrtc/Makefile.am | 54 | ||||
-rw-r--r-- | gst-libs/gst/webrtc/meson.build | 19 |
2 files changed, 72 insertions, 1 deletions
diff --git a/gst-libs/gst/webrtc/Makefile.am b/gst-libs/gst/webrtc/Makefile.am index 49bb95a01..660bc606f 100644 --- a/gst-libs/gst/webrtc/Makefile.am +++ b/gst-libs/gst/webrtc/Makefile.am @@ -52,3 +52,57 @@ libgstwebrtc_@GST_API_VERSION@_la_LDFLAGS = \ $(GST_LT_LDFLAGS) include $(top_srcdir)/common/gst-glib-gen.mak + +if HAVE_INTROSPECTION +BUILT_GIRSOURCES = GstWebRTC-@GST_API_VERSION@.gir + +gir_headers=$(patsubst %,$(srcdir)/%, $(libgstwebrtc_@GST_API_VERSION@include_HEADERS)) +gir_sources=$(patsubst %,$(srcdir)/%, $(libgstwebrtc_@GST_API_VERSION@_la_SOURCES)) + +GstWebRTC-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstwebrtc-@GST_API_VERSION@.la + $(AM_V_GEN)GST_PLUGIN_SYSTEM_PATH_1_0="" GST_PLUGIN_PATH_1_0="" GST_REGISTRY_UPDATE=no GI_SCANNER_DISABLE_CACHE=yes \ + CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" CC="$(CC)" PKG_CONFIG="$(PKG_CONFIG)" DLLTOOL="$(DLLTOOL)" \ + PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" \ + $(INTROSPECTION_SCANNER) -v --namespace GstWebRTC \ + --nsversion=@GST_API_VERSION@ \ + --warn-all \ + --strip-prefix=Gst \ + -I$(top_srcdir)/gst-libs \ + -I$(top_builddir)/gst-libs \ + --c-include "gst/webrtc/webrtc.h" \ + --add-include-path=$(top_builddir)/gst-libs \ + --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-1.0` \ + --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-sdp-1.0` \ + --library-path=$(top_builddir)/gst-libs \ + --library=libgstwebrtc-@GST_API_VERSION@.la \ + --include=Gst-@GST_API_VERSION@ \ + --include=GstSdp-@GST_API_VERSION@ \ + --libtool="${LIBTOOL}" \ + --pkg gstreamer-@GST_API_VERSION@ \ + --pkg gstreamer-sdp-@GST_API_VERSION@ \ + --pkg-export gstreamer-webrtc-@GST_API_VERSION@ \ + --add-init-section="$(INTROSPECTION_INIT)" \ + --output $@ \ + $(gir_headers) \ + $(gir_sources) + +# INTROSPECTION_GIRDIR/INTROSPECTION_TYPELIBDIR aren't the right place to +# install anything - we need to install inside our prefix. +girdir = $(datadir)/gir-1.0 +gir_DATA = $(BUILT_GIRSOURCES) + +typelibsdir = $(libdir)/girepository-1.0/ + +typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib) + +%.typelib: %.gir $(INTROSPECTION_COMPILER) + $(AM_V_GEN)PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" \ + $(INTROSPECTION_COMPILER) \ + --includedir=$(srcdir)/gst-libs \ + --includedir=$(builddir)/gst-libs \ + --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-1.0` \ + --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-sdp-1.0` \ + $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F) + +CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA) +endif diff --git a/gst-libs/gst/webrtc/meson.build b/gst-libs/gst/webrtc/meson.build index c670eadb5..820cf96c5 100644 --- a/gst-libs/gst/webrtc/meson.build +++ b/gst-libs/gst/webrtc/meson.build @@ -40,7 +40,7 @@ gstwebrtc_c = custom_target('gstwebrtcenum_c', command : [mkenums, glib_mkenums, '@OUTPUT@', '@INPUT@']) webrtc_gen_sources = [gstwebrtc_h] -gstwebrtc_dependencies = [gstbase_dep, gstpbutils_dep, gstsdp_dep] +gstwebrtc_dependencies = [gstbase_dep, gstsdp_dep] gstwebrtc = library('gstwebrtc-' + api_version, webrtc_sources, gstwebrtc_c, gstwebrtc_h, @@ -52,8 +52,25 @@ gstwebrtc = library('gstwebrtc-' + api_version, dependencies : gstwebrtc_dependencies, ) +if build_gir + webrtc_gir = gnome.generate_gir(gstwebrtc, + sources : gstwebrtc_sources + gstwebrtc_headers, + namespace : 'GstWebRTC', + nsversion : api_version, + identifier_prefix : 'Gst', + symbol_prefix : 'gst', + export_packages : 'gstreamer-webrtc-1.0', + includes : ['Gst-1.0', 'GstSdp-1.0'], + install : true, + extra_args : gir_init_section + ['-DGST_USE_UNSTABLE_API'] + ['--c-include=gst/webrtc/webrtc.h'], + dependencies : [gstbase_dep, gstsdp_dep] + ) + webrtc_gen_sources += webrtc_gir +endif + install_headers(webrtc_headers, subdir : 'gstreamer-1.0/gst/webrtc') gstwebrtc_dep = declare_dependency(link_with: gstwebrtc, include_directories : libsinc, + sources: webrtc_gen_sources, dependencies: gstwebrtc_dependencies) |