OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // |buffer| must be of equal or greater size than what is returned by | 51 // |buffer| must be of equal or greater size than what is returned by |
52 // RequiredBufferSize(). This is to avoid unnecessary memcpy. | 52 // RequiredBufferSize(). This is to avoid unnecessary memcpy. |
53 void GetPlayoutData(int8_t* buffer); | 53 void GetPlayoutData(int8_t* buffer); |
54 | 54 |
55 // Consumes the audio data in |buffer| and sends it to the WebRTC layer in | 55 // Consumes the audio data in |buffer| and sends it to the WebRTC layer in |
56 // chunks of 10ms. The provided delay estimates in |playout_delay_ms| and | 56 // chunks of 10ms. The provided delay estimates in |playout_delay_ms| and |
57 // |record_delay_ms| are given to the AEC in the audio processing module. | 57 // |record_delay_ms| are given to the AEC in the audio processing module. |
58 // They can be fixed values on most platforms and they are ignored if an | 58 // They can be fixed values on most platforms and they are ignored if an |
59 // external (hardware/built-in) AEC is used. | 59 // external (hardware/built-in) AEC is used. |
60 // The size of |buffer| is given by |size_in_bytes| and must be equal to | 60 // The size of |buffer| is given by |size_in_bytes| and must be equal to |
61 // |desired_frame_size_bytes_|. A CHECK will be hit if this is not the case. | 61 // |desired_frame_size_bytes_|. A RTC_CHECK will be hit if this is not the |
| 62 // case. |
62 // Example: buffer size is 5ms => call #1 stores 5ms of data, call #2 stores | 63 // Example: buffer size is 5ms => call #1 stores 5ms of data, call #2 stores |
63 // 5ms of data and sends a total of 10ms to WebRTC and clears the intenal | 64 // 5ms of data and sends a total of 10ms to WebRTC and clears the intenal |
64 // cache. Call #3 restarts the scheme above. | 65 // cache. Call #3 restarts the scheme above. |
65 void DeliverRecordedData(const int8_t* buffer, | 66 void DeliverRecordedData(const int8_t* buffer, |
66 size_t size_in_bytes, | 67 size_t size_in_bytes, |
67 int playout_delay_ms, | 68 int playout_delay_ms, |
68 int record_delay_ms); | 69 int record_delay_ms); |
69 | 70 |
70 private: | 71 private: |
71 // Device buffer that works with 10ms chunks of data both for playout and | 72 // Device buffer that works with 10ms chunks of data both for playout and |
(...skipping 26 matching lines...) Expand all Loading... |
98 // Number of bytes in input (contains recorded samples) cache. | 99 // Number of bytes in input (contains recorded samples) cache. |
99 size_t record_cached_bytes_; | 100 size_t record_cached_bytes_; |
100 // Read and write pointers used in the buffering scheme on the recording side. | 101 // Read and write pointers used in the buffering scheme on the recording side. |
101 size_t record_read_pos_; | 102 size_t record_read_pos_; |
102 size_t record_write_pos_; | 103 size_t record_write_pos_; |
103 }; | 104 }; |
104 | 105 |
105 } // namespace webrtc | 106 } // namespace webrtc |
106 | 107 |
107 #endif // WEBRTC_MODULES_AUDIO_DEVICE_FINE_AUDIO_BUFFER_H_ | 108 #endif // WEBRTC_MODULES_AUDIO_DEVICE_FINE_AUDIO_BUFFER_H_ |
OLD | NEW |