| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 DCHECK(!pc_factory_.get()); | 161 DCHECK(!pc_factory_.get()); |
| 162 DCHECK(!signaling_thread_); | 162 DCHECK(!signaling_thread_); |
| 163 DCHECK(!worker_thread_); | 163 DCHECK(!worker_thread_); |
| 164 DCHECK(!network_manager_); | 164 DCHECK(!network_manager_); |
| 165 DCHECK(!socket_factory_); | 165 DCHECK(!socket_factory_); |
| 166 DCHECK(!chrome_signaling_thread_.IsRunning()); | 166 DCHECK(!chrome_signaling_thread_.IsRunning()); |
| 167 DCHECK(!chrome_worker_thread_.IsRunning()); | 167 DCHECK(!chrome_worker_thread_.IsRunning()); |
| 168 | 168 |
| 169 DVLOG(1) << "PeerConnectionDependencyFactory::CreatePeerConnectionFactory()"; | 169 DVLOG(1) << "PeerConnectionDependencyFactory::CreatePeerConnectionFactory()"; |
| 170 | 170 |
| 171 #if BUILDFLAG(RTC_USE_H264) | 171 #if BUILDFLAG(RTC_USE_H264) && !defined(MEDIA_DISABLE_FFMPEG) |
| 172 // Building /w |rtc_use_h264|, is the corresponding run-time feature enabled? | 172 // Building /w |rtc_use_h264|, is the corresponding run-time feature enabled? |
| 173 if (base::FeatureList::IsEnabled(kWebRtcH264WithOpenH264FFmpeg)) { | 173 if (base::FeatureList::IsEnabled(kWebRtcH264WithOpenH264FFmpeg)) { |
| 174 // |H264DecoderImpl| may be used which depends on FFmpeg, therefore we need | 174 // |H264DecoderImpl| may be used which depends on FFmpeg, therefore we need |
| 175 // to initialize FFmpeg before going further. | 175 // to initialize FFmpeg before going further. |
| 176 media::FFmpegGlue::InitializeFFmpeg(); | 176 media::FFmpegGlue::InitializeFFmpeg(); |
| 177 } else { | 177 } else { |
| 178 // Feature is to be disabled, no need to make sure FFmpeg is initialized. | 178 // Feature is to be disabled, no need to make sure FFmpeg is initialized. |
| 179 webrtc::DisableRtcUseH264(); | 179 webrtc::DisableRtcUseH264(); |
| 180 } | 180 } |
| 181 #endif | 181 #else |
| 182 webrtc::DisableRtcUseH264(); |
| 183 #endif // BUILDFLAG(RTC_USE_H264) && !defined(MEDIA_DISABLE_FFMPEG) |
| 182 | 184 |
| 183 base::MessageLoop::current()->AddDestructionObserver(this); | 185 base::MessageLoop::current()->AddDestructionObserver(this); |
| 184 // To allow sending to the signaling/worker threads. | 186 // To allow sending to the signaling/worker threads. |
| 185 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); | 187 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); |
| 186 jingle_glue::JingleThreadWrapper::current()->set_send_allowed(true); | 188 jingle_glue::JingleThreadWrapper::current()->set_send_allowed(true); |
| 187 | 189 |
| 188 EnsureWebRtcAudioDeviceImpl(); | 190 EnsureWebRtcAudioDeviceImpl(); |
| 189 | 191 |
| 190 CHECK(chrome_signaling_thread_.Start()); | 192 CHECK(chrome_signaling_thread_.Start()); |
| 191 CHECK(chrome_worker_thread_.Start()); | 193 CHECK(chrome_worker_thread_.Start()); |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 | 577 |
| 576 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { | 578 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { |
| 577 DCHECK(CalledOnValidThread()); | 579 DCHECK(CalledOnValidThread()); |
| 578 if (audio_device_.get()) | 580 if (audio_device_.get()) |
| 579 return; | 581 return; |
| 580 | 582 |
| 581 audio_device_ = new WebRtcAudioDeviceImpl(); | 583 audio_device_ = new WebRtcAudioDeviceImpl(); |
| 582 } | 584 } |
| 583 | 585 |
| 584 } // namespace content | 586 } // namespace content |
| OLD | NEW |