Add the URL attribute to cricket::Candiate. (Objc wrapper)

The url of the ICE server is added to the IceCandiate class.
This can be used to tell which server this candidate was gathered from.

BUG=webrtc:7128

Review-Url: https://codereview.webrtc.org/2688943003
Cr-Commit-Position: refs/heads/master@{#16652}
This commit is contained in:
zhihuang
2017-02-16 11:29:39 -08:00
committed by Commit bot
parent dbeeb701a2
commit d7e771da7b
4 changed files with 19 additions and 5 deletions

View File

@ -20,6 +20,7 @@
@synthesize sdpMid = _sdpMid;
@synthesize sdpMLineIndex = _sdpMLineIndex;
@synthesize sdp = _sdp;
@synthesize serverUrl = _serverUrl;
- (instancetype)initWithSdp:(NSString *)sdp
sdpMLineIndex:(int)sdpMLineIndex
@ -34,10 +35,11 @@
}
- (NSString *)description {
return [NSString stringWithFormat:@"RTCIceCandidate:\n%@\n%d\n%@",
return [NSString stringWithFormat:@"RTCIceCandidate:\n%@\n%d\n%@\n%@",
_sdpMid,
_sdpMLineIndex,
_sdp];
_sdp,
_serverUrl];
}
#pragma mark - Private
@ -48,9 +50,12 @@
std::string sdp;
candidate->ToString(&sdp);
return [self initWithSdp:[NSString stringForStdString:sdp]
sdpMLineIndex:candidate->sdp_mline_index()
sdpMid:[NSString stringForStdString:candidate->sdp_mid()]];
RTCIceCandidate *rtcCandidate =
[self initWithSdp:[NSString stringForStdString:sdp]
sdpMLineIndex:candidate->sdp_mline_index()
sdpMid:[NSString stringForStdString:candidate->sdp_mid()]];
rtcCandidate->_serverUrl = [NSString stringForStdString:candidate->server_url()];
return rtcCandidate;
}
- (std::unique_ptr<webrtc::IceCandidateInterface>)nativeCandidate {