From 211928ca41d69ee7052b8a886a3156fae63f0d71 Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Wed, 31 May 2023 17:33:46 +0200 Subject: [PATCH] webrtc/nice: put usage of OPTION_CONSENT_FRESHNESS behind check See https://gitlab.freedesktop.org/libnice/libnice/-/merge_requests/257 Part-of: --- .../gst-plugins-bad/gst-libs/gst/webrtc/nice/meson.build | 3 +++ subprojects/gst-plugins-bad/gst-libs/gst/webrtc/nice/nice.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/webrtc/nice/meson.build b/subprojects/gst-plugins-bad/gst-libs/gst/webrtc/nice/meson.build index 2b1586bbb6..6f9c94a0f2 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/webrtc/nice/meson.build +++ b/subprojects/gst-plugins-bad/gst-libs/gst/webrtc/nice/meson.build @@ -22,6 +22,9 @@ deps = [gstwebrtc_dep, libnice_dep] if libnice_dep.found() libnice_version = libnice_dep.version() libnice_c_args = [] + if libnice_version.version_compare('> 0.1.21.1') + libnice_c_args += '-DHAVE_LIBNICE_CONSENT_FIX' + 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, diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/webrtc/nice/nice.c b/subprojects/gst-plugins-bad/gst-libs/gst/webrtc/nice/nice.c index 1779f1fb13..ce15cb6cf0 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/webrtc/nice/nice.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/webrtc/nice/nice.c @@ -1627,7 +1627,11 @@ gst_webrtc_nice_constructed (GObject * object) options |= NICE_AGENT_OPTION_ICE_TRICKLE; options |= NICE_AGENT_OPTION_REGULAR_NOMINATION; + +/* https://gitlab.freedesktop.org/libnice/libnice/-/merge_requests/257 */ +#if HAVE_LIBNICE_CONSENT_FIX options |= NICE_AGENT_OPTION_CONSENT_FRESHNESS; +#endif ice->priv->nice_agent = nice_agent_new_full (ice->priv->main_context, NICE_COMPATIBILITY_RFC5245, options);