webrtc: Change requirement to libnice 0.1.20
authorOlivier Crête <olivier.crete@collabora.com>
Fri, 6 Jan 2023 20:07:42 +0000 (15:07 -0500)
committerOlivier Crête <olivier.crete@ocrete.ca>
Sat, 7 Jan 2023 16:03:23 +0000 (16:03 +0000)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3676>

subprojects/gst-plugins-bad/gst-libs/gst/webrtc/nice/meson.build
subprojects/gst-plugins-bad/gst-libs/gst/webrtc/nice/nice.c
subprojects/libnice.wrap

index 7dc7030..2b1586b 100644 (file)
@@ -13,7 +13,7 @@ libgstwebrtcnice_headers = files([
 
 libgstwebrtcnice_dep = dependency('', required : false)
 
-libnice_dep = dependency('nice', version : '>=0.1.17', required : get_option('webrtc'),
+libnice_dep = dependency('nice', version : '>=0.1.20', required : get_option('webrtc'),
                          fallback : ['libnice', 'libnice_dep'],
                          default_options: ['tests=disabled'])
 
@@ -22,21 +22,6 @@ deps = [gstwebrtc_dep, libnice_dep]
 if libnice_dep.found()
   libnice_version = libnice_dep.version()
   libnice_c_args = []
-  if libnice_version.version_compare('<0.1.20') or libnice_version.version_compare('<0.1.19.1')
-    version_arr = libnice_version.split('.')
-    libnice_version_major = version_arr[0]
-    libnice_version_minor = version_arr[1]
-    libnice_version_micro = version_arr[2]
-    if version_arr.length() == 4
-      libnice_version_nano = version_arr[3]
-    else
-      libnice_version_nano = '0'
-    endif
-    libnice_c_args = ['-DNICE_VERSION_MAJOR=' + libnice_version_major,
-                      '-DNICE_VERSION_MINOR=' + libnice_version_minor,
-                      '-DNICE_VERSION_MICRO=' + libnice_version_micro,
-                      '-DNICE_VERSION_NANO=' + libnice_version_nano ]
-  endif
   libgstwebrtcnice = library('gstwebrtcnice-' + api_version,
     libgstwebrtcnice_sources, libgstwebrtcnice_headers,
     c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API', '-DBUILDING_GST_WEBRTCNICE', '-DG_LOG_DOMAIN="GStreamer-webrtcnice"'] + libnice_c_args,
index defc97c..0cbb61a 100644 (file)
 /* libnice */
 #include <agent.h>
 
-#ifndef NICE_CHECK_VERSION
-#define NICE_CHECK_VERSION(major,minor,micro)                                \
-  (NICE_VERSION_MAJOR > (major) ||                                             \
-   (NICE_VERSION_MAJOR == (major) && NICE_VERSION_MINOR > (minor)) ||          \
-   (NICE_VERSION_MAJOR == (major) && NICE_VERSION_MINOR == (minor) &&          \
-    NICE_VERSION_MICRO >= (micro)))
-#endif
-
 #define HTTP_PROXY_PORT_DEFAULT 3128
 
 /* XXX:
@@ -1122,24 +1114,13 @@ _get_server_url (GstWebRTCNice * ice, NiceCandidate * cand)
 {
   switch (cand->type) {
     case NICE_CANDIDATE_TYPE_RELAYED:{
-#if NICE_CHECK_VERSION(0, 1, 19)
       NiceAddress addr;
       gchar ipaddr[NICE_ADDRESS_STRING_LEN];
       nice_candidate_relay_address (cand, &addr);
       nice_address_to_string (&addr, ipaddr);
       return g_strdup (ipaddr);
-#else
-      static gboolean warned = FALSE;
-      if (!warned) {
-        GST_WARNING
-            ("libnice version < 0.1.19 detected, relayed candidate server address might be wrong.");
-        warned = TRUE;
-      }
-      return g_strdup (gst_uri_get_host (ice->priv->turn_server));
-#endif
     }
     case NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE:{
-#if NICE_CHECK_VERSION(0, 1, 20)
       NiceAddress addr;
       gchar ipaddr[NICE_ADDRESS_STRING_LEN];
       if (nice_candidate_stun_server_address (cand, &addr)) {
@@ -1148,15 +1129,6 @@ _get_server_url (GstWebRTCNice * ice, NiceCandidate * cand)
       } else {
         return g_strdup (gst_uri_get_host (ice->priv->stun_server));
       }
-#else
-      static gboolean warned = FALSE;
-      if (!warned) {
-        GST_WARNING
-            ("libnice version < 0.1.20 detected, server-reflexive candidate server "
-            "address might be wrong.");
-        warned = TRUE;
-      }
-#endif
       return g_strdup (gst_uri_get_host (ice->priv->stun_server));
     }
     default:
index bed7434..eeed32d 100644 (file)
@@ -1,4 +1,4 @@
 [wrap-git]
 directory=libnice
 url=https://gitlab.freedesktop.org/libnice/libnice.git
-revision=0.1.19
+revision=0.1.21