Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: webrtc/modules/audio_device/audio_device_buffer.h

Issue 2190343002: Adds delta-time logging for audio playout (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
11 #ifndef WEBRTC_MODULES_AUDIO_DEVICE_AUDIO_DEVICE_BUFFER_H_ 11 #ifndef WEBRTC_MODULES_AUDIO_DEVICE_AUDIO_DEVICE_BUFFER_H_
12 #define WEBRTC_MODULES_AUDIO_DEVICE_AUDIO_DEVICE_BUFFER_H_ 12 #define WEBRTC_MODULES_AUDIO_DEVICE_AUDIO_DEVICE_BUFFER_H_
13 13
14 #include <map>
15
14 #include "webrtc/base/criticalsection.h" 16 #include "webrtc/base/criticalsection.h"
15 #include "webrtc/base/task_queue.h" 17 #include "webrtc/base/task_queue.h"
16 #include "webrtc/base/thread_checker.h" 18 #include "webrtc/base/thread_checker.h"
17 #include "webrtc/modules/audio_device/include/audio_device.h" 19 #include "webrtc/modules/audio_device/include/audio_device.h"
18 #include "webrtc/system_wrappers/include/file_wrapper.h" 20 #include "webrtc/system_wrappers/include/file_wrapper.h"
19 #include "webrtc/typedefs.h" 21 #include "webrtc/typedefs.h"
20 22
21 namespace webrtc { 23 namespace webrtc {
22 class CriticalSectionWrapper; 24 class CriticalSectionWrapper;
23 25
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 uint64_t last_rec_samples_; 162 uint64_t last_rec_samples_;
161 163
162 // Total number of played audio samples. 164 // Total number of played audio samples.
163 uint64_t play_samples_; 165 uint64_t play_samples_;
164 166
165 // Total number of played samples stored at the previous timer task. 167 // Total number of played samples stored at the previous timer task.
166 uint64_t last_play_samples_; 168 uint64_t last_play_samples_;
167 169
168 // Time stamp of last stat report. 170 // Time stamp of last stat report.
169 uint64_t last_log_stat_time_; 171 uint64_t last_log_stat_time_;
172
173 uint64_t last_playout_time_;
174
175 // A map where the key value corresponds to time differences (in milliseconds)
176 // between two successive playout callbacks, and the mapped element represents
177 // the number of times a given time difference was found.
178 // Writing to the map is done without a lock since it is only read once at
179 // destruction when no audio is running.
180 std::map<int, int> playout_diff_time_map_;
magjed_webrtc 2016/07/29 10:07:11 You can consider using std::unordered_map instead
henrika_webrtc 2016/07/29 11:11:00 I think it only affects reading and not writing. A
magjed_webrtc 2016/07/29 12:16:07 It affects both reading and writing, a map will us
henrika_webrtc 2016/07/29 12:50:24 Acknowledged.
170 }; 181 };
171 182
172 } // namespace webrtc 183 } // namespace webrtc
173 184
174 #endif // WEBRTC_MODULES_AUDIO_DEVICE_AUDIO_DEVICE_BUFFER_H_ 185 #endif // WEBRTC_MODULES_AUDIO_DEVICE_AUDIO_DEVICE_BUFFER_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_device/audio_device_buffer.cc » ('j') | webrtc/modules/audio_device/audio_device_buffer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698