| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 99 |
| 100 // The offline version of render() method. If the rendering needs to be | 100 // The offline version of render() method. If the rendering needs to be |
| 101 // suspended after checking, this stops the rendering and returns true. | 101 // suspended after checking, this stops the rendering and returns true. |
| 102 // Otherwise, it returns false after rendering one quantum. | 102 // Otherwise, it returns false after rendering one quantum. |
| 103 bool renderIfNotSuspended(AudioBus* sourceBus, | 103 bool renderIfNotSuspended(AudioBus* sourceBus, |
| 104 AudioBus* destinationBus, | 104 AudioBus* destinationBus, |
| 105 size_t numberOfFrames); | 105 size_t numberOfFrames); |
| 106 | 106 |
| 107 // This AudioHandler renders into this AudioBuffer. | 107 // This AudioHandler renders into this AudioBuffer. |
| 108 // This Persistent doesn't make a reference cycle including the owner | 108 // This Persistent doesn't make a reference cycle including the owner |
| 109 // OfflineAudioDestinationNode. | 109 // OfflineAudioDestinationNode. It is accessed by both audio and main thread. |
| 110 Persistent<AudioBuffer> m_renderTarget; | 110 CrossThreadPersistent<AudioBuffer> m_renderTarget; |
| 111 // Temporary AudioBus for each render quantum. | 111 // Temporary AudioBus for each render quantum. |
| 112 RefPtr<AudioBus> m_renderBus; | 112 RefPtr<AudioBus> m_renderBus; |
| 113 | 113 |
| 114 // Rendering thread. | 114 // Rendering thread. |
| 115 std::unique_ptr<WebThread> m_renderThread; | 115 std::unique_ptr<WebThread> m_renderThread; |
| 116 | 116 |
| 117 // These variables are for counting the number of frames for the current | 117 // These variables are for counting the number of frames for the current |
| 118 // progress and the remaining frames to be processed. | 118 // progress and the remaining frames to be processed. |
| 119 size_t m_framesProcessed; | 119 size_t m_framesProcessed; |
| 120 size_t m_framesToProcess; | 120 size_t m_framesToProcess; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 133 static OfflineAudioDestinationNode* create(BaseAudioContext*, | 133 static OfflineAudioDestinationNode* create(BaseAudioContext*, |
| 134 AudioBuffer* renderTarget); | 134 AudioBuffer* renderTarget); |
| 135 | 135 |
| 136 private: | 136 private: |
| 137 OfflineAudioDestinationNode(BaseAudioContext&, AudioBuffer* renderTarget); | 137 OfflineAudioDestinationNode(BaseAudioContext&, AudioBuffer* renderTarget); |
| 138 }; | 138 }; |
| 139 | 139 |
| 140 } // namespace blink | 140 } // namespace blink |
| 141 | 141 |
| 142 #endif // OfflineAudioDestinationNode_h | 142 #endif // OfflineAudioDestinationNode_h |
| OLD | NEW |