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

Unified Diff: media/audio/mac/audio_auhal_mac.h

Issue 1487983002: Forward the number of skipped frames by the OS in audio playout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Writing skipped frames to shared memory. Created 5 years 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
Index: media/audio/mac/audio_auhal_mac.h
diff --git a/media/audio/mac/audio_auhal_mac.h b/media/audio/mac/audio_auhal_mac.h
index 0cd648a90253fada50c3d6ee073defdca8f3967a..bd830d32946f81687caa95933632479cd8b58632 100644
--- a/media/audio/mac/audio_auhal_mac.h
+++ b/media/audio/mac/audio_auhal_mac.h
@@ -126,7 +126,9 @@ class AUHALStream : public AudioOutputStream {
// Gets the current playout latency value.
double GetPlayoutLatency(const AudioTimeStamp* output_time_stamp);
- void UpdatePlayoutTimestamp(const AudioTimeStamp* timestamp);
+ // Updates playout timestamp, current lost frames, and total lost frames and
+ // glitches stats.
+ void UpdatePlayoutTimestampAndStats(const AudioTimeStamp* timestamp);
// Called from the dtor and when the stream is reset.
void ReportAndResetStats();
@@ -182,6 +184,11 @@ class AUHALStream : public AudioOutputStream {
// Current buffer delay. Set by Render().
uint32 current_hardware_pending_bytes_;
+ // Lost frames not yet reported to the provider. Increased in
+ // UpdatePlayoutTimestampAndStats() if any lost frame since last time.
+ // Forwarded to the provider and reset in ProvideInput().
+ uint32_t current_lost_frames_;
+
// Stores the timestamp of the previous audio buffer requested by the OS.
// We use this in combination with |last_number_of_frames_| to detect when
// the OS has decided to skip rendering frames (i.e. a glitch).

Powered by Google App Engine
This is Rietveld 408576698