OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 inline bool renderSilenceAndFinishIfNotLooping(AudioBus*, | 117 inline bool renderSilenceAndFinishIfNotLooping(AudioBus*, |
118 unsigned index, | 118 unsigned index, |
119 size_t framesToProcess); | 119 size_t framesToProcess); |
120 | 120 |
121 // Clamps grain parameters to the duration of the given AudioBuffer. | 121 // Clamps grain parameters to the duration of the given AudioBuffer. |
122 void clampGrainParameters(const AudioBuffer*); | 122 void clampGrainParameters(const AudioBuffer*); |
123 | 123 |
124 // m_buffer holds the sample data which this node outputs. | 124 // m_buffer holds the sample data which this node outputs. |
125 // This Persistent doesn't make a reference cycle including | 125 // This Persistent doesn't make a reference cycle including |
126 // AudioBufferSourceNode. | 126 // AudioBufferSourceNode. |
127 Persistent<AudioBuffer> m_buffer; | 127 // It is cross-thread, as it will be accessed by the audio and main threads. |
| 128 CrossThreadPersistent<AudioBuffer> m_buffer; |
128 | 129 |
129 // Pointers for the buffer and destination. | 130 // Pointers for the buffer and destination. |
130 std::unique_ptr<const float* []> m_sourceChannels; | 131 std::unique_ptr<const float* []> m_sourceChannels; |
131 std::unique_ptr<float* []> m_destinationChannels; | 132 std::unique_ptr<float* []> m_destinationChannels; |
132 | 133 |
133 RefPtr<AudioParamHandler> m_playbackRate; | 134 RefPtr<AudioParamHandler> m_playbackRate; |
134 RefPtr<AudioParamHandler> m_detune; | 135 RefPtr<AudioParamHandler> m_detune; |
135 | 136 |
136 bool didSetLooping() const { return acquireLoad(&m_didSetLooping); } | 137 bool didSetLooping() const { return acquireLoad(&m_didSetLooping); } |
137 void setDidSetLooping(bool loop) { | 138 void setDidSetLooping(bool loop) { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 private: | 205 private: |
205 AudioBufferSourceNode(BaseAudioContext&); | 206 AudioBufferSourceNode(BaseAudioContext&); |
206 | 207 |
207 Member<AudioParam> m_playbackRate; | 208 Member<AudioParam> m_playbackRate; |
208 Member<AudioParam> m_detune; | 209 Member<AudioParam> m_detune; |
209 }; | 210 }; |
210 | 211 |
211 } // namespace blink | 212 } // namespace blink |
212 | 213 |
213 #endif // AudioBufferSourceNode_h | 214 #endif // AudioBufferSourceNode_h |
OLD | NEW |