Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: content/renderer/media/webrtc/peer_connection_dependency_factory.cc

Issue 1673183002: Enable H.264 video WebRTC behind run-time flag and add WebRtcBrowserTest for H.264 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed gyp/gn deps Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
11 11
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/location.h" 13 #include "base/location.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/metrics/field_trial.h" 16 #include "base/metrics/field_trial.h"
17 #include "base/strings/string_util.h" 17 #include "base/strings/string_util.h"
18 #include "base/strings/utf_string_conversions.h" 18 #include "base/strings/utf_string_conversions.h"
19 #include "base/synchronization/waitable_event.h" 19 #include "base/synchronization/waitable_event.h"
20 #include "build/build_config.h" 20 #include "build/build_config.h"
21 #include "content/common/media/media_stream_messages.h" 21 #include "content/common/media/media_stream_messages.h"
22 #include "content/public/common/content_client.h" 22 #include "content/public/common/content_client.h"
23 #include "content/public/common/content_switches.h" 23 #include "content/public/common/content_switches.h"
24 #include "content/public/common/renderer_preferences.h" 24 #include "content/public/common/renderer_preferences.h"
25 #include "content/public/common/webrtc_ip_handling_policy.h" 25 #include "content/public/common/webrtc_ip_handling_policy.h"
26 #include "content/public/renderer/content_renderer_client.h" 26 #include "content/public/renderer/content_renderer_client.h"
27 #include "content/public/renderer/media/webrtc/finch_h264_with_openh264_ffmpeg.h "
28 #include "content/public/renderer/renderer_features.h"
27 #include "content/renderer/media/media_stream.h" 29 #include "content/renderer/media/media_stream.h"
28 #include "content/renderer/media/media_stream_audio_processor.h" 30 #include "content/renderer/media/media_stream_audio_processor.h"
29 #include "content/renderer/media/media_stream_audio_processor_options.h" 31 #include "content/renderer/media/media_stream_audio_processor_options.h"
30 #include "content/renderer/media/media_stream_audio_source.h" 32 #include "content/renderer/media/media_stream_audio_source.h"
31 #include "content/renderer/media/media_stream_video_source.h" 33 #include "content/renderer/media/media_stream_video_source.h"
32 #include "content/renderer/media/media_stream_video_track.h" 34 #include "content/renderer/media/media_stream_video_track.h"
33 #include "content/renderer/media/peer_connection_identity_store.h" 35 #include "content/renderer/media/peer_connection_identity_store.h"
34 #include "content/renderer/media/rtc_media_constraints.h" 36 #include "content/renderer/media/rtc_media_constraints.h"
35 #include "content/renderer/media/rtc_peer_connection_handler.h" 37 #include "content/renderer/media/rtc_peer_connection_handler.h"
36 #include "content/renderer/media/rtc_video_decoder_factory.h" 38 #include "content/renderer/media/rtc_video_decoder_factory.h"
37 #include "content/renderer/media/rtc_video_encoder_factory.h" 39 #include "content/renderer/media/rtc_video_encoder_factory.h"
38 #include "content/renderer/media/webaudio_capturer_source.h" 40 #include "content/renderer/media/webaudio_capturer_source.h"
39 #include "content/renderer/media/webrtc/media_stream_remote_audio_track.h" 41 #include "content/renderer/media/webrtc/media_stream_remote_audio_track.h"
40 #include "content/renderer/media/webrtc/stun_field_trial.h" 42 #include "content/renderer/media/webrtc/stun_field_trial.h"
41 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h" 43 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h"
42 #include "content/renderer/media/webrtc/webrtc_video_capturer_adapter.h" 44 #include "content/renderer/media/webrtc/webrtc_video_capturer_adapter.h"
43 #include "content/renderer/media/webrtc_audio_device_impl.h" 45 #include "content/renderer/media/webrtc_audio_device_impl.h"
44 #include "content/renderer/media/webrtc_local_audio_track.h" 46 #include "content/renderer/media/webrtc_local_audio_track.h"
45 #include "content/renderer/media/webrtc_logging.h" 47 #include "content/renderer/media/webrtc_logging.h"
46 #include "content/renderer/media/webrtc_uma_histograms.h" 48 #include "content/renderer/media/webrtc_uma_histograms.h"
47 #include "content/renderer/p2p/empty_network_manager.h" 49 #include "content/renderer/p2p/empty_network_manager.h"
48 #include "content/renderer/p2p/filtering_network_manager.h" 50 #include "content/renderer/p2p/filtering_network_manager.h"
49 #include "content/renderer/p2p/ipc_network_manager.h" 51 #include "content/renderer/p2p/ipc_network_manager.h"
50 #include "content/renderer/p2p/ipc_socket_factory.h" 52 #include "content/renderer/p2p/ipc_socket_factory.h"
51 #include "content/renderer/p2p/port_allocator.h" 53 #include "content/renderer/p2p/port_allocator.h"
52 #include "content/renderer/render_frame_impl.h" 54 #include "content/renderer/render_frame_impl.h"
53 #include "content/renderer/render_thread_impl.h" 55 #include "content/renderer/render_thread_impl.h"
54 #include "content/renderer/render_view_impl.h" 56 #include "content/renderer/render_view_impl.h"
55 #include "content/renderer/renderer_features.h"
56 #include "crypto/openssl_util.h" 57 #include "crypto/openssl_util.h"
57 #include "jingle/glue/thread_wrapper.h" 58 #include "jingle/glue/thread_wrapper.h"
58 #include "media/base/media_permission.h" 59 #include "media/base/media_permission.h"
59 #include "media/filters/ffmpeg_glue.h" 60 #include "media/filters/ffmpeg_glue.h"
60 #include "media/renderers/gpu_video_accelerator_factories.h" 61 #include "media/renderers/gpu_video_accelerator_factories.h"
61 #include "third_party/WebKit/public/platform/WebMediaConstraints.h" 62 #include "third_party/WebKit/public/platform/WebMediaConstraints.h"
62 #include "third_party/WebKit/public/platform/WebMediaStream.h" 63 #include "third_party/WebKit/public/platform/WebMediaStream.h"
63 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" 64 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h"
64 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" 65 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
65 #include "third_party/WebKit/public/platform/WebURL.h" 66 #include "third_party/WebKit/public/platform/WebURL.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 DCHECK(!signaling_thread_); 257 DCHECK(!signaling_thread_);
257 DCHECK(!worker_thread_); 258 DCHECK(!worker_thread_);
258 DCHECK(!network_manager_); 259 DCHECK(!network_manager_);
259 DCHECK(!socket_factory_); 260 DCHECK(!socket_factory_);
260 DCHECK(!chrome_signaling_thread_.IsRunning()); 261 DCHECK(!chrome_signaling_thread_.IsRunning());
261 DCHECK(!chrome_worker_thread_.IsRunning()); 262 DCHECK(!chrome_worker_thread_.IsRunning());
262 263
263 DVLOG(1) << "PeerConnectionDependencyFactory::CreatePeerConnectionFactory()"; 264 DVLOG(1) << "PeerConnectionDependencyFactory::CreatePeerConnectionFactory()";
264 265
265 #if BUILDFLAG(RTC_USE_H264) 266 #if BUILDFLAG(RTC_USE_H264)
266 // TODO(hbos): This is temporary. Disable the runtime effects of building with 267 // Building with |rtc_use_h264| - is the corresponding Finch feature enabled?
267 // |rtc_use_h264|. We are planning to default the |rtc_use_h264| flag to 268 if (base::FeatureList::IsEnabled(kWebRtcH264WithOpenH264FFmpeg)) {
268 // |proprietary_codecs| so that it will be used by Chromium trybots. This 269 LOG(WARNING) << "WebRTC H.264 with OpenH264/FFmpeg ENABLED.";
jochen (gone - plz use gerrit) 2016/02/17 10:55:41 please use DVLOG()
269 // would also make it used by Chrome, but this feature is not ready to be 270 // |H264DecoderImpl| may be used which depends on FFmpeg, therefore we need
270 // launched yet. An upcoming CL will add browser tests for H264. That CL will 271 // to initialize FFmpeg before going further.
271 // remove this line. It should remain disabled until tested. 272 media::FFmpegGlue::InitializeFFmpeg();
272 webrtc::DisableRtcUseH264(); 273 } else {
273 // When building with |rtc_use_h264|, |H264DecoderImpl| may be used which 274 LOG(WARNING) << "WebRTC H.264 with OpenH264/FFmpeg DISABLED.";
274 // depends on FFmpeg, therefore we need to initialize FFmpeg before going 275 // Feature is to be disabled, no need to make sure FFmpeg is initialized.
275 // further. 276 webrtc::DisableRtcUseH264();
276 // TODO(hbos): Temporarily commented out due to webrtc::DisableRtcUseH264(), 277 }
277 // no need to initialize FFmpeg when |H264DecoderImpl| is disabled.
278 // media::FFmpegGlue::InitializeFFmpeg();
279 #endif 278 #endif
280 279
281 base::MessageLoop::current()->AddDestructionObserver(this); 280 base::MessageLoop::current()->AddDestructionObserver(this);
282 // To allow sending to the signaling/worker threads. 281 // To allow sending to the signaling/worker threads.
283 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); 282 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop();
284 jingle_glue::JingleThreadWrapper::current()->set_send_allowed(true); 283 jingle_glue::JingleThreadWrapper::current()->set_send_allowed(true);
285 284
286 CHECK(chrome_signaling_thread_.Start()); 285 CHECK(chrome_signaling_thread_.Start());
287 CHECK(chrome_worker_thread_.Start()); 286 CHECK(chrome_worker_thread_.Start());
288 287
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 } 799 }
801 800
802 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { 801 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() {
803 if (audio_device_.get()) 802 if (audio_device_.get())
804 return; 803 return;
805 804
806 audio_device_ = new WebRtcAudioDeviceImpl(); 805 audio_device_ = new WebRtcAudioDeviceImpl();
807 } 806 }
808 807
809 } // namespace content 808 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698