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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.h

Issue 2186813003: Sub-sample accurate start of OscillatorNode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adjust thresholds for Mac 10.11 (retina) Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // Get frame information for the current time quantum. 81 // Get frame information for the current time quantum.
82 // We handle the transition into PLAYING_STATE and FINISHED_STATE here, 82 // We handle the transition into PLAYING_STATE and FINISHED_STATE here,
83 // zeroing out portions of the outputBus which are outside the range of 83 // zeroing out portions of the outputBus which are outside the range of
84 // startFrame and endFrame. 84 // startFrame and endFrame.
85 // 85 //
86 // Each frame time is relative to the context's currentSampleFrame(). 86 // Each frame time is relative to the context's currentSampleFrame().
87 // quantumFrameOffset : Offset frame in this time quantum to start 87 // quantumFrameOffset : Offset frame in this time quantum to start
88 // rendering. 88 // rendering.
89 // nonSilentFramesToProcess : Number of frames rendering non-silence (will be 89 // nonSilentFramesToProcess : Number of frames rendering non-silence (will be
90 // <= quantumFrameSize). 90 // <= quantumFrameSize).
91 // startFrameOffset : The fractional frame offset from quantumFrameOffset
92 // and the actual starting time of the source. This is
93 // non-zero only when transitioning from the
94 // SCHEDULED_STATE to the PLAYING_STATE.
91 void updateSchedulingInfo(size_t quantumFrameSize, 95 void updateSchedulingInfo(size_t quantumFrameSize,
92 AudioBus* outputBus, 96 AudioBus* outputBus,
93 size_t& quantumFrameOffset, 97 size_t& quantumFrameOffset,
94 size_t& nonSilentFramesToProcess); 98 size_t& nonSilentFramesToProcess,
99 double& startFrameOffset);
95 100
96 // Called when we have no more sound to play or the stop() time has been 101 // Called when we have no more sound to play or the stop() time has been
97 // reached. No onEnded event is called. 102 // reached. No onEnded event is called.
98 virtual void finishWithoutOnEnded(); 103 virtual void finishWithoutOnEnded();
99 104
100 // Like finishWithoutOnEnded(), but an onEnded (if specified) is called. 105 // Like finishWithoutOnEnded(), but an onEnded (if specified) is called.
101 virtual void finish(); 106 virtual void finish();
102 107
103 void notifyEnded(); 108 void notifyEnded();
104 109
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 DEFINE_INLINE_VIRTUAL_TRACE() { AudioNode::trace(visitor); } 150 DEFINE_INLINE_VIRTUAL_TRACE() { AudioNode::trace(visitor); }
146 151
147 protected: 152 protected:
148 explicit AudioScheduledSourceNode(BaseAudioContext&); 153 explicit AudioScheduledSourceNode(BaseAudioContext&);
149 AudioScheduledSourceHandler& audioScheduledSourceHandler() const; 154 AudioScheduledSourceHandler& audioScheduledSourceHandler() const;
150 }; 155 };
151 156
152 } // namespace blink 157 } // namespace blink
153 158
154 #endif // AudioScheduledSourceNode_h 159 #endif // AudioScheduledSourceNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698