webrtc: Use nice implementation for WebRTCICE 63/287363/1
authorSangchul Lee <sc11.lee@samsung.com>
Fri, 27 Jan 2023 07:45:12 +0000 (16:45 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Fri, 27 Jan 2023 07:45:12 +0000 (16:45 +0900)
Change-Id: I414d9dfca5e679efc2d93ca7abd1b82a91f6f3aa

packaging/gstreamer.spec
subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
subprojects/gst-plugins-bad/ext/webrtc/meson.build
subprojects/gst-plugins-bad/gst-libs/gst/webrtc/meson.build

index 84902f0..e4dfabb 100644 (file)
@@ -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
 
index a8499af..afa1d05 100644 (file)
@@ -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,
index 74108b4..151cb9a 100644 (file)
@@ -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]
+
index a0d30e0..7501212 100644 (file)
@@ -101,3 +101,5 @@ gstwebrtc_dep = declare_dependency(link_with: gstwebrtc,
   dependencies: gstwebrtc_dependencies)
 
 meson.override_dependency(pkg_name, gstwebrtc_dep)
+
+subdir('nice')