| 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 } | 281 } |
| 282 | 282 |
| 283 // Update some stats but do it on the task queue to ensure that the members | 283 // Update some stats but do it on the task queue to ensure that the members |
| 284 // are modified and read on the same thread. | 284 // are modified and read on the same thread. |
| 285 task_queue_.PostTask(rtc::Bind(&AudioDeviceBuffer::UpdateRecStats, this, | 285 task_queue_.PostTask(rtc::Bind(&AudioDeviceBuffer::UpdateRecStats, this, |
| 286 audio_buffer, num_samples)); | 286 audio_buffer, num_samples)); |
| 287 return 0; | 287 return 0; |
| 288 } | 288 } |
| 289 | 289 |
| 290 int32_t AudioDeviceBuffer::DeliverRecordedData() { | 290 int32_t AudioDeviceBuffer::DeliverRecordedData() { |
| 291 RTC_DCHECK(audio_transport_cb_); | |
| 292 rtc::CritScope lock(&_critSectCb); | 291 rtc::CritScope lock(&_critSectCb); |
| 293 | 292 |
| 294 if (!audio_transport_cb_) { | 293 if (!audio_transport_cb_) { |
| 295 LOG(LS_WARNING) << "Invalid audio transport"; | 294 LOG(LS_WARNING) << "Invalid audio transport"; |
| 296 return 0; | 295 return 0; |
| 297 } | 296 } |
| 298 | 297 |
| 299 int32_t res(0); | 298 int32_t res(0); |
| 300 uint32_t newMicLevel(0); | 299 uint32_t newMicLevel(0); |
| 301 uint32_t totalDelayMS = play_delay_ms_ + rec_delay_ms_; | 300 uint32_t totalDelayMS = play_delay_ms_ + rec_delay_ms_; |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 int16_t max_abs = WebRtcSpl_MaxAbsValueW16( | 490 int16_t max_abs = WebRtcSpl_MaxAbsValueW16( |
| 492 static_cast<int16_t*>(const_cast<void*>(audio_buffer)), | 491 static_cast<int16_t*>(const_cast<void*>(audio_buffer)), |
| 493 num_samples * play_channels_); | 492 num_samples * play_channels_); |
| 494 if (max_abs > max_play_level_) { | 493 if (max_abs > max_play_level_) { |
| 495 max_play_level_ = max_abs; | 494 max_play_level_ = max_abs; |
| 496 } | 495 } |
| 497 } | 496 } |
| 498 } | 497 } |
| 499 | 498 |
| 500 } // namespace webrtc | 499 } // namespace webrtc |
| OLD | NEW |