OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" | 5 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
368 aec_dump_message_filter_->AddDelegate(this); | 368 aec_dump_message_filter_->AddDelegate(this); |
369 } | 369 } |
370 } | 370 } |
371 | 371 |
372 bool PeerConnectionDependencyFactory::PeerConnectionFactoryCreated() { | 372 bool PeerConnectionDependencyFactory::PeerConnectionFactoryCreated() { |
373 return pc_factory_.get() != NULL; | 373 return pc_factory_.get() != NULL; |
374 } | 374 } |
375 | 375 |
376 scoped_refptr<webrtc::PeerConnectionInterface> | 376 scoped_refptr<webrtc::PeerConnectionInterface> |
377 PeerConnectionDependencyFactory::CreatePeerConnection( | 377 PeerConnectionDependencyFactory::CreatePeerConnection( |
378 const webrtc::PeerConnectionInterface::IceServers& ice_servers, | 378 const webrtc::PeerConnectionInterface::RTCConfiguration& config, |
vrk (LEFT CHROMIUM)
2014/07/23 01:13:05
Is the old PeerConnection constructor still suppor
jiayl
2014/07/23 16:11:12
No, RTCConfiguration contains IceServers, there is
| |
379 const webrtc::MediaConstraintsInterface* constraints, | 379 const webrtc::MediaConstraintsInterface* constraints, |
380 blink::WebFrame* web_frame, | 380 blink::WebFrame* web_frame, |
381 webrtc::PeerConnectionObserver* observer) { | 381 webrtc::PeerConnectionObserver* observer) { |
382 CHECK(web_frame); | 382 CHECK(web_frame); |
383 CHECK(observer); | 383 CHECK(observer); |
384 if (!GetPcFactory()) | 384 if (!GetPcFactory()) |
385 return NULL; | 385 return NULL; |
386 | 386 |
387 scoped_refptr<P2PPortAllocatorFactory> pa_factory = | 387 scoped_refptr<P2PPortAllocatorFactory> pa_factory = |
388 new talk_base::RefCountedObject<P2PPortAllocatorFactory>( | 388 new talk_base::RefCountedObject<P2PPortAllocatorFactory>( |
389 p2p_socket_dispatcher_.get(), | 389 p2p_socket_dispatcher_.get(), |
390 network_manager_, | 390 network_manager_, |
391 socket_factory_.get(), | 391 socket_factory_.get(), |
392 web_frame); | 392 web_frame); |
393 | 393 |
394 PeerConnectionIdentityService* identity_service = | 394 PeerConnectionIdentityService* identity_service = |
395 new PeerConnectionIdentityService( | 395 new PeerConnectionIdentityService( |
396 GURL(web_frame->document().url().spec()).GetOrigin()); | 396 GURL(web_frame->document().url().spec()).GetOrigin()); |
397 | 397 |
398 return GetPcFactory()->CreatePeerConnection(ice_servers, | 398 return GetPcFactory()->CreatePeerConnection(config, |
399 constraints, | 399 constraints, |
400 pa_factory.get(), | 400 pa_factory.get(), |
401 identity_service, | 401 identity_service, |
402 observer).get(); | 402 observer).get(); |
403 } | 403 } |
404 | 404 |
405 scoped_refptr<webrtc::MediaStreamInterface> | 405 scoped_refptr<webrtc::MediaStreamInterface> |
406 PeerConnectionDependencyFactory::CreateLocalMediaStream( | 406 PeerConnectionDependencyFactory::CreateLocalMediaStream( |
407 const std::string& label) { | 407 const std::string& label) { |
408 return GetPcFactory()->CreateLocalMediaStream(label).get(); | 408 return GetPcFactory()->CreateLocalMediaStream(label).get(); |
409 } | 409 } |
410 | 410 |
411 scoped_refptr<webrtc::AudioSourceInterface> | 411 scoped_refptr<webrtc::AudioSourceInterface> |
412 PeerConnectionDependencyFactory::CreateLocalAudioSource( | 412 PeerConnectionDependencyFactory::CreateLocalAudioSource( |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
656 } | 656 } |
657 | 657 |
658 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { | 658 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { |
659 if (audio_device_) | 659 if (audio_device_) |
660 return; | 660 return; |
661 | 661 |
662 audio_device_ = new WebRtcAudioDeviceImpl(); | 662 audio_device_ = new WebRtcAudioDeviceImpl(); |
663 } | 663 } |
664 | 664 |
665 } // namespace content | 665 } // namespace content |
OLD | NEW |