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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 - (void)setRemoteDescriptionWithDelegate: | 204 - (void)setRemoteDescriptionWithDelegate: |
205 (id<RTCSessionDescriptionDelegate>)delegate | 205 (id<RTCSessionDescriptionDelegate>)delegate |
206 sessionDescription:(RTCSessionDescription*)sdp { | 206 sessionDescription:(RTCSessionDescription*)sdp { |
207 rtc::scoped_refptr<webrtc::RTCSetSessionDescriptionObserver> observer( | 207 rtc::scoped_refptr<webrtc::RTCSetSessionDescriptionObserver> observer( |
208 new rtc::RefCountedObject<webrtc::RTCSetSessionDescriptionObserver>( | 208 new rtc::RefCountedObject<webrtc::RTCSetSessionDescriptionObserver>( |
209 delegate, self)); | 209 delegate, self)); |
210 self.peerConnection->SetRemoteDescription(observer, sdp.sessionDescription); | 210 self.peerConnection->SetRemoteDescription(observer, sdp.sessionDescription); |
211 } | 211 } |
212 | 212 |
213 - (BOOL)setConfiguration:(RTCConfiguration *)configuration { | 213 - (BOOL)setConfiguration:(RTCConfiguration *)configuration { |
214 return self.peerConnection->SetConfiguration( | 214 std::unique_ptr<webrtc::PeerConnectionInterface::RTCConfiguration> config( |
215 configuration.nativeConfiguration); | 215 [configuration createNativeConfiguration]); |
| 216 if (!config) { |
| 217 return NO; |
| 218 } |
| 219 return self.peerConnection->SetConfiguration(*config); |
216 } | 220 } |
217 | 221 |
218 - (RTCSessionDescription*)localDescription { | 222 - (RTCSessionDescription*)localDescription { |
219 const webrtc::SessionDescriptionInterface* sdi = | 223 const webrtc::SessionDescriptionInterface* sdi = |
220 self.peerConnection->local_description(); | 224 self.peerConnection->local_description(); |
221 return sdi ? [[RTCSessionDescription alloc] initWithSessionDescription:sdi] | 225 return sdi ? [[RTCSessionDescription alloc] initWithSessionDescription:sdi] |
222 : nil; | 226 : nil; |
223 } | 227 } |
224 | 228 |
225 - (NSArray*)localStreams { | 229 - (NSArray*)localStreams { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 _delegate = delegate; | 302 _delegate = delegate; |
299 } | 303 } |
300 return self; | 304 return self; |
301 } | 305 } |
302 | 306 |
303 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)peerConnection { | 307 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)peerConnection { |
304 return _peerConnection; | 308 return _peerConnection; |
305 } | 309 } |
306 | 310 |
307 @end | 311 @end |
OLD | NEW |