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

Unified Diff: media/audio/audio_output_controller.h

Issue 1538563002: 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: Code review fix. git cl format. Rebase. 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
« no previous file with comments | « media/audio/audio_low_latency_input_output_unittest.cc ('k') | media/audio/audio_output_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..95be9f4cae3fff2ba06a5493d0a927242798aa11 100644
--- a/media/audio/audio_output_controller.h
+++ b/media/audio/audio_output_controller.h
@@ -8,6 +8,7 @@
#include "base/atomic_ref_count.h"
#include "base/callback.h"
#include "base/memory/ref_counted.h"
+#include "base/threading/thread_checker.h"
#include "base/timer/timer.h"
#include "build/build_config.h"
#include "media/audio/audio_io.h"
@@ -82,8 +83,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 renderer (typically the OS). The renderer
+ // 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).
@@ -153,7 +158,9 @@ class MEDIA_EXPORT AudioOutputController
const base::Closure& callback);
// AudioSourceCallback implementation.
- int OnMoreData(AudioBus* dest, uint32 total_bytes_delay) override;
+ int OnMoreData(AudioBus* dest,
+ uint32_t total_bytes_delay,
+ uint32_t frames_skipped) override;
void OnError(AudioOutputStream* stream) override;
// AudioDeviceListener implementation. When called AudioOutputController will
« no previous file with comments | « media/audio/audio_low_latency_input_output_unittest.cc ('k') | media/audio/audio_output_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698