Per Åhgren | 71652f4 | 2020-03-17 13:23:58 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2020 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #ifndef MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_FRAME_PROXIES_H_ |
| 12 | #define MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_FRAME_PROXIES_H_ |
| 13 | |
| 14 | namespace webrtc { |
| 15 | |
| 16 | class AudioFrame; |
| 17 | class AudioProcessing; |
| 18 | |
Artem Titov | 0b48930 | 2021-07-28 20:50:03 +0200 | [diff] [blame] | 19 | // Processes a 10 ms `frame` of the primary audio stream using the provided |
Per Åhgren | 71652f4 | 2020-03-17 13:23:58 +0100 | [diff] [blame] | 20 | // AudioProcessing object. On the client-side, this is the near-end (or |
Artem Titov | 0b48930 | 2021-07-28 20:50:03 +0200 | [diff] [blame] | 21 | // captured) audio. The `sample_rate_hz_`, `num_channels_`, and |
| 22 | // `samples_per_channel_` members of `frame` must be valid. If changed from the |
Per Åhgren | 71652f4 | 2020-03-17 13:23:58 +0100 | [diff] [blame] | 23 | // previous call to this function, it will trigger an initialization of the |
| 24 | // provided AudioProcessing object. |
| 25 | // The function returns any error codes passed from the AudioProcessing |
| 26 | // ProcessStream method. |
| 27 | int ProcessAudioFrame(AudioProcessing* ap, AudioFrame* frame); |
| 28 | |
Artem Titov | 0b48930 | 2021-07-28 20:50:03 +0200 | [diff] [blame] | 29 | // Processes a 10 ms `frame` of the reverse direction audio stream using the |
Per Åhgren | 71652f4 | 2020-03-17 13:23:58 +0100 | [diff] [blame] | 30 | // provided AudioProcessing object. The frame may be modified. On the |
| 31 | // client-side, this is the far-end (or to be rendered) audio. The |
Artem Titov | 0b48930 | 2021-07-28 20:50:03 +0200 | [diff] [blame] | 32 | // `sample_rate_hz_`, `num_channels_`, and `samples_per_channel_` members of |
| 33 | // `frame` must be valid. If changed from the previous call to this function, it |
Per Åhgren | 71652f4 | 2020-03-17 13:23:58 +0100 | [diff] [blame] | 34 | // will trigger an initialization of the provided AudioProcessing object. |
| 35 | // The function returns any error codes passed from the AudioProcessing |
| 36 | // ProcessReverseStream method. |
| 37 | int ProcessReverseAudioFrame(AudioProcessing* ap, AudioFrame* frame); |
| 38 | |
| 39 | } // namespace webrtc |
| 40 | |
| 41 | #endif // MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_FRAME_PROXIES_H_ |