Index: media/audio/audio_io.h |
diff --git a/media/audio/audio_io.h b/media/audio/audio_io.h |
index 66ff3f2dc98cf7af2324fa1cb58944e29c003342..d45f7225b74cbb689b68c72f86e732a44f21a9e3 100644 |
--- a/media/audio/audio_io.h |
+++ b/media/audio/audio_io.h |
@@ -7,6 +7,7 @@ |
#include <stdint.h> |
+#include "base/time/time.h" |
#include "media/base/audio_bus.h" |
// Low-level audio output support. To make sound there are 3 objects involved: |
@@ -59,13 +60,18 @@ class MEDIA_EXPORT AudioOutputStream { |
public: |
virtual ~AudioSourceCallback() {} |
- // Provide more data by fully filling |dest|. The source will return |
- // the number of frames it filled. |total_bytes_delay| contains current |
- // number of bytes of delay buffered by the AudioOutputStream. |
- // |frames_skipped| contains the number of frames skipped by the consumer. |
- virtual int OnMoreData(AudioBus* dest, |
- uint32_t total_bytes_delay, |
- uint32_t frames_skipped) = 0; |
+ // Provide more data by fully filling |dest|. The source will return the |
+ // number of frames it filled. |target_playout_time| is the time when the |
+ // first sample added to |dest| is expected to be played and should equal |
+ // the audio output delay added to the time when it was calculated. It may |
+ // be used to determine when to make adjustments to keep audio output |
+ // synchronized, such as adjusting the media clock rate or adding or |
+ // dropping frames. The accuracy of |target_playout_time| may vary depending |
+ // on the platform and implementation. |prior_frames_skipped| is the number |
+ // of frames skipped by the consumer. |
+ virtual int OnMoreData(base::TimeTicks target_playout_time, |
+ int prior_frames_skipped, |
+ AudioBus* dest) = 0; |
// There was an error while playing a buffer. Audio source cannot be |
// destroyed yet. No direct action needed by the AudioStream, but it is |
@@ -114,14 +120,14 @@ class MEDIA_EXPORT AudioInputStream { |
virtual void OnData(AudioInputStream* stream, |
const AudioBus* source, |
uint32_t hardware_delay_bytes, |
- double volume){}; |
+ double volume) {} |
// TODO(henrika): don't use; to be removed. |
virtual void OnData(AudioInputStream* stream, |
const uint8_t* src, |
uint32_t size, |
uint32_t hardware_delay_bytes, |
- double volume){}; |
+ double volume) {} |
// There was an error while recording audio. The audio sink cannot be |
// destroyed yet. No direct action needed by the AudioInputStream, but it |