OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 - (void)setRemoteDescriptionWithDelegate: | 202 - (void)setRemoteDescriptionWithDelegate: |
203 (id<RTCSessionDescriptionDelegate>)delegate | 203 (id<RTCSessionDescriptionDelegate>)delegate |
204 sessionDescription:(RTCSessionDescription*)sdp { | 204 sessionDescription:(RTCSessionDescription*)sdp { |
205 rtc::scoped_refptr<webrtc::RTCSetSessionDescriptionObserver> observer( | 205 rtc::scoped_refptr<webrtc::RTCSetSessionDescriptionObserver> observer( |
206 new rtc::RefCountedObject<webrtc::RTCSetSessionDescriptionObserver>( | 206 new rtc::RefCountedObject<webrtc::RTCSetSessionDescriptionObserver>( |
207 delegate, self)); | 207 delegate, self)); |
208 self.peerConnection->SetRemoteDescription(observer, sdp.sessionDescription); | 208 self.peerConnection->SetRemoteDescription(observer, sdp.sessionDescription); |
209 } | 209 } |
210 | 210 |
211 - (BOOL)setConfiguration:(RTCConfiguration *)configuration { | 211 - (BOOL)updateICEServers:(NSArray*)servers |
212 return self.peerConnection->SetConfiguration( | 212 constraints:(RTCMediaConstraints*)constraints { |
213 configuration.nativeConfiguration); | 213 webrtc::PeerConnectionInterface::IceServers iceServers; |
| 214 for (RTCICEServer* server in servers) { |
| 215 iceServers.push_back(server.iceServer); |
| 216 } |
| 217 return self.peerConnection->UpdateIce(iceServers, constraints.constraints); |
214 } | 218 } |
215 | 219 |
216 - (RTCSessionDescription*)localDescription { | 220 - (RTCSessionDescription*)localDescription { |
217 const webrtc::SessionDescriptionInterface* sdi = | 221 const webrtc::SessionDescriptionInterface* sdi = |
218 self.peerConnection->local_description(); | 222 self.peerConnection->local_description(); |
219 return sdi ? [[RTCSessionDescription alloc] initWithSessionDescription:sdi] | 223 return sdi ? [[RTCSessionDescription alloc] initWithSessionDescription:sdi] |
220 : nil; | 224 : nil; |
221 } | 225 } |
222 | 226 |
223 - (NSArray*)localStreams { | 227 - (NSArray*)localStreams { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 _delegate = delegate; | 298 _delegate = delegate; |
295 } | 299 } |
296 return self; | 300 return self; |
297 } | 301 } |
298 | 302 |
299 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)peerConnection { | 303 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)peerConnection { |
300 return _peerConnection; | 304 return _peerConnection; |
301 } | 305 } |
302 | 306 |
303 @end | 307 @end |
OLD | NEW |