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

Unified Diff: media/audio/audio_parameters.h

Issue 1687213002: Express audio delay more precisely in frames rather than milliseconds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 10 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 | « media/audio/audio_output_stream_sink.cc ('k') | media/audio/audio_parameters.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_parameters.h
diff --git a/media/audio/audio_parameters.h b/media/audio/audio_parameters.h
index 3e6603bd075368cb3725e2f847d5ff86c6c7bcf8..2735d79af927889eef786b9acd907140230fd3ac 100644
--- a/media/audio/audio_parameters.h
+++ b/media/audio/audio_parameters.h
@@ -125,6 +125,12 @@ class MEDIA_EXPORT AudioParameters {
// Returns the number of bytes representing a frame of audio.
int GetBytesPerFrame() const;
+ // Returns the number of microseconds per frame of audio. Intentionally
+ // reported as a double to surface of partial microseconds per frame, which
+ // is common for many sample rates. Failing to account for these nanoseconds
+ // can lead to audio/video sync drift.
+ double GetMicrosecondsPerFrame() const;
+
// Returns the duration of this buffer as calculated from frames_per_buffer()
// and sample_rate().
base::TimeDelta GetBufferDuration() const;
« no previous file with comments | « media/audio/audio_output_stream_sink.cc ('k') | media/audio/audio_parameters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698