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

Side by Side Diff: webrtc/pc/createpeerconnectionfactory.cc

Issue 2965703002: Enable the injection of an APM into a peerconnection (Closed)
Patch Set: Created 3 years, 5 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 /* 1 /*
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2017 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 22 matching lines...) Expand all
33 } 33 }
34 34
35 rtc::scoped_refptr<PeerConnectionFactoryInterface> 35 rtc::scoped_refptr<PeerConnectionFactoryInterface>
36 CreatePeerConnectionFactory() { 36 CreatePeerConnectionFactory() {
37 return CreatePeerConnectionFactory(CreateBuiltinAudioEncoderFactory(), 37 return CreatePeerConnectionFactory(CreateBuiltinAudioEncoderFactory(),
38 CreateBuiltinAudioDecoderFactory()); 38 CreateBuiltinAudioDecoderFactory());
39 } 39 }
40 40
41 // Note: all the other CreatePeerConnectionFactory variants just end up calling 41 // Note: all the other CreatePeerConnectionFactory variants just end up calling
42 // this, ultimately. 42 // this, ultimately.
43 rtc::scoped_refptr<PeerConnectionFactoryInterface> 43 rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory(
peah-webrtc 2017/06/30 11:48:46 This name was chosen in discussion with kwiberg@ a
44 CreatePeerConnectionFactoryWithAudioMixer(
45 rtc::Thread* network_thread, 44 rtc::Thread* network_thread,
46 rtc::Thread* worker_thread, 45 rtc::Thread* worker_thread,
47 rtc::Thread* signaling_thread, 46 rtc::Thread* signaling_thread,
48 AudioDeviceModule* default_adm, 47 AudioDeviceModule* default_adm,
49 rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory, 48 rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory,
50 rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory, 49 rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory,
51 cricket::WebRtcVideoEncoderFactory* video_encoder_factory, 50 cricket::WebRtcVideoEncoderFactory* video_encoder_factory,
52 cricket::WebRtcVideoDecoderFactory* video_decoder_factory, 51 cricket::WebRtcVideoDecoderFactory* video_decoder_factory,
53 rtc::scoped_refptr<AudioMixer> audio_mixer) { 52 rtc::scoped_refptr<AudioMixer> audio_mixer,
53 rtc::scoped_refptr<AudioProcessing> audio_processing) {
54 rtc::scoped_refptr<AudioProcessing> audio_processing_use = audio_processing;
55 if (!audio_processing_use) {
56 audio_processing_use = AudioProcessing::Create();
57 }
58
54 std::unique_ptr<cricket::MediaEngineInterface> media_engine( 59 std::unique_ptr<cricket::MediaEngineInterface> media_engine(
55 cricket::WebRtcMediaEngineFactory::Create( 60 cricket::WebRtcMediaEngineFactory::Create(
56 default_adm, audio_encoder_factory, audio_decoder_factory, 61 default_adm, audio_encoder_factory, audio_decoder_factory,
57 video_encoder_factory, video_decoder_factory, audio_mixer, 62 video_encoder_factory, video_decoder_factory, audio_mixer,
58 AudioProcessing::Create())); 63 audio_processing_use));
59 64
60 std::unique_ptr<CallFactoryInterface> call_factory = CreateCallFactory(); 65 std::unique_ptr<CallFactoryInterface> call_factory = CreateCallFactory();
61 66
62 std::unique_ptr<RtcEventLogFactoryInterface> event_log_factory = 67 std::unique_ptr<RtcEventLogFactoryInterface> event_log_factory =
63 CreateRtcEventLogFactory(); 68 CreateRtcEventLogFactory();
64 69
65 return CreateModularPeerConnectionFactory( 70 return CreateModularPeerConnectionFactory(
66 network_thread, worker_thread, signaling_thread, default_adm, 71 network_thread, worker_thread, signaling_thread, default_adm,
67 audio_encoder_factory, audio_decoder_factory, video_encoder_factory, 72 audio_encoder_factory, audio_decoder_factory, video_encoder_factory,
68 video_decoder_factory, audio_mixer, std::move(media_engine), 73 video_decoder_factory, audio_mixer, std::move(media_engine),
69 std::move(call_factory), std::move(event_log_factory)); 74 std::move(call_factory), std::move(event_log_factory));
70 } 75 }
71 76
72 rtc::scoped_refptr<PeerConnectionFactoryInterface> 77 rtc::scoped_refptr<PeerConnectionFactoryInterface>
73 CreatePeerConnectionFactoryWithAudioMixer( 78 CreatePeerConnectionFactoryWithAudioMixer(
74 rtc::Thread* network_thread, 79 rtc::Thread* network_thread,
80 rtc::Thread* worker_thread,
81 rtc::Thread* signaling_thread,
82 AudioDeviceModule* default_adm,
83 rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory,
84 rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory,
85 cricket::WebRtcVideoEncoderFactory* video_encoder_factory,
86 cricket::WebRtcVideoDecoderFactory* video_decoder_factory,
87 rtc::scoped_refptr<AudioMixer> audio_mixer) {
88 return CreatePeerConnectionFactory(
89 network_thread, worker_thread, signaling_thread, default_adm,
90 audio_encoder_factory, audio_decoder_factory, video_encoder_factory,
91 video_decoder_factory, audio_mixer, nullptr);
92 }
93
94 rtc::scoped_refptr<PeerConnectionFactoryInterface>
95 CreatePeerConnectionFactoryWithAudioMixer(
96 rtc::Thread* network_thread,
75 rtc::Thread* worker_thread, 97 rtc::Thread* worker_thread,
76 rtc::Thread* signaling_thread, 98 rtc::Thread* signaling_thread,
77 AudioDeviceModule* default_adm, 99 AudioDeviceModule* default_adm,
78 cricket::WebRtcVideoEncoderFactory* encoder_factory, 100 cricket::WebRtcVideoEncoderFactory* encoder_factory,
79 cricket::WebRtcVideoDecoderFactory* decoder_factory, 101 cricket::WebRtcVideoDecoderFactory* decoder_factory,
80 rtc::scoped_refptr<AudioMixer> audio_mixer) { 102 rtc::scoped_refptr<AudioMixer> audio_mixer) {
81 return CreatePeerConnectionFactoryWithAudioMixer( 103 return CreatePeerConnectionFactoryWithAudioMixer(
82 network_thread, worker_thread, signaling_thread, default_adm, 104 network_thread, worker_thread, signaling_thread, default_adm,
83 CreateBuiltinAudioEncoderFactory(), CreateBuiltinAudioDecoderFactory(), 105 CreateBuiltinAudioEncoderFactory(), CreateBuiltinAudioDecoderFactory(),
84 encoder_factory, decoder_factory, audio_mixer); 106 encoder_factory, decoder_factory, audio_mixer);
(...skipping 20 matching lines...) Expand all
105 rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory, 127 rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory,
106 cricket::WebRtcVideoEncoderFactory* video_encoder_factory, 128 cricket::WebRtcVideoEncoderFactory* video_encoder_factory,
107 cricket::WebRtcVideoDecoderFactory* video_decoder_factory) { 129 cricket::WebRtcVideoDecoderFactory* video_decoder_factory) {
108 return CreatePeerConnectionFactoryWithAudioMixer( 130 return CreatePeerConnectionFactoryWithAudioMixer(
109 network_thread, worker_thread, signaling_thread, default_adm, 131 network_thread, worker_thread, signaling_thread, default_adm,
110 audio_encoder_factory, audio_decoder_factory, video_encoder_factory, 132 audio_encoder_factory, audio_decoder_factory, video_encoder_factory,
111 video_decoder_factory, nullptr); 133 video_decoder_factory, nullptr);
112 } 134 }
113 135
114 } // namespace webrtc 136 } // namespace webrtc
OLDNEW
« webrtc/api/peerconnectioninterface.h ('K') | « webrtc/api/peerconnectioninterface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698