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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 LOG(INFO) << "average: " | 93 LOG(INFO) << "average: " |
94 << static_cast<float>(total_diff_time) / num_measurements; | 94 << static_cast<float>(total_diff_time) / num_measurements; |
95 } | 95 } |
96 | 96 |
97 // Add UMA histogram to keep track of the case when only zeros have been | 97 // Add UMA histogram to keep track of the case when only zeros have been |
98 // recorded. Ensure that recording callbacks have started and that at least | 98 // recorded. Ensure that recording callbacks have started and that at least |
99 // one timer event has been able to update |num_rec_level_is_zero_|. | 99 // one timer event has been able to update |num_rec_level_is_zero_|. |
100 // I am avoiding use of the task queue here since we are under destruction | 100 // I am avoiding use of the task queue here since we are under destruction |
101 // and reading these members on the creating thread feels safe. | 101 // and reading these members on the creating thread feels safe. |
102 if (rec_callbacks_ > 0 && num_stat_reports_ > 0) { | 102 if (rec_callbacks_ > 0 && num_stat_reports_ > 0) { |
103 RTC_LOGGED_HISTOGRAM_BOOLEAN("WebRTC.Audio.RecordedOnlyZeros", | 103 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.RecordedOnlyZeros", |
104 static_cast<int>(num_stat_reports_ == num_rec_level_is_zero_)); | 104 static_cast<int>(num_stat_reports_ == num_rec_level_is_zero_)); |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
108 int32_t AudioDeviceBuffer::RegisterAudioCallback( | 108 int32_t AudioDeviceBuffer::RegisterAudioCallback( |
109 AudioTransport* audio_callback) { | 109 AudioTransport* audio_callback) { |
110 LOG(INFO) << __FUNCTION__; | 110 LOG(INFO) << __FUNCTION__; |
111 rtc::CritScope lock(&_critSectCb); | 111 rtc::CritScope lock(&_critSectCb); |
112 audio_transport_cb_ = audio_callback; | 112 audio_transport_cb_ = audio_callback; |
113 return 0; | 113 return 0; |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 int16_t max_abs = WebRtcSpl_MaxAbsValueW16( | 491 int16_t max_abs = WebRtcSpl_MaxAbsValueW16( |
492 static_cast<int16_t*>(const_cast<void*>(audio_buffer)), | 492 static_cast<int16_t*>(const_cast<void*>(audio_buffer)), |
493 num_samples * play_channels_); | 493 num_samples * play_channels_); |
494 if (max_abs > max_play_level_) { | 494 if (max_abs > max_play_level_) { |
495 max_play_level_ = max_abs; | 495 max_play_level_ = max_abs; |
496 } | 496 } |
497 } | 497 } |
498 } | 498 } |
499 | 499 |
500 } // namespace webrtc | 500 } // namespace webrtc |
OLD | NEW |