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

Unified Diff: third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.h

Issue 2060833002: Implementation of 'AudioContext.getOutputTimestamp' method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implementation of 'AudioContext.getOutputTimestamp' method Created 4 years, 6 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/Source/modules/webaudio/AudioDestinationNode.h
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.h b/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.h
index a25e598b53617a89d01aa2b0466ae65ea470a49e..9f1125d0b791091122425ecbea73791adc0f2b07 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.h
+++ b/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.h
@@ -30,11 +30,13 @@
#include "platform/audio/AudioBus.h"
#include "platform/audio/AudioIOCallback.h"
#include "platform/audio/AudioSourceProvider.h"
+#include "wtf/ThreadingPrimitives.h"
namespace blink {
class AudioBus;
class AbstractAudioContext;
+class AudioTimestamp;
class AudioDestinationHandler : public AudioHandler, public AudioIOCallback {
public:
@@ -46,7 +48,7 @@ public:
// The audio hardware calls render() to get the next render quantum of audio into destinationBus.
// It will optionally give us local/live audio input in sourceBus (if it's not 0).
- void render(AudioBus* sourceBus, AudioBus* destinationBus, size_t numberOfFrames) final;
+ void render(AudioBus* sourceBus, AudioBus* destinationBus, size_t numberOfFrames, const WebAudioTimestamp& outputTimestamp) final;
size_t currentSampleFrame() const { return acquireLoad(&m_currentSampleFrame); }
double currentTime() const { return currentSampleFrame() / static_cast<double>(sampleRate()); }
@@ -56,6 +58,8 @@ public:
virtual void startRendering() = 0;
virtual void stopRendering() = 0;
+ WebAudioTimestamp outputTimestamp() const;
+
protected:
// LocalAudioInputProvider allows us to expose an AudioSourceProvider for local/live audio input.
// If there is local/live audio input, we call set() with the audio input data every render quantum.
@@ -88,6 +92,10 @@ protected:
// Counts the number of sample-frames processed by the destination.
size_t m_currentSampleFrame;
+ // FIXME(Mikhail) : when allowed use std::atomic<WebAudioTimestamp> instead of mutex.
hongchan 2016/06/14 17:10:38 FIXME -> TODO.
Mikhail 2016/06/17 09:36:57 I've changed the approach so that it is using 'loc
+ WebAudioTimestamp m_outputTimestamp;
+ mutable Mutex m_mutex;
+
LocalAudioInputProvider m_localAudioInputProvider;
};

Powered by Google App Engine
This is Rietveld 408576698