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

Unified 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: Now uses and array instead Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/audio_device/audio_device_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_device/audio_device_buffer.h
diff --git a/webrtc/modules/audio_device/audio_device_buffer.h b/webrtc/modules/audio_device/audio_device_buffer.h
index ee6b2297c77e8e3a981615e52d3c0ccf0db7c767..f4be649285b93001045ef5517176dd6e829f13ab 100644
--- a/webrtc/modules/audio_device/audio_device_buffer.h
+++ b/webrtc/modules/audio_device/audio_device_buffer.h
@@ -11,6 +11,8 @@
#ifndef WEBRTC_MODULES_AUDIO_DEVICE_AUDIO_DEVICE_BUFFER_H_
#define WEBRTC_MODULES_AUDIO_DEVICE_AUDIO_DEVICE_BUFFER_H_
+#include <map>
magjed_webrtc 2016/07/29 13:13:20 remove
+
#include "webrtc/base/criticalsection.h"
#include "webrtc/base/task_queue.h"
#include "webrtc/base/thread_checker.h"
@@ -23,6 +25,9 @@ class CriticalSectionWrapper;
const uint32_t kPulsePeriodMs = 1000;
const size_t kMaxBufferSizeBytes = 3840; // 10ms in stereo @ 96kHz
+// Delta times between two successive playout callbacks are limited to this
+// value before added to an internal array.
+const size_t kMaxDeltaTimeInMs = 500;
class AudioDeviceObserver;
@@ -167,6 +172,16 @@ class AudioDeviceBuffer {
// Time stamp of last stat report.
uint64_t last_log_stat_time_;
+
+ // Time stamp of last playout callback.
+ uint64_t last_playout_time_;
+
+ // An array where the position corresponds to time differences (in
+ // milliseconds) between two successive playout callbacks, and the stored
+ // value is the number of times a given time difference was found.
+ // Writing to the array is done without a lock since it is only read once at
+ // destruction when no audio is running.
+ uint32_t playout_diff_times_[kMaxDeltaTimeInMs + 1] = {0};
};
} // namespace webrtc
« no previous file with comments | « no previous file | webrtc/modules/audio_device/audio_device_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698