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

Unified Diff: third_party/WebKit/Source/platform/audio/AudioDestination.h

Issue 2777903005: Add WebThread in AudioDestination to support AudioWorkletThread (Closed)
Patch Set: Remove callback between Destination and FIFO Created 3 years, 8 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/platform/audio/AudioDestination.h
diff --git a/third_party/WebKit/Source/platform/audio/AudioDestination.h b/third_party/WebKit/Source/platform/audio/AudioDestination.h
index 6bf30f33af2608473c36eb0b59c957efea71d48b..4677a1b63ef6bab40aab7f960556cd9f58e91abf 100644
--- a/third_party/WebKit/Source/platform/audio/AudioDestination.h
+++ b/third_party/WebKit/Source/platform/audio/AudioDestination.h
@@ -43,6 +43,7 @@ namespace blink {
class PushPullFIFO;
class SecurityOrigin;
class WebAudioLatencyHint;
+class WebThread;
// The AudioDestination class is an audio sink interface between the media
// renderer and the Blink's WebAudio module. It has a FIFO to adapt the
@@ -73,6 +74,14 @@ class PLATFORM_EXPORT AudioDestination : public WebAudioDevice::RenderCallback {
double delay_timestamp,
size_t prior_frames_skipped) override;
+ // The actual render request to the WebAudio destination node. This triggers
+ // the WebAudio rendering pipe line on the web thread.
+ void RequestRenderOnWebThread(size_t frames_requested,
+ size_t frames_to_render,
+ double delay,
+ double delay_timestamp,
+ size_t prior_frames_skipped);
+
virtual void Start();
virtual void Stop();
@@ -108,6 +117,9 @@ class PLATFORM_EXPORT AudioDestination : public WebAudioDevice::RenderCallback {
// the callback function from the actual audio device.
std::unique_ptr<PushPullFIFO> fifo_;
+ // WebThread for WebAudio rendering.
+ std::unique_ptr<WebThread> rendering_thread_;
o1ka 2017/04/18 14:14:57 Could you group data members by thread they are ac
hongchan 2017/04/18 18:16:08 Done.
+
size_t frames_elapsed_;
AudioIOPosition output_position_;
base::TimeTicks output_position_received_timestamp_;
@@ -116,6 +128,8 @@ class PLATFORM_EXPORT AudioDestination : public WebAudioDevice::RenderCallback {
bool CheckBufferSize();
size_t HardwareBufferSize();
o1ka 2017/04/18 14:14:57 Chromium style is first methods, then members. Is
hongchan 2017/04/18 18:16:08 Not that I know of. Eventually we're merging to Ch
+
+ bool IsRenderingThread();
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698