| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 struct AudioProcessingImpl::ApmPublicSubmodules { | 84 struct AudioProcessingImpl::ApmPublicSubmodules { |
| 85 ApmPublicSubmodules() | 85 ApmPublicSubmodules() |
| 86 : echo_cancellation(nullptr), | 86 : echo_cancellation(nullptr), |
| 87 echo_control_mobile(nullptr), | 87 echo_control_mobile(nullptr), |
| 88 gain_control(nullptr) {} | 88 gain_control(nullptr) {} |
| 89 // Accessed externally of APM without any lock acquired. | 89 // Accessed externally of APM without any lock acquired. |
| 90 EchoCancellationImpl* echo_cancellation; | 90 EchoCancellationImpl* echo_cancellation; |
| 91 EchoControlMobileImpl* echo_control_mobile; | 91 EchoControlMobileImpl* echo_control_mobile; |
| 92 GainControlImpl* gain_control; | 92 GainControlImpl* gain_control; |
| 93 rtc::scoped_ptr<HighPassFilterImpl> high_pass_filter; | 93 std::unique_ptr<HighPassFilterImpl> high_pass_filter; |
| 94 rtc::scoped_ptr<LevelEstimatorImpl> level_estimator; | 94 std::unique_ptr<LevelEstimatorImpl> level_estimator; |
| 95 rtc::scoped_ptr<NoiseSuppressionImpl> noise_suppression; | 95 std::unique_ptr<NoiseSuppressionImpl> noise_suppression; |
| 96 rtc::scoped_ptr<VoiceDetectionImpl> voice_detection; | 96 std::unique_ptr<VoiceDetectionImpl> voice_detection; |
| 97 rtc::scoped_ptr<GainControlForExperimentalAgc> | 97 std::unique_ptr<GainControlForExperimentalAgc> |
| 98 gain_control_for_experimental_agc; | 98 gain_control_for_experimental_agc; |
| 99 | 99 |
| 100 // Accessed internally from both render and capture. | 100 // Accessed internally from both render and capture. |
| 101 rtc::scoped_ptr<TransientSuppressor> transient_suppressor; | 101 std::unique_ptr<TransientSuppressor> transient_suppressor; |
| 102 rtc::scoped_ptr<IntelligibilityEnhancer> intelligibility_enhancer; | 102 std::unique_ptr<IntelligibilityEnhancer> intelligibility_enhancer; |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 struct AudioProcessingImpl::ApmPrivateSubmodules { | 105 struct AudioProcessingImpl::ApmPrivateSubmodules { |
| 106 explicit ApmPrivateSubmodules(Beamformer<float>* beamformer) | 106 explicit ApmPrivateSubmodules(Beamformer<float>* beamformer) |
| 107 : beamformer(beamformer) {} | 107 : beamformer(beamformer) {} |
| 108 // Accessed internally from capture or during initialization | 108 // Accessed internally from capture or during initialization |
| 109 std::list<ProcessingComponent*> component_list; | 109 std::list<ProcessingComponent*> component_list; |
| 110 rtc::scoped_ptr<Beamformer<float>> beamformer; | 110 std::unique_ptr<Beamformer<float>> beamformer; |
| 111 rtc::scoped_ptr<AgcManagerDirect> agc_manager; | 111 std::unique_ptr<AgcManagerDirect> agc_manager; |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 const int AudioProcessing::kNativeSampleRatesHz[] = { | 114 const int AudioProcessing::kNativeSampleRatesHz[] = { |
| 115 AudioProcessing::kSampleRate8kHz, | 115 AudioProcessing::kSampleRate8kHz, |
| 116 AudioProcessing::kSampleRate16kHz, | 116 AudioProcessing::kSampleRate16kHz, |
| 117 AudioProcessing::kSampleRate32kHz, | 117 AudioProcessing::kSampleRate32kHz, |
| 118 AudioProcessing::kSampleRate48kHz}; | 118 AudioProcessing::kSampleRate48kHz}; |
| 119 const size_t AudioProcessing::kNumNativeSampleRates = | 119 const size_t AudioProcessing::kNumNativeSampleRates = |
| 120 arraysize(AudioProcessing::kNativeSampleRatesHz); | 120 arraysize(AudioProcessing::kNativeSampleRatesHz); |
| 121 const int AudioProcessing::kMaxNativeSampleRateHz = AudioProcessing:: | 121 const int AudioProcessing::kMaxNativeSampleRateHz = AudioProcessing:: |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 ? formats_.rev_proc_format.num_frames() | 290 ? formats_.rev_proc_format.num_frames() |
| 291 : formats_.api_format.reverse_output_stream().num_frames(); | 291 : formats_.api_format.reverse_output_stream().num_frames(); |
| 292 if (formats_.api_format.reverse_input_stream().num_channels() > 0) { | 292 if (formats_.api_format.reverse_input_stream().num_channels() > 0) { |
| 293 render_.render_audio.reset(new AudioBuffer( | 293 render_.render_audio.reset(new AudioBuffer( |
| 294 formats_.api_format.reverse_input_stream().num_frames(), | 294 formats_.api_format.reverse_input_stream().num_frames(), |
| 295 formats_.api_format.reverse_input_stream().num_channels(), | 295 formats_.api_format.reverse_input_stream().num_channels(), |
| 296 formats_.rev_proc_format.num_frames(), | 296 formats_.rev_proc_format.num_frames(), |
| 297 formats_.rev_proc_format.num_channels(), | 297 formats_.rev_proc_format.num_channels(), |
| 298 rev_audio_buffer_out_num_frames)); | 298 rev_audio_buffer_out_num_frames)); |
| 299 if (rev_conversion_needed()) { | 299 if (rev_conversion_needed()) { |
| 300 render_.render_converter = AudioConverter::Create( | 300 render_.render_converter = rtc::ScopedToUnique(AudioConverter::Create( |
| 301 formats_.api_format.reverse_input_stream().num_channels(), | 301 formats_.api_format.reverse_input_stream().num_channels(), |
| 302 formats_.api_format.reverse_input_stream().num_frames(), | 302 formats_.api_format.reverse_input_stream().num_frames(), |
| 303 formats_.api_format.reverse_output_stream().num_channels(), | 303 formats_.api_format.reverse_output_stream().num_channels(), |
| 304 formats_.api_format.reverse_output_stream().num_frames()); | 304 formats_.api_format.reverse_output_stream().num_frames())); |
| 305 } else { | 305 } else { |
| 306 render_.render_converter.reset(nullptr); | 306 render_.render_converter.reset(nullptr); |
| 307 } | 307 } |
| 308 } else { | 308 } else { |
| 309 render_.render_audio.reset(nullptr); | 309 render_.render_audio.reset(nullptr); |
| 310 render_.render_converter.reset(nullptr); | 310 render_.render_converter.reset(nullptr); |
| 311 } | 311 } |
| 312 capture_.capture_audio.reset( | 312 capture_.capture_audio.reset( |
| 313 new AudioBuffer(formats_.api_format.input_stream().num_frames(), | 313 new AudioBuffer(formats_.api_format.input_stream().num_frames(), |
| 314 formats_.api_format.input_stream().num_channels(), | 314 formats_.api_format.input_stream().num_channels(), |
| (...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1479 debug_dump_.capture.event_msg->mutable_config()->CopyFrom(config); | 1479 debug_dump_.capture.event_msg->mutable_config()->CopyFrom(config); |
| 1480 | 1480 |
| 1481 RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(), | 1481 RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(), |
| 1482 &debug_dump_.num_bytes_left_for_log_, | 1482 &debug_dump_.num_bytes_left_for_log_, |
| 1483 &crit_debug_, &debug_dump_.capture)); | 1483 &crit_debug_, &debug_dump_.capture)); |
| 1484 return kNoError; | 1484 return kNoError; |
| 1485 } | 1485 } |
| 1486 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP | 1486 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP |
| 1487 | 1487 |
| 1488 } // namespace webrtc | 1488 } // namespace webrtc |
| OLD | NEW |