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

Unified Diff: media/audio/audio_output_controller.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: 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/audio_output_controller.h
diff --git a/media/audio/audio_output_controller.h b/media/audio/audio_output_controller.h
index 7820665440b4e0316e8d66a8fcfcdaade1d302db..54e5b029182090efb988b50295a3f2cdf1d4935d 100644
--- a/media/audio/audio_output_controller.h
+++ b/media/audio/audio_output_controller.h
@@ -82,8 +82,12 @@ class MEDIA_EXPORT AudioOutputController
// Notify the synchronous reader the number of bytes in the
// AudioOutputController not yet played. This is used by SyncReader to
- // prepare more data and perform synchronization.
- virtual void UpdatePendingBytes(uint32 bytes) = 0;
+ // prepare more data and perform synchronization. Also inform about if any
+ // frames has been skipped by the consumer. The source can handle this
+ // appropriately depending on the type of source. An ordinary file playout
+ // would ignore this.
+ virtual void UpdatePendingBytes(uint32_t bytes,
+ uint32_t frames_skipped) = 0;
// Attempts to completely fill |dest|, zeroing |dest| if the request can not
// be fulfilled (due to timeout).
@@ -154,6 +158,7 @@ class MEDIA_EXPORT AudioOutputController
// AudioSourceCallback implementation.
int OnMoreData(AudioBus* dest, uint32 total_bytes_delay) override;
+ void OnSkippedData(uint32 frames_skipped) override;
void OnError(AudioOutputStream* stream) override;
// AudioDeviceListener implementation. When called AudioOutputController will
@@ -258,6 +263,10 @@ class MEDIA_EXPORT AudioOutputController
bool ignore_errors_during_stop_close_;
base::Lock error_lock_;
+ // Stores the number of skipped frames reported in OnSkippedData(), passed on
+ // to the provider in OnMoreData().
+ uint32_t frames_skipped_;
+
DISALLOW_COPY_AND_ASSIGN(AudioOutputController);
};

Powered by Google App Engine
This is Rietveld 408576698