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

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

Issue 1472943002: Refactor MediaCodecBridge to add support for NDK APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing comments Created 5 years 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 <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/location.h" 11 #include "base/location.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/metrics/field_trial.h" 13 #include "base/metrics/field_trial.h"
14 #include "base/strings/string_util.h" 14 #include "base/strings/string_util.h"
15 #include "base/strings/utf_string_conversions.h" 15 #include "base/strings/utf_string_conversions.h"
16 #include "base/synchronization/waitable_event.h" 16 #include "base/synchronization/waitable_event.h"
17 #include "content/common/media/media_stream_messages.h" 17 #include "content/common/media/media_stream_messages.h"
18 #include "content/public/common/content_client.h" 18 #include "content/public/common/content_client.h"
19 #include "content/public/common/content_switches.h" 19 #include "content/public/common/content_switches.h"
20 #include "content/public/common/renderer_preferences.h" 20 #include "content/public/common/renderer_preferences.h"
21 #include "content/public/common/webrtc_ip_handling_policy.h" 21 #include "content/public/common/webrtc_ip_handling_policy.h"
22 #include "content/public/renderer/content_renderer_client.h" 22 #include "content/public/renderer/content_renderer_client.h"
23
xhwang 2015/12/04 18:07:58 empty line not needed? but probably this is from a
qinmin 2015/12/04 20:26:04 Done.
23 #include "content/renderer/media/media_stream.h" 24 #include "content/renderer/media/media_stream.h"
24 #include "content/renderer/media/media_stream_audio_processor.h" 25 #include "content/renderer/media/media_stream_audio_processor.h"
25 #include "content/renderer/media/media_stream_audio_processor_options.h" 26 #include "content/renderer/media/media_stream_audio_processor_options.h"
26 #include "content/renderer/media/media_stream_audio_source.h" 27 #include "content/renderer/media/media_stream_audio_source.h"
27 #include "content/renderer/media/media_stream_video_source.h" 28 #include "content/renderer/media/media_stream_video_source.h"
28 #include "content/renderer/media/media_stream_video_track.h" 29 #include "content/renderer/media/media_stream_video_track.h"
29 #include "content/renderer/media/peer_connection_identity_store.h" 30 #include "content/renderer/media/peer_connection_identity_store.h"
30 #include "content/renderer/media/rtc_media_constraints.h" 31 #include "content/renderer/media/rtc_media_constraints.h"
31 #include "content/renderer/media/rtc_peer_connection_handler.h" 32 #include "content/renderer/media/rtc_peer_connection_handler.h"
32 #include "content/renderer/media/rtc_video_decoder_factory.h" 33 #include "content/renderer/media/rtc_video_decoder_factory.h"
(...skipping 22 matching lines...) Expand all
55 #include "third_party/WebKit/public/platform/WebMediaStream.h" 56 #include "third_party/WebKit/public/platform/WebMediaStream.h"
56 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" 57 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h"
57 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" 58 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
58 #include "third_party/WebKit/public/platform/WebURL.h" 59 #include "third_party/WebKit/public/platform/WebURL.h"
59 #include "third_party/WebKit/public/web/WebDocument.h" 60 #include "third_party/WebKit/public/web/WebDocument.h"
60 #include "third_party/WebKit/public/web/WebFrame.h" 61 #include "third_party/WebKit/public/web/WebFrame.h"
61 #include "third_party/libjingle/source/talk/app/webrtc/mediaconstraintsinterface .h" 62 #include "third_party/libjingle/source/talk/app/webrtc/mediaconstraintsinterface .h"
62 #include "third_party/webrtc/base/ssladapter.h" 63 #include "third_party/webrtc/base/ssladapter.h"
63 64
64 #if defined(OS_ANDROID) 65 #if defined(OS_ANDROID)
65 #include "media/base/android/media_codec_bridge.h" 66 #include "media/base/android/media_codec_util.h"
66 #endif 67 #endif
67 68
68 namespace content { 69 namespace content {
69 70
70 namespace { 71 namespace {
71 72
72 enum WebRTCIPHandlingPolicy { 73 enum WebRTCIPHandlingPolicy {
73 DEFAULT, 74 DEFAULT,
74 DEFAULT_PUBLIC_AND_PRIVATE_INTERFACES, 75 DEFAULT_PUBLIC_AND_PRIVATE_INTERFACES,
75 DEFAULT_PUBLIC_INTERFACE_ONLY, 76 DEFAULT_PUBLIC_INTERFACE_ONLY,
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); 409 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
409 if (gpu_factories && gpu_factories->IsGpuVideoAcceleratorEnabled()) { 410 if (gpu_factories && gpu_factories->IsGpuVideoAcceleratorEnabled()) {
410 if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWDecoding)) 411 if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWDecoding))
411 decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories)); 412 decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories));
412 413
413 if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) 414 if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding))
414 encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories)); 415 encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories));
415 } 416 }
416 417
417 #if defined(OS_ANDROID) 418 #if defined(OS_ANDROID)
418 if (!media::MediaCodecBridge::SupportsSetParameters()) 419 if (!media::MediaCodecUtil::SupportsSetParameters())
419 encoder_factory.reset(); 420 encoder_factory.reset();
420 #endif 421 #endif
421 422
422 pc_factory_ = webrtc::CreatePeerConnectionFactory( 423 pc_factory_ = webrtc::CreatePeerConnectionFactory(
423 worker_thread_, signaling_thread_, audio_device_.get(), 424 worker_thread_, signaling_thread_, audio_device_.get(),
424 encoder_factory.release(), decoder_factory.release()); 425 encoder_factory.release(), decoder_factory.release());
425 CHECK(pc_factory_.get()); 426 CHECK(pc_factory_.get());
426 427
427 webrtc::PeerConnectionFactoryInterface::Options factory_options; 428 webrtc::PeerConnectionFactoryInterface::Options factory_options;
428 factory_options.disable_sctp_data_channels = false; 429 factory_options.disable_sctp_data_channels = false;
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 } 814 }
814 815
815 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { 816 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() {
816 if (audio_device_.get()) 817 if (audio_device_.get())
817 return; 818 return;
818 819
819 audio_device_ = new WebRtcAudioDeviceImpl(); 820 audio_device_ = new WebRtcAudioDeviceImpl();
820 } 821 }
821 822
822 } // namespace content 823 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/media/avda_shared_state.h ('k') | media/BUILD.gn » ('j') | media/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698