OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 - (NSString *)description { | 44 - (NSString *)description { |
45 return [NSString stringWithFormat:@"RTCIceServer:\n%@\n%@\n%@", | 45 return [NSString stringWithFormat:@"RTCIceServer:\n%@\n%@\n%@", |
46 _urlStrings, | 46 _urlStrings, |
47 _username, | 47 _username, |
48 _credential]; | 48 _credential]; |
49 } | 49 } |
50 | 50 |
51 #pragma mark - Private | 51 #pragma mark - Private |
52 | 52 |
53 - (webrtc::PeerConnectionInterface::IceServer)iceServer { | 53 - (webrtc::PeerConnectionInterface::IceServer)nativeServer { |
54 __block webrtc::PeerConnectionInterface::IceServer iceServer; | 54 __block webrtc::PeerConnectionInterface::IceServer iceServer; |
55 | 55 |
56 iceServer.username = [NSString stdStringForString:_username]; | 56 iceServer.username = [NSString stdStringForString:_username]; |
57 iceServer.password = [NSString stdStringForString:_credential]; | 57 iceServer.password = [NSString stdStringForString:_credential]; |
58 | 58 |
59 [_urlStrings enumerateObjectsUsingBlock:^(NSString *url, | 59 [_urlStrings enumerateObjectsUsingBlock:^(NSString *url, |
60 NSUInteger idx, | 60 NSUInteger idx, |
61 BOOL *stop) { | 61 BOOL *stop) { |
62 iceServer.urls.push_back(url.stdString); | 62 iceServer.urls.push_back(url.stdString); |
63 }]; | 63 }]; |
64 return iceServer; | 64 return iceServer; |
65 } | 65 } |
66 | 66 |
67 - (instancetype)initWithNativeServer: | 67 - (instancetype)initWithNativeServer: |
68 (webrtc::PeerConnectionInterface::IceServer)nativeServer { | 68 (webrtc::PeerConnectionInterface::IceServer)nativeServer { |
69 NSMutableArray *urls = | 69 NSMutableArray *urls = |
70 [NSMutableArray arrayWithCapacity:nativeServer.urls.size()]; | 70 [NSMutableArray arrayWithCapacity:nativeServer.urls.size()]; |
71 for (auto const &url : nativeServer.urls) { | 71 for (auto const &url : nativeServer.urls) { |
72 [urls addObject:[NSString stringForStdString:url]]; | 72 [urls addObject:[NSString stringForStdString:url]]; |
73 } | 73 } |
74 NSString *username = [NSString stringForStdString:nativeServer.username]; | 74 NSString *username = [NSString stringForStdString:nativeServer.username]; |
75 NSString *credential = [NSString stringForStdString:nativeServer.password]; | 75 NSString *credential = [NSString stringForStdString:nativeServer.password]; |
76 self = [self initWithURLStrings:urls | 76 self = [self initWithURLStrings:urls |
77 username:username | 77 username:username |
78 credential:credential]; | 78 credential:credential]; |
79 return self; | 79 return self; |
80 } | 80 } |
81 | 81 |
82 @end | 82 @end |
OLD | NEW |