From da37473a54616433f65c4ec7d6e80792315a2e56 Mon Sep 17 00:00:00 2001 From: Guido Urdaneta Date: Fri, 25 Jan 2019 10:36:43 +0100 Subject: [PATCH] Make webrtc::ParseCandidate() public. This is intended to be used in Blink to implement proper support for the JavaScript RTCIceCandidate API. Bug: chromium:683094 Change-Id: I93d117ef1bd9541593f2715bdf3291dc2941737f Reviewed-on: https://webrtc-review.googlesource.com/c/119940 Reviewed-by: Harald Alvestrand Commit-Queue: Guido Urdaneta Cr-Commit-Position: refs/heads/master@{#26404} --- pc/webrtc_sdp.cc | 4 ---- pc/webrtc_sdp.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pc/webrtc_sdp.cc b/pc/webrtc_sdp.cc index 094525a8b6..1b2ff158b4 100644 --- a/pc/webrtc_sdp.cc +++ b/pc/webrtc_sdp.cc @@ -335,10 +335,6 @@ static bool ParseFmtpParam(const std::string& line, std::string* parameter, std::string* value, SdpParseError* error); -static bool ParseCandidate(const std::string& message, - Candidate* candidate, - SdpParseError* error, - bool is_raw); static bool ParseRtcpFbAttribute(const std::string& line, const cricket::MediaType media_type, MediaContentDescription* media_desc, diff --git a/pc/webrtc_sdp.h b/pc/webrtc_sdp.h index 1d1e7aa4e6..3ba5c7f2be 100644 --- a/pc/webrtc_sdp.h +++ b/pc/webrtc_sdp.h @@ -84,6 +84,17 @@ RTC_EXPORT bool SdpDeserializeCandidate(const std::string& transport_name, cricket::Candidate* candidate, SdpParseError* error); +// Parses |message| according to the grammar defined in RFC 5245, Section 15.1 +// and, if successful, stores the result in |candidate| and returns true. +// If unsuccessful, returns false and stores error information in |error| if +// |error| is not null. +// If |is_raw| is false, |message| is expected to be prefixed with "a=". +// If |is_raw| is true, no prefix is expected in |messaage|. +RTC_EXPORT bool ParseCandidate(const std::string& message, + cricket::Candidate* candidate, + SdpParseError* error, + bool is_raw); + } // namespace webrtc #endif // PC_WEBRTC_SDP_H_