| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 #include "content/renderer/media/webrtc_logging.h" | 45 #include "content/renderer/media/webrtc_logging.h" |
| 46 #include "content/renderer/media/webrtc_uma_histograms.h" | 46 #include "content/renderer/media/webrtc_uma_histograms.h" |
| 47 #include "content/renderer/p2p/empty_network_manager.h" | 47 #include "content/renderer/p2p/empty_network_manager.h" |
| 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 "content/renderer/renderer_features.h" |
| 55 #include "crypto/openssl_util.h" | 56 #include "crypto/openssl_util.h" |
| 56 #include "jingle/glue/thread_wrapper.h" | 57 #include "jingle/glue/thread_wrapper.h" |
| 57 #include "media/base/media_permission.h" | 58 #include "media/base/media_permission.h" |
| 59 #include "media/filters/ffmpeg_glue.h" |
| 58 #include "media/renderers/gpu_video_accelerator_factories.h" | 60 #include "media/renderers/gpu_video_accelerator_factories.h" |
| 59 #include "third_party/WebKit/public/platform/WebMediaConstraints.h" | 61 #include "third_party/WebKit/public/platform/WebMediaConstraints.h" |
| 60 #include "third_party/WebKit/public/platform/WebMediaStream.h" | 62 #include "third_party/WebKit/public/platform/WebMediaStream.h" |
| 61 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" | 63 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" |
| 62 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 64 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
| 63 #include "third_party/WebKit/public/platform/WebURL.h" | 65 #include "third_party/WebKit/public/platform/WebURL.h" |
| 64 #include "third_party/WebKit/public/web/WebDocument.h" | 66 #include "third_party/WebKit/public/web/WebDocument.h" |
| 65 #include "third_party/WebKit/public/web/WebFrame.h" | 67 #include "third_party/WebKit/public/web/WebFrame.h" |
| 66 #include "third_party/libjingle/source/talk/app/webrtc/mediaconstraintsinterface
.h" | 68 #include "third_party/libjingle/source/talk/app/webrtc/mediaconstraintsinterface
.h" |
| 67 #include "third_party/webrtc/base/ssladapter.h" | 69 #include "third_party/webrtc/base/ssladapter.h" |
| 70 #include "third_party/webrtc/modules/video_coding/codecs/h264/include/h264.h" |
| 68 | 71 |
| 69 #if defined(OS_ANDROID) | 72 #if defined(OS_ANDROID) |
| 70 #include "media/base/android/media_codec_util.h" | 73 #include "media/base/android/media_codec_util.h" |
| 71 #endif | 74 #endif |
| 72 | 75 |
| 73 namespace content { | 76 namespace content { |
| 74 | 77 |
| 75 namespace { | 78 namespace { |
| 76 | 79 |
| 77 enum WebRTCIPHandlingPolicy { | 80 enum WebRTCIPHandlingPolicy { |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 DCHECK(!pc_factory_.get()); | 255 DCHECK(!pc_factory_.get()); |
| 253 DCHECK(!signaling_thread_); | 256 DCHECK(!signaling_thread_); |
| 254 DCHECK(!worker_thread_); | 257 DCHECK(!worker_thread_); |
| 255 DCHECK(!network_manager_); | 258 DCHECK(!network_manager_); |
| 256 DCHECK(!socket_factory_); | 259 DCHECK(!socket_factory_); |
| 257 DCHECK(!chrome_signaling_thread_.IsRunning()); | 260 DCHECK(!chrome_signaling_thread_.IsRunning()); |
| 258 DCHECK(!chrome_worker_thread_.IsRunning()); | 261 DCHECK(!chrome_worker_thread_.IsRunning()); |
| 259 | 262 |
| 260 DVLOG(1) << "PeerConnectionDependencyFactory::CreatePeerConnectionFactory()"; | 263 DVLOG(1) << "PeerConnectionDependencyFactory::CreatePeerConnectionFactory()"; |
| 261 | 264 |
| 265 #if BUILDFLAG(RTC_USE_H264) |
| 266 // TODO(hbos): This is temporary. Disable the runtime effects of building with |
| 267 // |rtc_use_h264|. We are planning to default the |rtc_use_h264| flag to |
| 268 // |proprietary_codecs| so that it will be used by Chromium trybots. This |
| 269 // would also make it used by Chrome, but this feature is not ready to be |
| 270 // launched yet. An upcoming CL will add browser tests for H264. That CL will |
| 271 // remove this line. It should remain disabled until tested. |
| 272 webrtc::DisableRtcUseH264(); |
| 273 // When building with |rtc_use_h264|, |H264DecoderImpl| may be used which |
| 274 // depends on FFmpeg, therefore we need to initialize FFmpeg before going |
| 275 // further. |
| 276 // TODO(hbos): Temporarily commented out due to webrtc::DisableRtcUseH264(), |
| 277 // no need to initialize FFmpeg when |H264DecoderImpl| is disabled. |
| 278 // media::FFmpegGlue::InitializeFFmpeg(); |
| 279 #endif |
| 280 |
| 262 base::MessageLoop::current()->AddDestructionObserver(this); | 281 base::MessageLoop::current()->AddDestructionObserver(this); |
| 263 // To allow sending to the signaling/worker threads. | 282 // To allow sending to the signaling/worker threads. |
| 264 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); | 283 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); |
| 265 jingle_glue::JingleThreadWrapper::current()->set_send_allowed(true); | 284 jingle_glue::JingleThreadWrapper::current()->set_send_allowed(true); |
| 266 | 285 |
| 267 CHECK(chrome_signaling_thread_.Start()); | 286 CHECK(chrome_signaling_thread_.Start()); |
| 268 CHECK(chrome_worker_thread_.Start()); | 287 CHECK(chrome_worker_thread_.Start()); |
| 269 | 288 |
| 270 base::WaitableEvent start_worker_event(true, false); | 289 base::WaitableEvent start_worker_event(true, false); |
| 271 chrome_worker_thread_.task_runner()->PostTask( | 290 chrome_worker_thread_.task_runner()->PostTask( |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 } | 793 } |
| 775 | 794 |
| 776 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { | 795 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { |
| 777 if (audio_device_.get()) | 796 if (audio_device_.get()) |
| 778 return; | 797 return; |
| 779 | 798 |
| 780 audio_device_ = new WebRtcAudioDeviceImpl(); | 799 audio_device_ = new WebRtcAudioDeviceImpl(); |
| 781 } | 800 } |
| 782 | 801 |
| 783 } // namespace content | 802 } // namespace content |
| OLD | NEW |