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

Unified Diff: media/base/audio_timestamp_helper.h

Issue 2101303004: Pass delay and timestamp to AudioSourceCallback::OnMoreData. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Fix Mac CQ errors. Created 4 years, 3 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
Index: media/base/audio_timestamp_helper.h
diff --git a/media/base/audio_timestamp_helper.h b/media/base/audio_timestamp_helper.h
index 40ac93cd3ef48e4e4e495719ef6195b66f01aa6c..1b599421e425601842dcbe4a4d33fdbcf6d0db31 100644
--- a/media/base/audio_timestamp_helper.h
+++ b/media/base/audio_timestamp_helper.h
@@ -30,6 +30,14 @@ namespace media {
// accumulated frames to reach a target timestamp.
class MEDIA_EXPORT AudioTimestampHelper {
public:
+ // Returns the time duration of the given number of frames of audio with the
+ // given sample rate (in samples per second).
+ static base::TimeDelta FramesToTime(int64_t frames, int samples_per_second);
+
+ // Returns the number of frames in the given duration of audio with the given
+ // sample rate (in samples per second).
+ static int64_t TimeToFrames(base::TimeDelta time, int samples_per_second);
+
explicit AudioTimestampHelper(int samples_per_second);
// Sets the base timestamp to |base_timestamp| and the sets count to 0.

Powered by Google App Engine
This is Rietveld 408576698