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

Unified Diff: webrtc/modules/audio_device/audio_device_buffer.h

Issue 2433393002: Avoids invalid copy of audio buffer to task queue (Closed)
Patch Set: nit Created 4 years, 2 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 5805db7743c7f7ccc43d4c84ee1604dfa019d33f..6967ebd757147762b5291abd25d8c1a7940e0b0e 100644
--- a/webrtc/modules/audio_device/audio_device_buffer.h
+++ b/webrtc/modules/audio_device/audio_device_buffer.h
@@ -86,8 +86,8 @@ class AudioDeviceBuffer {
// Updates counters in each play/record callback but does it on the task
// queue to ensure that they can be read by LogStats() without any locks since
// each task is serialized by the task queue.
- void UpdateRecStats(const void* audio_buffer, size_t num_samples);
- void UpdatePlayStats(const void* audio_buffer, size_t num_samples);
+ void UpdateRecStats(int16_t max_abs, size_t num_samples);
+ void UpdatePlayStats(int16_t max_abs, size_t num_samples);
// Ensures that methods are called on the same thread as the thread that
// creates this object.
@@ -202,6 +202,12 @@ class AudioDeviceBuffer {
// (two per second) in a row equals zero. The member is only incremented on
// the task queue and max once every 10th second.
size_t num_rec_level_is_zero_;
+
+ // Counts number of audio callbacks modulo 50 to create a signal when
+ // a new storage of audio stats shall be done.
+ // Only updated on the OS-specific audio thread that drives audio.
+ int16_t rec_stat_count_;
+ int16_t play_stat_count_;
};
} // 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