From 2b9984031cf7c929a9e0c2e5185954dbed6fdafe Mon Sep 17 00:00:00 2001 From: Sangchul Lee Date: Fri, 27 Jan 2023 16:45:12 +0900 Subject: [PATCH] webrtc: Use nice implementation for WebRTCICE Change-Id: I414d9dfca5e679efc2d93ca7abd1b82a91f6f3aa --- packaging/gstreamer.spec | 2 ++ .../gst-plugins-bad/ext/webrtc/gstwebrtcbin.c | 2 +- subprojects/gst-plugins-bad/ext/webrtc/meson.build | 32 +++++++++++----------- .../gst-libs/gst/webrtc/meson.build | 2 ++ 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/packaging/gstreamer.spec b/packaging/gstreamer.spec index 84902f0..e4dfabb 100644 --- a/packaging/gstreamer.spec +++ b/packaging/gstreamer.spec @@ -1156,6 +1156,7 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/libgstwayland-%{gst_branch}.so.0* %endif %{_libdir}/libgstwebrtc-%{gst_branch}.so.0* +%{_libdir}/libgstwebrtcnice-%{gst_branch}.so.0* %exclude %{_bindir}/gst-transcoder-%{gst_branch} %exclude %{_libdir}/debug/* @@ -1227,6 +1228,7 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/pkgconfig/gstreamer-wayland-%{gst_branch}.pc %endif %{_libdir}/pkgconfig/gstreamer-webrtc-%{gst_branch}.pc +%{_libdir}/pkgconfig/gstreamer-webrtc-nice-%{gst_branch}.pc %endif # plugin diff --git a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c index a8499af..afa1d05 100644 --- a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c +++ b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c @@ -8539,7 +8539,7 @@ gst_webrtc_bin_constructed (GObject * object) if (!webrtc->priv->ice) { name = g_strdup_printf ("%s:ice", GST_OBJECT_NAME (webrtc)); -// webrtc->priv->ice = GST_WEBRTC_ICE (gst_webrtc_nice_new (name)); + webrtc->priv->ice = GST_WEBRTC_ICE (gst_webrtc_nice_new (name)); g_free (name); } gst_webrtc_ice_set_on_ice_candidate (webrtc->priv->ice, diff --git a/subprojects/gst-plugins-bad/ext/webrtc/meson.build b/subprojects/gst-plugins-bad/ext/webrtc/meson.build index 74108b4..151cb9a 100644 --- a/subprojects/gst-plugins-bad/ext/webrtc/meson.build +++ b/subprojects/gst-plugins-bad/ext/webrtc/meson.build @@ -12,20 +12,20 @@ webrtc_sources = [ 'webrtcdatachannel.c', ] -libnice_dep = dependency('nice', version : '>=0.1.17', required : get_option('webrtc'), - fallback : ['libnice', 'libnice_dep'], - default_options: ['tests=disabled']) - -if libnice_dep.found() - gstwebrtc_plugin = library('gstwebrtc', - webrtc_sources, - c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API'], - include_directories : [configinc], - dependencies : [gio_dep, libnice_dep, gstbase_dep, gstsdp_dep, - gstapp_dep, gstwebrtc_dep, gstsctp_dep, gstrtp_dep], - install : true, - install_dir : plugins_install_dir, - ) - pkgconfig.generate(gstwebrtc_plugin, install_dir : plugins_pkgconfig_install_dir) - plugins += [gstwebrtc_plugin] +webrtc_option = get_option('webrtc').require( + libgstwebrtcnice_dep.found(), error_message: 'webrtc plugin requires libgstwebrtcnice.') +if webrtc_option.disabled() + subdir_done() endif + +gstwebrtc_plugin = library('gstwebrtc', + webrtc_sources, + c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API'], + include_directories : [configinc], + dependencies : [gstbase_dep, gstsdp_dep, + gstapp_dep, gstwebrtc_dep, gstsctp_dep, gstrtp_dep, gio_dep, libgstwebrtcnice_dep], + install : true, + install_dir : plugins_install_dir, +) +plugins += [gstwebrtc_plugin] + diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/webrtc/meson.build b/subprojects/gst-plugins-bad/gst-libs/gst/webrtc/meson.build index a0d30e0..7501212 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/webrtc/meson.build +++ b/subprojects/gst-plugins-bad/gst-libs/gst/webrtc/meson.build @@ -101,3 +101,5 @@ gstwebrtc_dep = declare_dependency(link_with: gstwebrtc, dependencies: gstwebrtc_dependencies) meson.override_dependency(pkg_name, gstwebrtc_dep) + +subdir('nice') -- 2.7.4