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

Side by Side Diff: webrtc/media/engine/webrtcvoiceengine.h

Issue 2705093002: Injectable audio encoders: WebRtcVoiceEngine and company (Closed)
Patch Set: Moved encoder creation up into AudioSendStream, bypassing most of Channel. Created 3 years, 9 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 (c) 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2004 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
11 #ifndef WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ 11 #ifndef WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_
12 #define WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ 12 #define WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_
13 13
14 #include <map> 14 #include <map>
15 #include <memory> 15 #include <memory>
16 #include <string> 16 #include <string>
17 #include <vector> 17 #include <vector>
18 18
19 #include "webrtc/base/buffer.h" 19 #include "webrtc/base/buffer.h"
20 #include "webrtc/base/constructormagic.h" 20 #include "webrtc/base/constructormagic.h"
21 #include "webrtc/base/networkroute.h" 21 #include "webrtc/base/networkroute.h"
22 #include "webrtc/base/scoped_ref_ptr.h" 22 #include "webrtc/base/scoped_ref_ptr.h"
23 #include "webrtc/base/thread_checker.h" 23 #include "webrtc/base/thread_checker.h"
24 #include "webrtc/call/audio_state.h" 24 #include "webrtc/call/audio_state.h"
25 #include "webrtc/call/call.h" 25 #include "webrtc/call/call.h"
26 #include "webrtc/config.h" 26 #include "webrtc/config.h"
27 #include "webrtc/media/base/rtputils.h" 27 #include "webrtc/media/base/rtputils.h"
28 #include "webrtc/media/engine/webrtccommon.h" 28 #include "webrtc/media/engine/webrtccommon.h"
29 #include "webrtc/media/engine/webrtcvoe.h" 29 #include "webrtc/media/engine/webrtcvoe.h"
30 #include "webrtc/modules/audio_coding/codecs/audio_encoder_factory.h"
30 #include "webrtc/modules/audio_processing/include/audio_processing.h" 31 #include "webrtc/modules/audio_processing/include/audio_processing.h"
31 #include "webrtc/pc/channel.h" 32 #include "webrtc/pc/channel.h"
32 33
33 namespace cricket { 34 namespace cricket {
34 35
35 class AudioDeviceModule; 36 class AudioDeviceModule;
36 class AudioMixer; 37 class AudioMixer;
37 class AudioSource; 38 class AudioSource;
38 class VoEWrapper; 39 class VoEWrapper;
39 class WebRtcVoiceMediaChannel; 40 class WebRtcVoiceMediaChannel;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 void SetDefaultDevices(); 104 void SetDefaultDevices();
104 105
105 // webrtc::TraceCallback: 106 // webrtc::TraceCallback:
106 void Print(webrtc::TraceLevel level, const char* trace, int length) override; 107 void Print(webrtc::TraceLevel level, const char* trace, int length) override;
107 108
108 void StartAecDump(const std::string& filename); 109 void StartAecDump(const std::string& filename);
109 int CreateVoEChannel(); 110 int CreateVoEChannel();
110 webrtc::AudioDeviceModule* adm(); 111 webrtc::AudioDeviceModule* adm();
111 webrtc::AudioProcessing* apm(); 112 webrtc::AudioProcessing* apm();
112 113
113 AudioCodecs CollectRecvCodecs() const; 114 AudioCodecs CollectCodecs(
115 const std::vector<webrtc::AudioCodecSpec>& specs) const;
114 116
115 rtc::ThreadChecker signal_thread_checker_; 117 rtc::ThreadChecker signal_thread_checker_;
116 rtc::ThreadChecker worker_thread_checker_; 118 rtc::ThreadChecker worker_thread_checker_;
117 119
118 // The audio device manager. 120 // The audio device manager.
119 rtc::scoped_refptr<webrtc::AudioDeviceModule> adm_; 121 rtc::scoped_refptr<webrtc::AudioDeviceModule> adm_;
122 rtc::scoped_refptr<webrtc::AudioEncoderFactory> encoder_factory_;
120 rtc::scoped_refptr<webrtc::AudioDecoderFactory> decoder_factory_; 123 rtc::scoped_refptr<webrtc::AudioDecoderFactory> decoder_factory_;
121 // Reference to the APM, owned by VoE. 124 // Reference to the APM, owned by VoE.
122 webrtc::AudioProcessing* apm_ = nullptr; 125 webrtc::AudioProcessing* apm_ = nullptr;
123 // The primary instance of WebRtc VoiceEngine. 126 // The primary instance of WebRtc VoiceEngine.
124 std::unique_ptr<VoEWrapper> voe_wrapper_; 127 std::unique_ptr<VoEWrapper> voe_wrapper_;
125 rtc::scoped_refptr<webrtc::AudioState> audio_state_; 128 rtc::scoped_refptr<webrtc::AudioState> audio_state_;
126 std::vector<AudioCodec> send_codecs_; 129 std::vector<AudioCodec> send_codecs_;
127 std::vector<AudioCodec> recv_codecs_; 130 std::vector<AudioCodec> recv_codecs_;
128 std::vector<WebRtcVoiceMediaChannel*> channels_; 131 std::vector<WebRtcVoiceMediaChannel*> channels_;
129 webrtc::VoEBase::ChannelConfig channel_config_; 132 webrtc::VoEBase::ChannelConfig channel_config_;
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 std::map<uint32_t, WebRtcAudioReceiveStream*> recv_streams_; 279 std::map<uint32_t, WebRtcAudioReceiveStream*> recv_streams_;
277 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; 280 std::vector<webrtc::RtpExtension> recv_rtp_extensions_;
278 281
279 webrtc::AudioSendStream::Config::SendCodecSpec send_codec_spec_; 282 webrtc::AudioSendStream::Config::SendCodecSpec send_codec_spec_;
280 283
281 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel); 284 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel);
282 }; 285 };
283 } // namespace cricket 286 } // namespace cricket
284 287
285 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ 288 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698