OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/media_stream_dependency_factory.h" | 5 #include "content/renderer/media/media_stream_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" |
11 #include "base/synchronization/waitable_event.h" | 11 #include "base/synchronization/waitable_event.h" |
12 #include "content/public/common/content_switches.h" | 12 #include "content/public/common/content_switches.h" |
13 #include "content/renderer/media/media_stream_source_extra_data.h" | 13 #include "content/renderer/media/media_stream_source_extra_data.h" |
14 #include "content/renderer/media/peer_connection_identity_service.h" | 14 #include "content/renderer/media/peer_connection_identity_service.h" |
15 #include "content/renderer/media/rtc_media_constraints.h" | 15 #include "content/renderer/media/rtc_media_constraints.h" |
16 #include "content/renderer/media/rtc_peer_connection_handler.h" | 16 #include "content/renderer/media/rtc_peer_connection_handler.h" |
17 #include "content/renderer/media/rtc_video_capturer.h" | 17 #include "content/renderer/media/rtc_video_capturer.h" |
18 #include "content/renderer/media/rtc_video_decoder_factory.h" | 18 #include "content/renderer/media/rtc_video_decoder_factory.h" |
19 #include "content/renderer/media/video_capture_impl_manager.h" | 19 #include "content/renderer/media/video_capture_impl_manager.h" |
20 #include "content/renderer/media/webaudio_capturer_source.h" | 20 #include "content/renderer/media/webaudio_capturer_source.h" |
21 #include "content/renderer/media/webrtc_audio_device_impl.h" | 21 #include "content/renderer/media/webrtc_audio_device_impl.h" |
22 #include "content/renderer/media/webrtc_local_audio_track.h" | 22 #include "content/renderer/media/webrtc_local_audio_track.h" |
23 #include "content/renderer/media/webrtc_logging_initializer.h" | 23 #include "content/renderer/media/webrtc_logging_initializer.h" |
24 #include "content/renderer/media/webrtc_uma_histograms.h" | 24 #include "content/renderer/media/webrtc_uma_histograms.h" |
25 #include "content/renderer/p2p/ipc_network_manager.h" | 25 #include "content/renderer/p2p/ipc_network_manager.h" |
26 #include "content/renderer/p2p/ipc_socket_factory.h" | 26 #include "content/renderer/p2p/ipc_socket_factory.h" |
27 #include "content/renderer/p2p/port_allocator.h" | 27 #include "content/renderer/p2p/port_allocator.h" |
28 #include "content/renderer/render_thread_impl.h" | 28 #include "content/renderer/render_thread_impl.h" |
29 #include "jingle/glue/thread_wrapper.h" | 29 #include "jingle/glue/thread_wrapper.h" |
30 #include "media/filters/gpu_video_decoder.h" | 30 #include "media/filters/gpu_video_decoder_factories.h" |
31 #include "third_party/WebKit/public/platform/WebMediaConstraints.h" | 31 #include "third_party/WebKit/public/platform/WebMediaConstraints.h" |
32 #include "third_party/WebKit/public/platform/WebMediaStream.h" | 32 #include "third_party/WebKit/public/platform/WebMediaStream.h" |
33 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" | 33 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" |
34 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 34 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
35 #include "third_party/WebKit/public/platform/WebURL.h" | 35 #include "third_party/WebKit/public/platform/WebURL.h" |
36 #include "third_party/WebKit/public/web/WebDocument.h" | 36 #include "third_party/WebKit/public/web/WebDocument.h" |
37 #include "third_party/WebKit/public/web/WebFrame.h" | 37 #include "third_party/WebKit/public/web/WebFrame.h" |
38 #include "third_party/libjingle/source/talk/app/webrtc/mediaconstraintsinterface
.h" | 38 #include "third_party/libjingle/source/talk/app/webrtc/mediaconstraintsinterface
.h" |
39 | 39 |
40 #if defined(ENABLE_WEBRTC) | 40 #if defined(ENABLE_WEBRTC) |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 DVLOG(1) << "MediaStreamDependencyFactory::CreatePeerConnectionFactory()"; | 491 DVLOG(1) << "MediaStreamDependencyFactory::CreatePeerConnectionFactory()"; |
492 if (!pc_factory_.get()) { | 492 if (!pc_factory_.get()) { |
493 DCHECK(!audio_device_.get()); | 493 DCHECK(!audio_device_.get()); |
494 audio_device_ = new WebRtcAudioDeviceImpl(); | 494 audio_device_ = new WebRtcAudioDeviceImpl(); |
495 | 495 |
496 scoped_ptr<cricket::WebRtcVideoDecoderFactory> decoder_factory; | 496 scoped_ptr<cricket::WebRtcVideoDecoderFactory> decoder_factory; |
497 scoped_ptr<cricket::WebRtcVideoEncoderFactory> encoder_factory; | 497 scoped_ptr<cricket::WebRtcVideoEncoderFactory> encoder_factory; |
498 | 498 |
499 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 499 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
500 if (cmd_line->HasSwitch(switches::kEnableWebRtcHWDecoding)) { | 500 if (cmd_line->HasSwitch(switches::kEnableWebRtcHWDecoding)) { |
501 scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories = | 501 scoped_refptr<media::GpuVideoDecoderFactories> gpu_factories = |
502 RenderThreadImpl::current()->GetGpuFactories(); | 502 RenderThreadImpl::current()->GetGpuFactories(); |
503 if (gpu_factories.get() != NULL) | 503 if (gpu_factories.get() != NULL) |
504 decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories)); | 504 decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories)); |
505 } | 505 } |
506 #if defined(GOOGLE_TV) | 506 #if defined(GOOGLE_TV) |
507 // PeerConnectionFactory will hold the ownership of this | 507 // PeerConnectionFactory will hold the ownership of this |
508 // VideoDecoderFactory. | 508 // VideoDecoderFactory. |
509 decoder_factory.reset(decoder_factory_tv_ = new RTCVideoDecoderFactoryTv); | 509 decoder_factory.reset(decoder_factory_tv_ = new RTCVideoDecoderFactoryTv); |
510 #endif | 510 #endif |
511 | 511 |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 // processed before returning. We wait for the above task to finish before | 833 // processed before returning. We wait for the above task to finish before |
834 // letting the the function continue to avoid any potential race issues. | 834 // letting the the function continue to avoid any potential race issues. |
835 chrome_worker_thread_.Stop(); | 835 chrome_worker_thread_.Stop(); |
836 } else { | 836 } else { |
837 NOTREACHED() << "Worker thread not running."; | 837 NOTREACHED() << "Worker thread not running."; |
838 } | 838 } |
839 } | 839 } |
840 } | 840 } |
841 | 841 |
842 } // namespace content | 842 } // namespace content |
OLD | NEW |