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

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

Issue 1827263002: Early initialize recording on the ADM from WebRtcVoiceMediaChannel. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: set upstream to 1830213002 Created 4 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
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // ignored. This allows us to selectively turn on and off different options 96 // ignored. This allows us to selectively turn on and off different options
97 // easily at any time. 97 // easily at any time.
98 bool ApplyOptions(const AudioOptions& options); 98 bool ApplyOptions(const AudioOptions& options);
99 void SetDefaultDevices(); 99 void SetDefaultDevices();
100 100
101 // webrtc::TraceCallback: 101 // webrtc::TraceCallback:
102 void Print(webrtc::TraceLevel level, const char* trace, int length) override; 102 void Print(webrtc::TraceLevel level, const char* trace, int length) override;
103 103
104 void StartAecDump(const std::string& filename); 104 void StartAecDump(const std::string& filename);
105 int CreateVoEChannel(); 105 int CreateVoEChannel();
106 webrtc::AudioDeviceModule* adm();
106 107
107 rtc::ThreadChecker signal_thread_checker_; 108 rtc::ThreadChecker signal_thread_checker_;
108 rtc::ThreadChecker worker_thread_checker_; 109 rtc::ThreadChecker worker_thread_checker_;
109 110
110 // The primary instance of WebRtc VoiceEngine. 111 // The primary instance of WebRtc VoiceEngine.
111 std::unique_ptr<VoEWrapper> voe_wrapper_; 112 std::unique_ptr<VoEWrapper> voe_wrapper_;
112 rtc::scoped_refptr<webrtc::AudioState> audio_state_; 113 rtc::scoped_refptr<webrtc::AudioState> audio_state_;
113 // The external audio device manager 114 // The external audio device manager
114 webrtc::AudioDeviceModule* adm_ = nullptr; 115 webrtc::AudioDeviceModule* adm_ = nullptr;
115 std::vector<AudioCodec> codecs_; 116 std::vector<AudioCodec> codecs_;
116 std::vector<WebRtcVoiceMediaChannel*> channels_; 117 std::vector<WebRtcVoiceMediaChannel*> channels_;
117 webrtc::Config voe_config_; 118 webrtc::Config voe_config_;
118 bool is_dumping_aec_ = false; 119 bool is_dumping_aec_ = false;
119 120
120 webrtc::AgcConfig default_agc_config_; 121 webrtc::AgcConfig default_agc_config_;
121 // Cache received extended_filter_aec, delay_agnostic_aec and experimental_ns 122 // Cache received extended_filter_aec, delay_agnostic_aec and experimental_ns
122 // values, and apply them in case they are missing in the audio options. We 123 // values, and apply them in case they are missing in the audio options. We
123 // need to do this because SetExtraOptions() will revert to defaults for 124 // need to do this because SetExtraOptions() will revert to defaults for
124 // options which are not provided. 125 // options which are not provided.
125 rtc::Optional<bool> extended_filter_aec_; 126 rtc::Optional<bool> extended_filter_aec_;
126 rtc::Optional<bool> delay_agnostic_aec_; 127 rtc::Optional<bool> delay_agnostic_aec_;
127 rtc::Optional<bool> experimental_ns_; 128 rtc::Optional<bool> experimental_ns_;
128 129
129 RTC_DISALLOW_COPY_AND_ASSIGN(WebRtcVoiceEngine); 130 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceEngine);
130 }; 131 };
131 132
132 // WebRtcVoiceMediaChannel is an implementation of VoiceMediaChannel that uses 133 // WebRtcVoiceMediaChannel is an implementation of VoiceMediaChannel that uses
133 // WebRtc Voice Engine. 134 // WebRtc Voice Engine.
134 class WebRtcVoiceMediaChannel final : public VoiceMediaChannel, 135 class WebRtcVoiceMediaChannel final : public VoiceMediaChannel,
135 public webrtc::Transport { 136 public webrtc::Transport {
136 public: 137 public:
137 WebRtcVoiceMediaChannel(WebRtcVoiceEngine* engine, 138 WebRtcVoiceMediaChannel(WebRtcVoiceEngine* engine,
138 const MediaConfig& config, 139 const MediaConfig& config,
139 const AudioOptions& options, 140 const AudioOptions& options,
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 bool ChangePlayout(bool playout); 219 bool ChangePlayout(bool playout);
219 int CreateVoEChannel(); 220 int CreateVoEChannel();
220 bool DeleteVoEChannel(int channel); 221 bool DeleteVoEChannel(int channel);
221 bool IsDefaultRecvStream(uint32_t ssrc) { 222 bool IsDefaultRecvStream(uint32_t ssrc) {
222 return default_recv_ssrc_ == static_cast<int64_t>(ssrc); 223 return default_recv_ssrc_ == static_cast<int64_t>(ssrc);
223 } 224 }
224 bool SetSendBitrateInternal(int bps); 225 bool SetSendBitrateInternal(int bps);
225 bool HasSendCodec() const { 226 bool HasSendCodec() const {
226 return send_codec_spec_.codec_inst.pltype != -1; 227 return send_codec_spec_.codec_inst.pltype != -1;
227 } 228 }
229 void SetupRecording();
228 230
229 rtc::ThreadChecker worker_thread_checker_; 231 rtc::ThreadChecker worker_thread_checker_;
230 232
231 WebRtcVoiceEngine* const engine_ = nullptr; 233 WebRtcVoiceEngine* const engine_ = nullptr;
232 std::vector<AudioCodec> recv_codecs_; 234 std::vector<AudioCodec> recv_codecs_;
233 bool send_bitrate_setting_ = false; 235 bool send_bitrate_setting_ = false;
234 int send_bitrate_bps_ = 0; 236 int send_bitrate_bps_ = 0;
235 AudioOptions options_; 237 AudioOptions options_;
236 rtc::Optional<int> dtmf_payload_type_; 238 rtc::Optional<int> dtmf_payload_type_;
237 bool desired_playout_ = false; 239 bool desired_playout_ = false;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 int cng_payload_type = -1; 276 int cng_payload_type = -1;
275 int cng_plfreq = -1; 277 int cng_plfreq = -1;
276 webrtc::CodecInst codec_inst; 278 webrtc::CodecInst codec_inst;
277 } send_codec_spec_; 279 } send_codec_spec_;
278 280
279 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel); 281 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel);
280 }; 282 };
281 } // namespace cricket 283 } // namespace cricket
282 284
283 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ 285 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698