webrtc: Ensure the NICE_CHECK_VERSION macro is available

This macro was introduced in libnice 0.1.19.1, so until we bump our libnice
dependency to 0.1.20 we have to vendor the macro.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1998>
This commit is contained in:
Philippe Normand 2022-05-11 09:15:33 +01:00 committed by GStreamer Marge Bot
parent c19319c777
commit 08021caa73
2 changed files with 28 additions and 1 deletions

View file

@ -27,6 +27,16 @@
#include "icestream.h"
#include "nicetransport.h"
#ifndef NICE_CHECH_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)) || \
(NICE_VERSION_MAJOR == (major) && NICE_VERSION_MINOR == (minor) && \
NICE_VERSION_MICRO + 1 == (micro) && NICE_VERSION_NANO > 0))
#endif
/* XXX:
*
* - are locally generated remote candidates meant to be readded to libnice?

View file

@ -20,9 +20,26 @@ libnice_dep = dependency('nice', version : '>=0.1.17', required : get_option('we
default_options: ['tests=disabled'])
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
gstwebrtc_plugin = library('gstwebrtc',
webrtc_sources,
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API'],
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API'] + libnice_c_args,
include_directories : [configinc],
dependencies : [gstbase_dep, gstsdp_dep,
gstapp_dep, gstwebrtc_dep, gstsctp_dep, gstrtp_dep, libnice_dep, gio_dep],