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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
195 void BlockBuffer::ReInit() { | 195 void BlockBuffer::ReInit() { |
196 WebRtc_InitBuffer(buffer_); | 196 WebRtc_InitBuffer(buffer_); |
197 } | 197 } |
198 | 198 |
199 void BlockBuffer::Insert(const float block[PART_LEN]) { | 199 void BlockBuffer::Insert(const float block[PART_LEN]) { |
200 WebRtc_WriteBuffer(buffer_, block, 1); | 200 WebRtc_WriteBuffer(buffer_, block, 1); |
201 } | 201 } |
202 | 202 |
203 void BlockBuffer::ExtractExtendedBlock(float extended_block[PART_LEN2]) { | 203 void BlockBuffer::ExtractExtendedBlock(float extended_block[PART_LEN2]) { |
204 float* block_ptr = NULL; | 204 float* block_ptr = NULL; |
205 size_t read_elements; | |
peah-webrtc
2017/07/07 14:28:56
I think you should move the declaration to line 21
saza WebRTC
2017/07/10 06:53:16
Done.
| |
205 RTC_DCHECK_LT(0, AvaliableSpace()); | 206 RTC_DCHECK_LT(0, AvaliableSpace()); |
206 | 207 |
207 // Extract the previous block. | 208 // Extract the previous block. |
208 WebRtc_MoveReadPtr(buffer_, -1); | 209 WebRtc_MoveReadPtr(buffer_, -1); |
209 WebRtc_ReadBuffer(buffer_, reinterpret_cast<void**>(&block_ptr), | 210 read_elements = WebRtc_ReadBuffer( |
210 &extended_block[0], 1); | 211 buffer_, reinterpret_cast<void**>(&block_ptr), &extended_block[0], 1); |
212 RTC_CHECK_EQ(read_elements, 1); | |
211 if (block_ptr != &extended_block[0]) { | 213 if (block_ptr != &extended_block[0]) { |
212 memcpy(&extended_block[0], block_ptr, PART_LEN * sizeof(float)); | 214 memcpy(&extended_block[0], block_ptr, PART_LEN * sizeof(float)); |
213 } | 215 } |
214 | 216 |
215 // Extract the current block. | 217 // Extract the current block. |
216 WebRtc_ReadBuffer(buffer_, reinterpret_cast<void**>(&block_ptr), | 218 read_elements = |
217 &extended_block[PART_LEN], 1); | 219 WebRtc_ReadBuffer(buffer_, reinterpret_cast<void**>(&block_ptr), |
220 &extended_block[PART_LEN], 1); | |
221 RTC_CHECK_EQ(read_elements, 1); | |
218 if (block_ptr != &extended_block[PART_LEN]) { | 222 if (block_ptr != &extended_block[PART_LEN]) { |
219 memcpy(&extended_block[PART_LEN], block_ptr, PART_LEN * sizeof(float)); | 223 memcpy(&extended_block[PART_LEN], block_ptr, PART_LEN * sizeof(float)); |
220 } | 224 } |
221 } | 225 } |
222 | 226 |
223 int BlockBuffer::AdjustSize(int buffer_size_decrease) { | 227 int BlockBuffer::AdjustSize(int buffer_size_decrease) { |
224 return WebRtc_MoveReadPtr(buffer_, buffer_size_decrease); | 228 return WebRtc_MoveReadPtr(buffer_, buffer_size_decrease); |
225 } | 229 } |
226 | 230 |
227 size_t BlockBuffer::Size() { | 231 size_t BlockBuffer::Size() { |
(...skipping 1810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2038 | 2042 |
2039 int WebRtcAec_system_delay(AecCore* self) { | 2043 int WebRtcAec_system_delay(AecCore* self) { |
2040 return self->system_delay; | 2044 return self->system_delay; |
2041 } | 2045 } |
2042 | 2046 |
2043 void WebRtcAec_SetSystemDelay(AecCore* self, int delay) { | 2047 void WebRtcAec_SetSystemDelay(AecCore* self, int delay) { |
2044 RTC_DCHECK_GE(delay, 0); | 2048 RTC_DCHECK_GE(delay, 0); |
2045 self->system_delay = delay; | 2049 self->system_delay = delay; |
2046 } | 2050 } |
2047 } // namespace webrtc | 2051 } // namespace webrtc |
OLD | NEW |