| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 #include "media/base/media_permission.h" | 54 #include "media/base/media_permission.h" |
| 55 #include "media/filters/ffmpeg_glue.h" | 55 #include "media/filters/ffmpeg_glue.h" |
| 56 #include "media/renderers/gpu_video_accelerator_factories.h" | 56 #include "media/renderers/gpu_video_accelerator_factories.h" |
| 57 #include "third_party/WebKit/public/platform/WebMediaConstraints.h" | 57 #include "third_party/WebKit/public/platform/WebMediaConstraints.h" |
| 58 #include "third_party/WebKit/public/platform/WebMediaStream.h" | 58 #include "third_party/WebKit/public/platform/WebMediaStream.h" |
| 59 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" | 59 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" |
| 60 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 60 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
| 61 #include "third_party/WebKit/public/platform/WebURL.h" | 61 #include "third_party/WebKit/public/platform/WebURL.h" |
| 62 #include "third_party/WebKit/public/web/WebDocument.h" | 62 #include "third_party/WebKit/public/web/WebDocument.h" |
| 63 #include "third_party/WebKit/public/web/WebFrame.h" | 63 #include "third_party/WebKit/public/web/WebFrame.h" |
| 64 #include "third_party/webrtc/api/dtlsidentitystore.h" | |
| 65 #include "third_party/webrtc/api/mediaconstraintsinterface.h" | 64 #include "third_party/webrtc/api/mediaconstraintsinterface.h" |
| 66 #include "third_party/webrtc/base/ssladapter.h" | 65 #include "third_party/webrtc/base/ssladapter.h" |
| 67 #include "third_party/webrtc/modules/video_coding/codecs/h264/include/h264.h" | 66 #include "third_party/webrtc/modules/video_coding/codecs/h264/include/h264.h" |
| 68 | 67 |
| 69 #if defined(OS_ANDROID) | 68 #if defined(OS_ANDROID) |
| 70 #include "media/base/android/media_codec_util.h" | 69 #include "media/base/android/media_codec_util.h" |
| 71 #endif | 70 #endif |
| 72 | 71 |
| 73 namespace content { | 72 namespace content { |
| 74 | 73 |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 std::unique_ptr<P2PPortAllocator> port_allocator(new P2PPortAllocator( | 401 std::unique_ptr<P2PPortAllocator> port_allocator(new P2PPortAllocator( |
| 403 p2p_socket_dispatcher_, std::move(network_manager), socket_factory_.get(), | 402 p2p_socket_dispatcher_, std::move(network_manager), socket_factory_.get(), |
| 404 port_config, requesting_origin, chrome_worker_thread_.task_runner())); | 403 port_config, requesting_origin, chrome_worker_thread_.task_runner())); |
| 405 | 404 |
| 406 return GetPcFactory() | 405 return GetPcFactory() |
| 407 ->CreatePeerConnection(config, std::move(port_allocator), | 406 ->CreatePeerConnection(config, std::move(port_allocator), |
| 408 std::move(identity_store), observer) | 407 std::move(identity_store), observer) |
| 409 .get(); | 408 .get(); |
| 410 } | 409 } |
| 411 | 410 |
| 412 // static | |
| 413 rtc::scoped_refptr<rtc::RTCCertificate> | |
| 414 PeerConnectionDependencyFactory::GenerateDefaultCertificate() { | |
| 415 std::unique_ptr<rtc::SSLIdentity> identity(rtc::SSLIdentity::Generate( | |
| 416 webrtc::kIdentityName, rtc::KeyParams::ECDSA(rtc::EC_NIST_P256))); | |
| 417 return rtc::RTCCertificate::Create(std::move(identity)); | |
| 418 } | |
| 419 | |
| 420 scoped_refptr<webrtc::MediaStreamInterface> | 411 scoped_refptr<webrtc::MediaStreamInterface> |
| 421 PeerConnectionDependencyFactory::CreateLocalMediaStream( | 412 PeerConnectionDependencyFactory::CreateLocalMediaStream( |
| 422 const std::string& label) { | 413 const std::string& label) { |
| 423 return GetPcFactory()->CreateLocalMediaStream(label).get(); | 414 return GetPcFactory()->CreateLocalMediaStream(label).get(); |
| 424 } | 415 } |
| 425 | 416 |
| 426 scoped_refptr<webrtc::VideoTrackInterface> | 417 scoped_refptr<webrtc::VideoTrackInterface> |
| 427 PeerConnectionDependencyFactory::CreateLocalVideoTrack( | 418 PeerConnectionDependencyFactory::CreateLocalVideoTrack( |
| 428 const std::string& id, | 419 const std::string& id, |
| 429 webrtc::VideoTrackSourceInterface* source) { | 420 webrtc::VideoTrackSourceInterface* source) { |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 | 576 |
| 586 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { | 577 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { |
| 587 DCHECK(CalledOnValidThread()); | 578 DCHECK(CalledOnValidThread()); |
| 588 if (audio_device_.get()) | 579 if (audio_device_.get()) |
| 589 return; | 580 return; |
| 590 | 581 |
| 591 audio_device_ = new WebRtcAudioDeviceImpl(); | 582 audio_device_ = new WebRtcAudioDeviceImpl(); |
| 592 } | 583 } |
| 593 | 584 |
| 594 } // namespace content | 585 } // namespace content |
| OLD | NEW |