From: Philippe Normand Date: Wed, 11 May 2022 08:15:33 +0000 (+0100) Subject: webrtc: Ensure the NICE_CHECK_VERSION macro is available X-Git-Tag: 1.22.0~1565 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=08021caa73e00850c13ecfbdb819f6a131f996d0;p=platform%2Fupstream%2Fgstreamer.git 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: --- diff --git a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcice.c b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcice.c index 5e796e1..9f2dc68 100644 --- a/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcice.c +++ b/subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcice.c @@ -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? diff --git a/subprojects/gst-plugins-bad/ext/webrtc/meson.build b/subprojects/gst-plugins-bad/ext/webrtc/meson.build index ded8cb8..f69b4a7 100644 --- a/subprojects/gst-plugins-bad/ext/webrtc/meson.build +++ b/subprojects/gst-plugins-bad/ext/webrtc/meson.build @@ -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],