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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 | 272 |
273 - (instancetype)initWithFactory:(webrtc::PeerConnectionFactoryInterface*)factory | 273 - (instancetype)initWithFactory:(webrtc::PeerConnectionFactoryInterface*)factory |
274 iceServers:(const webrtc::PeerConnectionInterface::IceServers&)iceServers | 274 iceServers:(const webrtc::PeerConnectionInterface::IceServers&)iceServers |
275 constraints:(const webrtc::MediaConstraintsInterface*)constraints { | 275 constraints:(const webrtc::MediaConstraintsInterface*)constraints { |
276 NSParameterAssert(factory != nullptr); | 276 NSParameterAssert(factory != nullptr); |
277 if (self = [super init]) { | 277 if (self = [super init]) { |
278 webrtc::PeerConnectionInterface::RTCConfiguration config; | 278 webrtc::PeerConnectionInterface::RTCConfiguration config; |
279 config.servers = iceServers; | 279 config.servers = iceServers; |
280 _observer.reset(new webrtc::RTCPeerConnectionObserver(self)); | 280 _observer.reset(new webrtc::RTCPeerConnectionObserver(self)); |
281 _peerConnection = factory->CreatePeerConnection( | 281 _peerConnection = factory->CreatePeerConnection( |
282 config, | 282 config, constraints, nullptr, nullptr, _observer.get()); |
283 constraints, | |
284 nullptr, | |
285 std::unique_ptr<rtc::RTCCertificateGeneratorInterface>(), | |
286 _observer.get()); | |
287 _localStreams = [[NSMutableArray alloc] init]; | 283 _localStreams = [[NSMutableArray alloc] init]; |
288 } | 284 } |
289 return self; | 285 return self; |
290 } | 286 } |
291 | 287 |
292 - (instancetype)initWithFactory:(webrtc::PeerConnectionFactoryInterface *)factor
y | 288 - (instancetype)initWithFactory:(webrtc::PeerConnectionFactoryInterface *)factor
y |
293 config:(const webrtc::PeerConnectionInterface::RTCConfi
guration &)config | 289 config:(const webrtc::PeerConnectionInterface::RTCConfi
guration &)config |
294 constraints:(const webrtc::MediaConstraintsInterface *)const
raints | 290 constraints:(const webrtc::MediaConstraintsInterface *)const
raints |
295 delegate:(id<RTCPeerConnectionDelegate>)delegate { | 291 delegate:(id<RTCPeerConnectionDelegate>)delegate { |
296 NSParameterAssert(factory); | 292 NSParameterAssert(factory); |
297 if (self = [super init]) { | 293 if (self = [super init]) { |
298 _observer.reset(new webrtc::RTCPeerConnectionObserver(self)); | 294 _observer.reset(new webrtc::RTCPeerConnectionObserver(self)); |
299 _peerConnection = | 295 _peerConnection = |
300 factory->CreatePeerConnection( | 296 factory->CreatePeerConnection(config, constraints, nullptr, nullptr, _ob
server.get()); |
301 config, | |
302 constraints, | |
303 nullptr, | |
304 std::unique_ptr<rtc::RTCCertificateGeneratorInterface>(), | |
305 _observer.get()); | |
306 _localStreams = [[NSMutableArray alloc] init]; | 297 _localStreams = [[NSMutableArray alloc] init]; |
307 _delegate = delegate; | 298 _delegate = delegate; |
308 } | 299 } |
309 return self; | 300 return self; |
310 } | 301 } |
311 | 302 |
312 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)peerConnection { | 303 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)peerConnection { |
313 return _peerConnection; | 304 return _peerConnection; |
314 } | 305 } |
315 | 306 |
316 @end | 307 @end |
OLD | NEW |