OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 Loading... | |
39 class NonlinearBeamformer; | 39 class NonlinearBeamformer; |
40 | 40 |
41 class AudioProcessingImpl : public AudioProcessing { | 41 class AudioProcessingImpl : public AudioProcessing { |
42 public: | 42 public: |
43 // Methods forcing APM to run in a single-threaded manner. | 43 // Methods forcing APM to run in a single-threaded manner. |
44 // Acquires both the render and capture locks. | 44 // Acquires both the render and capture locks. |
45 explicit AudioProcessingImpl(const Config& config); | 45 explicit AudioProcessingImpl(const Config& config); |
46 // AudioProcessingImpl takes ownership of beamformer. | 46 // AudioProcessingImpl takes ownership of beamformer. |
47 AudioProcessingImpl(const Config& config, NonlinearBeamformer* beamformer); | 47 AudioProcessingImpl(const Config& config, NonlinearBeamformer* beamformer); |
48 virtual ~AudioProcessingImpl(); | 48 virtual ~AudioProcessingImpl(); |
49 int ApplySettings(const ApmSettings& settings) override; | |
the sun
2016/08/30 10:32:38
Call, AudioReceiveStream etc, use "Config" for the
hlundin-webrtc
2016/08/30 11:26:26
Acknowledged.
peah-webrtc
2016/08/30 17:05:57
Acknowledged.
peah-webrtc
2016/08/30 17:05:57
Done!
| |
49 int Initialize() override; | 50 int Initialize() override; |
50 int Initialize(int input_sample_rate_hz, | 51 int Initialize(int input_sample_rate_hz, |
51 int output_sample_rate_hz, | 52 int output_sample_rate_hz, |
52 int reverse_sample_rate_hz, | 53 int reverse_sample_rate_hz, |
53 ChannelLayout input_layout, | 54 ChannelLayout input_layout, |
54 ChannelLayout output_layout, | 55 ChannelLayout output_layout, |
55 ChannelLayout reverse_layout) override; | 56 ChannelLayout reverse_layout) override; |
56 int Initialize(const ProcessingConfig& processing_config) override; | 57 int Initialize(const ProcessingConfig& processing_config) override; |
57 void SetExtraOptions(const Config& config) override; | 58 void SetExtraOptions(const Config& config) override; |
58 void UpdateHistogramsOnCallEnd() override; | 59 void UpdateHistogramsOnCallEnd() override; |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
315 std::unique_ptr<AudioBuffer> capture_audio; | 316 std::unique_ptr<AudioBuffer> capture_audio; |
316 // Only the rate and samples fields of fwd_proc_format_ are used because the | 317 // Only the rate and samples fields of fwd_proc_format_ are used because the |
317 // forward processing number of channels is mutable and is tracked by the | 318 // forward processing number of channels is mutable and is tracked by the |
318 // capture_audio_. | 319 // capture_audio_. |
319 StreamConfig fwd_proc_format; | 320 StreamConfig fwd_proc_format; |
320 int split_rate; | 321 int split_rate; |
321 } capture_ GUARDED_BY(crit_capture_); | 322 } capture_ GUARDED_BY(crit_capture_); |
322 | 323 |
323 struct ApmCaptureNonLockedState { | 324 struct ApmCaptureNonLockedState { |
324 ApmCaptureNonLockedState(bool beamformer_enabled, | 325 ApmCaptureNonLockedState(bool beamformer_enabled, |
325 bool intelligibility_enabled, | 326 bool intelligibility_enabled) |
326 bool level_controller_enabled) | |
327 : fwd_proc_format(kSampleRate16kHz), | 327 : fwd_proc_format(kSampleRate16kHz), |
328 split_rate(kSampleRate16kHz), | 328 split_rate(kSampleRate16kHz), |
329 stream_delay_ms(0), | 329 stream_delay_ms(0), |
330 beamformer_enabled(beamformer_enabled), | 330 beamformer_enabled(beamformer_enabled), |
331 intelligibility_enabled(intelligibility_enabled), | 331 intelligibility_enabled(intelligibility_enabled) {} |
332 level_controller_enabled(level_controller_enabled) {} | |
333 // Only the rate and samples fields of fwd_proc_format_ are used because the | 332 // Only the rate and samples fields of fwd_proc_format_ are used because the |
334 // forward processing number of channels is mutable and is tracked by the | 333 // forward processing number of channels is mutable and is tracked by the |
335 // capture_audio_. | 334 // capture_audio_. |
336 StreamConfig fwd_proc_format; | 335 StreamConfig fwd_proc_format; |
337 int split_rate; | 336 int split_rate; |
338 int stream_delay_ms; | 337 int stream_delay_ms; |
339 bool beamformer_enabled; | 338 bool beamformer_enabled; |
340 bool intelligibility_enabled; | 339 bool intelligibility_enabled; |
341 bool level_controller_enabled; | 340 bool level_controller_enabled = false; |
342 } capture_nonlocked_; | 341 } capture_nonlocked_; |
343 | 342 |
344 struct ApmRenderState { | 343 struct ApmRenderState { |
345 std::unique_ptr<AudioConverter> render_converter; | 344 std::unique_ptr<AudioConverter> render_converter; |
346 std::unique_ptr<AudioBuffer> render_audio; | 345 std::unique_ptr<AudioBuffer> render_audio; |
347 } render_ GUARDED_BY(crit_render_); | 346 } render_ GUARDED_BY(crit_render_); |
348 }; | 347 }; |
349 | 348 |
350 } // namespace webrtc | 349 } // namespace webrtc |
351 | 350 |
352 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_ | 351 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AUDIO_PROCESSING_IMPL_H_ |
OLD | NEW |