From 19dea1507e6cde458c40df396b510d0bad2b8a4e Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Sat, 15 Feb 2025 11:15:31 +0000 Subject: [PATCH] webrtc: nice: Make use of nice_candidate_type_to_string This API was added in libnice 0.1.19 and we currently require 0.1.20. Part-of: --- .../gst-libs/gst/webrtc/nice/nice.c | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) 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 f023c6b6b8..6ff684880f 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 @@ -1072,28 +1072,6 @@ _get_server_url (GstWebRTCNice * ice, NiceCandidate * cand) } } -/* TODO: replace it with nice_candidate_type_to_string() - * when it's ready for use - * https://libnice.freedesktop.org/libnice/NiceCandidate.html#nice-candidate-type-to-string - */ -static const gchar * -_candidate_type_to_string (NiceCandidateType type) -{ - switch (type) { - case NICE_CANDIDATE_TYPE_HOST: - return "host"; - case NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE: - return "srflx"; - case NICE_CANDIDATE_TYPE_PEER_REFLEXIVE: - return "prflx"; - case NICE_CANDIDATE_TYPE_RELAYED: - return "relay"; - default: - g_assert_not_reached (); - return NULL; - } -} - static void _populate_candidate_stats (GstWebRTCNice * ice, NiceCandidate * cand, GstWebRTCICEStream * stream, GstWebRTCICECandidateStats * stats, @@ -1107,7 +1085,7 @@ _populate_candidate_stats (GstWebRTCNice * ice, NiceCandidate * cand, stats->port = nice_address_get_port (&cand->addr); stats->ipaddr = g_strdup (ipaddr); stats->stream_id = stream->stream_id; - stats->type = _candidate_type_to_string (cand->type); + stats->type = nice_candidate_type_to_string (cand->type); stats->prio = cand->priority; stats->proto = cand->transport == NICE_CANDIDATE_TRANSPORT_UDP ? "udp" : "tcp";