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

Unified Diff: media/base/audio_renderer_sink.h

Issue 2060833002: Implementation of 'AudioContext.getOutputTimestamp' method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added implementation for ALSA. Created 4 years, 5 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_renderer_sink.h
diff --git a/media/base/audio_renderer_sink.h b/media/base/audio_renderer_sink.h
index 268b9b6c45c33f2bfb02fc4352fb010bd7aed28e..be0a1e303538b8ccf8b2c5be1d11c21818675a78 100644
--- a/media/base/audio_renderer_sink.h
+++ b/media/base/audio_renderer_sink.h
@@ -18,6 +18,8 @@
namespace media {
+struct AudioTimestamp;
+
// AudioRendererSink is an interface representing the end-point for
// rendered audio. An implementation is expected to
// periodically call Render() on a callback object.
@@ -25,14 +27,20 @@ namespace media {
class AudioRendererSink
: public base::RefCountedThreadSafe<media::AudioRendererSink> {
public:
- class RenderCallback {
+ class MEDIA_EXPORT RenderCallback {
public:
// Attempts to completely fill all channels of |dest|, returns actual
// number of frames filled. |frames_skipped| contains the number of frames
// the consumer has skipped, if any.
virtual int Render(AudioBus* dest,
uint32_t frames_delayed,
- uint32_t frames_skipped) = 0;
+ uint32_t frames_skipped);
+ // An alternate version which provides also device stream position,
+ // if not overriden it just invokes the method above.
+ virtual int Render(AudioBus* dest,
+ uint32_t audio_delay_milliseconds,
+ uint32_t frames_skipped,
+ const AudioTimestamp& output_timestamp);
// Signals an error has occurred.
virtual void OnRenderError() = 0;

Powered by Google App Engine
This is Rietveld 408576698