| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 OfflineAudioContext* context() const final; | 55 OfflineAudioContext* context() const final; |
| 56 | 56 |
| 57 // AudioDestinationHandler | 57 // AudioDestinationHandler |
| 58 void startRendering() override; | 58 void startRendering() override; |
| 59 void stopRendering() override; | 59 void stopRendering() override; |
| 60 unsigned long maxChannelCount() const override; | 60 unsigned long maxChannelCount() const override; |
| 61 | 61 |
| 62 float sampleRate() const override { return m_renderTarget->sampleRate(); } | 62 float sampleRate() const override { return m_renderTarget->sampleRate(); } |
| 63 | 63 |
| 64 size_t renderQuantumFrames() const { return renderQuantumSize; } | 64 size_t renderQuantumFrames() const { |
| 65 return AudioUtilities::kRenderQuantumFrames; |
| 66 } |
| 65 | 67 |
| 66 WebThread* offlineRenderThread(); | 68 WebThread* offlineRenderThread(); |
| 67 | 69 |
| 68 private: | 70 private: |
| 69 OfflineAudioDestinationHandler(AudioNode&, AudioBuffer* renderTarget); | 71 OfflineAudioDestinationHandler(AudioNode&, AudioBuffer* renderTarget); |
| 70 | 72 |
| 71 static const size_t renderQuantumSize; | |
| 72 | |
| 73 // Set up the rendering and start. After setting the context up, it will | 73 // Set up the rendering and start. After setting the context up, it will |
| 74 // eventually call |doOfflineRendering|. | 74 // eventually call |doOfflineRendering|. |
| 75 void startOfflineRendering(); | 75 void startOfflineRendering(); |
| 76 | 76 |
| 77 // Suspend the rendering loop and notify the main thread to resolve the | 77 // Suspend the rendering loop and notify the main thread to resolve the |
| 78 // associated promise. | 78 // associated promise. |
| 79 void suspendOfflineRendering(); | 79 void suspendOfflineRendering(); |
| 80 | 80 |
| 81 // Start the rendering loop. | 81 // Start the rendering loop. |
| 82 void doOfflineRendering(); | 82 void doOfflineRendering(); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 static OfflineAudioDestinationNode* create(BaseAudioContext*, | 125 static OfflineAudioDestinationNode* create(BaseAudioContext*, |
| 126 AudioBuffer* renderTarget); | 126 AudioBuffer* renderTarget); |
| 127 | 127 |
| 128 private: | 128 private: |
| 129 OfflineAudioDestinationNode(BaseAudioContext&, AudioBuffer* renderTarget); | 129 OfflineAudioDestinationNode(BaseAudioContext&, AudioBuffer* renderTarget); |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 } // namespace blink | 132 } // namespace blink |
| 133 | 133 |
| 134 #endif // OfflineAudioDestinationNode_h | 134 #endif // OfflineAudioDestinationNode_h |
| OLD | NEW |