| 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 // |processing_config.input_stream()|. | 286 // |processing_config.input_stream()|. |
| 287 // | 287 // |
| 288 // The float interfaces accept arbitrary rates and support differing input and | 288 // The float interfaces accept arbitrary rates and support differing input and |
| 289 // output layouts, but the output must have either one channel or the same | 289 // output layouts, but the output must have either one channel or the same |
| 290 // number of channels as the input. | 290 // number of channels as the input. |
| 291 virtual int Initialize(const ProcessingConfig& processing_config) = 0; | 291 virtual int Initialize(const ProcessingConfig& processing_config) = 0; |
| 292 | 292 |
| 293 // Initialize with unpacked parameters. See Initialize() above for details. | 293 // Initialize with unpacked parameters. See Initialize() above for details. |
| 294 // | 294 // |
| 295 // TODO(mgraczyk): Remove once clients are updated to use the new interface. | 295 // TODO(mgraczyk): Remove once clients are updated to use the new interface. |
| 296 virtual int Initialize(int input_sample_rate_hz, | 296 virtual int Initialize(int capture_input_sample_rate_hz, |
| 297 int output_sample_rate_hz, | 297 int capture_output_sample_rate_hz, |
| 298 int reverse_sample_rate_hz, | 298 int render_sample_rate_hz, |
| 299 ChannelLayout input_layout, | 299 ChannelLayout capture_input_layout, |
| 300 ChannelLayout output_layout, | 300 ChannelLayout capture_output_layout, |
| 301 ChannelLayout reverse_layout) = 0; | 301 ChannelLayout render_input_layout) = 0; |
| 302 | 302 |
| 303 // Pass down additional options which don't have explicit setters. This | 303 // Pass down additional options which don't have explicit setters. This |
| 304 // ensures the options are applied immediately. | 304 // ensures the options are applied immediately. |
| 305 virtual void SetExtraOptions(const Config& config) = 0; | 305 virtual void SetExtraOptions(const Config& config) = 0; |
| 306 | 306 |
| 307 // TODO(ajm): Only intended for internal use. Make private and friend the | 307 // TODO(ajm): Only intended for internal use. Make private and friend the |
| 308 // necessary classes? | 308 // necessary classes? |
| 309 virtual int proc_sample_rate_hz() const = 0; | 309 virtual int proc_sample_rate_hz() const = 0; |
| 310 virtual int proc_split_sample_rate_hz() const = 0; | 310 virtual int proc_split_sample_rate_hz() const = 0; |
| 311 virtual size_t num_input_channels() const = 0; | 311 virtual size_t num_input_channels() const = 0; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 // of |data| points to a channel buffer, arranged according to |layout|. | 378 // of |data| points to a channel buffer, arranged according to |layout|. |
| 379 // TODO(mgraczyk): Remove once clients are updated to use the new interface. | 379 // TODO(mgraczyk): Remove once clients are updated to use the new interface. |
| 380 virtual int AnalyzeReverseStream(const float* const* data, | 380 virtual int AnalyzeReverseStream(const float* const* data, |
| 381 size_t samples_per_channel, | 381 size_t samples_per_channel, |
| 382 int rev_sample_rate_hz, | 382 int rev_sample_rate_hz, |
| 383 ChannelLayout layout) = 0; | 383 ChannelLayout layout) = 0; |
| 384 | 384 |
| 385 // Accepts deinterleaved float audio with the range [-1, 1]. Each element of | 385 // Accepts deinterleaved float audio with the range [-1, 1]. Each element of |
| 386 // |data| points to a channel buffer, arranged according to |reverse_config|. | 386 // |data| points to a channel buffer, arranged according to |reverse_config|. |
| 387 virtual int ProcessReverseStream(const float* const* src, | 387 virtual int ProcessReverseStream(const float* const* src, |
| 388 const StreamConfig& reverse_input_config, | 388 const StreamConfig& input_config, |
| 389 const StreamConfig& reverse_output_config, | 389 const StreamConfig& output_config, |
| 390 float* const* dest) = 0; | 390 float* const* dest) = 0; |
| 391 | 391 |
| 392 // This must be called if and only if echo processing is enabled. | 392 // This must be called if and only if echo processing is enabled. |
| 393 // | 393 // |
| 394 // Sets the |delay| in ms between ProcessReverseStream() receiving a far-end | 394 // Sets the |delay| in ms between ProcessReverseStream() receiving a far-end |
| 395 // frame and ProcessStream() receiving a near-end frame containing the | 395 // frame and ProcessStream() receiving a near-end frame containing the |
| 396 // corresponding echo. On the client-side this can be expressed as | 396 // corresponding echo. On the client-side this can be expressed as |
| 397 // delay = (t_render - t_analyze) + (t_process - t_capture) | 397 // delay = (t_render - t_analyze) + (t_process - t_capture) |
| 398 // where, | 398 // where, |
| 399 // - t_analyze is the time a frame is passed to ProcessReverseStream() and | 399 // - t_analyze is the time a frame is passed to ProcessReverseStream() and |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 // This does not impact the size of frames passed to |ProcessStream()|. | 974 // This does not impact the size of frames passed to |ProcessStream()|. |
| 975 virtual int set_frame_size_ms(int size) = 0; | 975 virtual int set_frame_size_ms(int size) = 0; |
| 976 virtual int frame_size_ms() const = 0; | 976 virtual int frame_size_ms() const = 0; |
| 977 | 977 |
| 978 protected: | 978 protected: |
| 979 virtual ~VoiceDetection() {} | 979 virtual ~VoiceDetection() {} |
| 980 }; | 980 }; |
| 981 } // namespace webrtc | 981 } // namespace webrtc |
| 982 | 982 |
| 983 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ | 983 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ |
| OLD | NEW |