| 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 observer, mediaStreamTrack.mediaTrack, nativeOutputLevel); | 264 observer, mediaStreamTrack.mediaTrack, nativeOutputLevel); |
| 265 } | 265 } |
| 266 | 266 |
| 267 @end | 267 @end |
| 268 | 268 |
| 269 @implementation RTCPeerConnection (Internal) | 269 @implementation RTCPeerConnection (Internal) |
| 270 | 270 |
| 271 - (instancetype)initWithFactory:(webrtc::PeerConnectionFactoryInterface*)factory | 271 - (instancetype)initWithFactory:(webrtc::PeerConnectionFactoryInterface*)factory |
| 272 iceServers:(const webrtc::PeerConnectionInterface::IceServers&)iceServers | 272 iceServers:(const webrtc::PeerConnectionInterface::IceServers&)iceServers |
| 273 constraints:(const webrtc::MediaConstraintsInterface*)constraints { | 273 constraints:(const webrtc::MediaConstraintsInterface*)constraints { |
| 274 NSParameterAssert(factory != NULL); | 274 NSParameterAssert(factory != nullptr); |
| 275 if (self = [super init]) { | 275 if (self = [super init]) { |
| 276 webrtc::PeerConnectionInterface::RTCConfiguration config; |
| 277 config.servers = iceServers; |
| 276 _observer.reset(new webrtc::RTCPeerConnectionObserver(self)); | 278 _observer.reset(new webrtc::RTCPeerConnectionObserver(self)); |
| 277 _peerConnection = factory->CreatePeerConnection( | 279 _peerConnection = factory->CreatePeerConnection( |
| 278 iceServers, constraints, NULL, NULL, _observer.get()); | 280 config, constraints, nullptr, nullptr, _observer.get()); |
| 279 _localStreams = [[NSMutableArray alloc] init]; | 281 _localStreams = [[NSMutableArray alloc] init]; |
| 280 } | 282 } |
| 281 return self; | 283 return self; |
| 282 } | 284 } |
| 283 | 285 |
| 284 - (instancetype)initWithFactory:(webrtc::PeerConnectionFactoryInterface *)factor
y | 286 - (instancetype)initWithFactory:(webrtc::PeerConnectionFactoryInterface *)factor
y |
| 285 config:(const webrtc::PeerConnectionInterface::RTCConfi
guration &)config | 287 config:(const webrtc::PeerConnectionInterface::RTCConfi
guration &)config |
| 286 constraints:(const webrtc::MediaConstraintsInterface *)const
raints | 288 constraints:(const webrtc::MediaConstraintsInterface *)const
raints |
| 287 delegate:(id<RTCPeerConnectionDelegate>)delegate { | 289 delegate:(id<RTCPeerConnectionDelegate>)delegate { |
| 288 NSParameterAssert(factory); | 290 NSParameterAssert(factory); |
| 289 if (self = [super init]) { | 291 if (self = [super init]) { |
| 290 _observer.reset(new webrtc::RTCPeerConnectionObserver(self)); | 292 _observer.reset(new webrtc::RTCPeerConnectionObserver(self)); |
| 291 _peerConnection = | 293 _peerConnection = |
| 292 factory->CreatePeerConnection(config, constraints, nullptr, nullptr, _ob
server.get()); | 294 factory->CreatePeerConnection(config, constraints, nullptr, nullptr, _ob
server.get()); |
| 293 _localStreams = [[NSMutableArray alloc] init]; | 295 _localStreams = [[NSMutableArray alloc] init]; |
| 294 _delegate = delegate; | 296 _delegate = delegate; |
| 295 } | 297 } |
| 296 return self; | 298 return self; |
| 297 } | 299 } |
| 298 | 300 |
| 299 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)peerConnection { | 301 - (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)peerConnection { |
| 300 return _peerConnection; | 302 return _peerConnection; |
| 301 } | 303 } |
| 302 | 304 |
| 303 @end | 305 @end |
| OLD | NEW |