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

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

Issue 1949533002: WIP: Move the creation of AudioCodecFactory into PeerConnectionFactory. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Retained Channel API by adding overloads; also add intended AudioReceiveStream API Created 4 years, 7 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
(...skipping 28 matching lines...) Expand all
39 class WebRtcVoiceMediaChannel; 39 class WebRtcVoiceMediaChannel;
40 40
41 // WebRtcVoiceEngine is a class to be used with CompositeMediaEngine. 41 // WebRtcVoiceEngine is a class to be used with CompositeMediaEngine.
42 // It uses the WebRtc VoiceEngine library for audio handling. 42 // It uses the WebRtc VoiceEngine library for audio handling.
43 class WebRtcVoiceEngine final : public webrtc::TraceCallback { 43 class WebRtcVoiceEngine final : public webrtc::TraceCallback {
44 friend class WebRtcVoiceMediaChannel; 44 friend class WebRtcVoiceMediaChannel;
45 public: 45 public:
46 // Exposed for the WVoE/MC unit test. 46 // Exposed for the WVoE/MC unit test.
47 static bool ToCodecInst(const AudioCodec& in, webrtc::CodecInst* out); 47 static bool ToCodecInst(const AudioCodec& in, webrtc::CodecInst* out);
48 48
49 explicit WebRtcVoiceEngine(webrtc::AudioDeviceModule* adm); 49 explicit WebRtcVoiceEngine(
50 webrtc::AudioDeviceModule* adm,
51 std::shared_ptr<webrtc::AudioDecoderFactory> decoder_factory);
50 // Dependency injection for testing. 52 // Dependency injection for testing.
51 WebRtcVoiceEngine(webrtc::AudioDeviceModule* adm, VoEWrapper* voe_wrapper); 53 WebRtcVoiceEngine(
54 webrtc::AudioDeviceModule* adm,
55 std::shared_ptr<webrtc::AudioDecoderFactory> decoder_factory,
56 VoEWrapper* voe_wrapper);
52 ~WebRtcVoiceEngine() override; 57 ~WebRtcVoiceEngine() override;
53 58
54 rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const; 59 rtc::scoped_refptr<webrtc::AudioState> GetAudioState() const;
55 VoiceMediaChannel* CreateChannel(webrtc::Call* call, 60 VoiceMediaChannel* CreateChannel(webrtc::Call* call,
56 const MediaConfig& config, 61 const MediaConfig& config,
57 const AudioOptions& options); 62 const AudioOptions& options);
58 63
59 bool GetOutputVolume(int* level); 64 bool GetOutputVolume(int* level);
60 bool SetOutputVolume(int level); 65 bool SetOutputVolume(int level);
61 int GetInputLevel(); 66 int GetInputLevel();
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 109
105 void StartAecDump(const std::string& filename); 110 void StartAecDump(const std::string& filename);
106 int CreateVoEChannel(); 111 int CreateVoEChannel();
107 webrtc::AudioDeviceModule* adm(); 112 webrtc::AudioDeviceModule* adm();
108 113
109 rtc::ThreadChecker signal_thread_checker_; 114 rtc::ThreadChecker signal_thread_checker_;
110 rtc::ThreadChecker worker_thread_checker_; 115 rtc::ThreadChecker worker_thread_checker_;
111 116
112 // The audio device manager. 117 // The audio device manager.
113 rtc::scoped_refptr<webrtc::AudioDeviceModule> adm_; 118 rtc::scoped_refptr<webrtc::AudioDeviceModule> adm_;
119 std::shared_ptr<webrtc::AudioDecoderFactory> decoder_factory_;
114 // The primary instance of WebRtc VoiceEngine. 120 // The primary instance of WebRtc VoiceEngine.
115 std::unique_ptr<VoEWrapper> voe_wrapper_; 121 std::unique_ptr<VoEWrapper> voe_wrapper_;
116 rtc::scoped_refptr<webrtc::AudioState> audio_state_; 122 rtc::scoped_refptr<webrtc::AudioState> audio_state_;
117 std::vector<AudioCodec> codecs_; 123 std::vector<AudioCodec> codecs_;
118 std::vector<WebRtcVoiceMediaChannel*> channels_; 124 std::vector<WebRtcVoiceMediaChannel*> channels_;
119 webrtc::Config voe_config_; 125 webrtc::Config voe_config_;
120 bool is_dumping_aec_ = false; 126 bool is_dumping_aec_ = false;
121 127
122 webrtc::AgcConfig default_agc_config_; 128 webrtc::AgcConfig default_agc_config_;
123 // Cache received extended_filter_aec, delay_agnostic_aec and experimental_ns 129 // Cache received extended_filter_aec, delay_agnostic_aec and experimental_ns
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 int cng_payload_type = -1; 292 int cng_payload_type = -1;
287 int cng_plfreq = -1; 293 int cng_plfreq = -1;
288 webrtc::CodecInst codec_inst; 294 webrtc::CodecInst codec_inst;
289 } send_codec_spec_; 295 } send_codec_spec_;
290 296
291 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel); 297 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel);
292 }; 298 };
293 } // namespace cricket 299 } // namespace cricket
294 300
295 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ 301 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698