Chromium Code Reviews| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 #include "content/renderer/p2p/filtering_network_manager.h" | 48 #include "content/renderer/p2p/filtering_network_manager.h" |
| 49 #include "content/renderer/p2p/ipc_network_manager.h" | 49 #include "content/renderer/p2p/ipc_network_manager.h" |
| 50 #include "content/renderer/p2p/ipc_socket_factory.h" | 50 #include "content/renderer/p2p/ipc_socket_factory.h" |
| 51 #include "content/renderer/p2p/port_allocator.h" | 51 #include "content/renderer/p2p/port_allocator.h" |
| 52 #include "content/renderer/render_frame_impl.h" | 52 #include "content/renderer/render_frame_impl.h" |
| 53 #include "content/renderer/render_thread_impl.h" | 53 #include "content/renderer/render_thread_impl.h" |
| 54 #include "content/renderer/render_view_impl.h" | 54 #include "content/renderer/render_view_impl.h" |
| 55 #include "crypto/openssl_util.h" | 55 #include "crypto/openssl_util.h" |
| 56 #include "jingle/glue/thread_wrapper.h" | 56 #include "jingle/glue/thread_wrapper.h" |
| 57 #include "media/base/media_permission.h" | 57 #include "media/base/media_permission.h" |
| 58 #include "media/filters/ffmpeg_glue.h" | |
| 58 #include "media/renderers/gpu_video_accelerator_factories.h" | 59 #include "media/renderers/gpu_video_accelerator_factories.h" |
| 59 #include "third_party/WebKit/public/platform/WebMediaConstraints.h" | 60 #include "third_party/WebKit/public/platform/WebMediaConstraints.h" |
| 60 #include "third_party/WebKit/public/platform/WebMediaStream.h" | 61 #include "third_party/WebKit/public/platform/WebMediaStream.h" |
| 61 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" | 62 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" |
| 62 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 63 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
| 63 #include "third_party/WebKit/public/platform/WebURL.h" | 64 #include "third_party/WebKit/public/platform/WebURL.h" |
| 64 #include "third_party/WebKit/public/web/WebDocument.h" | 65 #include "third_party/WebKit/public/web/WebDocument.h" |
| 65 #include "third_party/WebKit/public/web/WebFrame.h" | 66 #include "third_party/WebKit/public/web/WebFrame.h" |
| 66 #include "third_party/libjingle/source/talk/app/webrtc/mediaconstraintsinterface .h" | 67 #include "third_party/libjingle/source/talk/app/webrtc/mediaconstraintsinterface .h" |
| 67 #include "third_party/webrtc/base/ssladapter.h" | 68 #include "third_party/webrtc/base/ssladapter.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 252 DCHECK(!pc_factory_.get()); | 253 DCHECK(!pc_factory_.get()); |
| 253 DCHECK(!signaling_thread_); | 254 DCHECK(!signaling_thread_); |
| 254 DCHECK(!worker_thread_); | 255 DCHECK(!worker_thread_); |
| 255 DCHECK(!network_manager_); | 256 DCHECK(!network_manager_); |
| 256 DCHECK(!socket_factory_); | 257 DCHECK(!socket_factory_); |
| 257 DCHECK(!chrome_signaling_thread_.IsRunning()); | 258 DCHECK(!chrome_signaling_thread_.IsRunning()); |
| 258 DCHECK(!chrome_worker_thread_.IsRunning()); | 259 DCHECK(!chrome_worker_thread_.IsRunning()); |
| 259 | 260 |
| 260 DVLOG(1) << "PeerConnectionDependencyFactory::CreatePeerConnectionFactory()"; | 261 DVLOG(1) << "PeerConnectionDependencyFactory::CreatePeerConnectionFactory()"; |
| 261 | 262 |
| 263 #if defined(WEBRTC_USE_H264) | |
| 264 // When building with |rtc_use_h264|, FFmpeg must be initialized externally | |
| 265 // from WebRTC before any |H264DecoderImpl| is initialized. By initializing | |
| 266 // here we guarantee that FFmpeg has been initialized before any decoders are | |
| 267 // used. | |
|
tommi (sloooow) - chröme
2016/02/01 17:51:20
"must be initialized externally from WebRTC" is a
hbos_chromium
2016/02/02 14:20:12
Done.
| |
| 268 media::FFmpegGlue::InitializeFFmpeg(); | |
| 269 #endif | |
| 270 | |
| 262 base::MessageLoop::current()->AddDestructionObserver(this); | 271 base::MessageLoop::current()->AddDestructionObserver(this); |
| 263 // To allow sending to the signaling/worker threads. | 272 // To allow sending to the signaling/worker threads. |
| 264 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); | 273 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); |
| 265 jingle_glue::JingleThreadWrapper::current()->set_send_allowed(true); | 274 jingle_glue::JingleThreadWrapper::current()->set_send_allowed(true); |
| 266 | 275 |
| 267 CHECK(chrome_signaling_thread_.Start()); | 276 CHECK(chrome_signaling_thread_.Start()); |
| 268 CHECK(chrome_worker_thread_.Start()); | 277 CHECK(chrome_worker_thread_.Start()); |
| 269 | 278 |
| 270 base::WaitableEvent start_worker_event(true, false); | 279 base::WaitableEvent start_worker_event(true, false); |
| 271 chrome_worker_thread_.task_runner()->PostTask( | 280 chrome_worker_thread_.task_runner()->PostTask( |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 774 } | 783 } |
| 775 | 784 |
| 776 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { | 785 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { |
| 777 if (audio_device_.get()) | 786 if (audio_device_.get()) |
| 778 return; | 787 return; |
| 779 | 788 |
| 780 audio_device_ = new WebRtcAudioDeviceImpl(); | 789 audio_device_ = new WebRtcAudioDeviceImpl(); |
| 781 } | 790 } |
| 782 | 791 |
| 783 } // namespace content | 792 } // namespace content |
| OLD | NEW |