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

Unified Diff: third_party/WebKit/public/platform/WebAudioDevice.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: third_party/WebKit/public/platform/WebAudioDevice.h
diff --git a/third_party/WebKit/public/platform/WebAudioDevice.h b/third_party/WebKit/public/platform/WebAudioDevice.h
index d27483bc32a9c5010a3cef706acba13ba0082679..ae72e237f01c75928508a4ec82855ad80d7479ce 100644
--- a/third_party/WebKit/public/platform/WebAudioDevice.h
+++ b/third_party/WebKit/public/platform/WebAudioDevice.h
@@ -34,6 +34,16 @@
namespace blink {
+// Representation of device audio stream position.
+
+struct BLINK_PLATFORM_EXPORT WebAudioTimestamp {
+ WebAudioTimestamp() = default;
+ WebAudioTimestamp(size_t frames, double seconds)
+ : frames(frames), seconds(seconds) {}
+ size_t frames;
+ double seconds;
+};
+
// Abstract interface to the Chromium audio system.
class WebAudioDevice {
@@ -41,6 +51,8 @@ public:
class BLINK_PLATFORM_EXPORT RenderCallback {
public:
virtual void render(const WebVector<float*>& sourceData, const WebVector<float*>& destinationData, size_t numberOfFrames);
+ // An alternate version which provides also a current audio timestamp for the device, default implementation just invokes the above method.
+ virtual void render(const WebVector<float*>& sourceData, const WebVector<float*>& destinationData, size_t numberOfFrames, const WebAudioTimestamp&);
protected:
virtual ~RenderCallback();

Powered by Google App Engine
This is Rietveld 408576698