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)updateICEServers:(NSArray*)servers | 211 - (BOOL)setConfiguration:(RTCConfiguration *)configuration { |
212 constraints:(RTCMediaConstraints*)constraints { | 212 return self.peerConnection->SetConfiguration( |
213 webrtc::PeerConnectionInterface::IceServers iceServers; | 213 configuration.nativeConfiguration); |
214 for (RTCICEServer* server in servers) { | |
215 iceServers.push_back(server.iceServer); | |
216 } | |
217 return self.peerConnection->UpdateIce(iceServers, constraints.constraints); | |
218 } | 214 } |
219 | 215 |
220 - (RTCSessionDescription*)localDescription { | 216 - (RTCSessionDescription*)localDescription { |
221 const webrtc::SessionDescriptionInterface* sdi = | 217 const webrtc::SessionDescriptionInterface* sdi = |
222 self.peerConnection->local_description(); | 218 self.peerConnection->local_description(); |
223 return sdi ? [[RTCSessionDescription alloc] initWithSessionDescription:sdi] | 219 return sdi ? [[RTCSessionDescription alloc] initWithSessionDescription:sdi] |
224 : nil; | 220 : nil; |
225 } | 221 } |
226 | 222 |
227 - (NSArray*)localStreams { | 223 - (NSArray*)localStreams { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 _delegate = delegate; | 294 _delegate = delegate; |
299 } | 295 } |
300 return self; | 296 return self; |
301 } | 297 } |
302 | 298 |
303 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)peerConnection { | 299 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)peerConnection { |
304 return _peerConnection; | 300 return _peerConnection; |
305 } | 301 } |
306 | 302 |
307 @end | 303 @end |
OLD | NEW |