| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 void DeferredTaskHandler::markSummingJunctionDirty( | 88 void DeferredTaskHandler::markSummingJunctionDirty( |
| 89 AudioSummingJunction* summingJunction) { | 89 AudioSummingJunction* summingJunction) { |
| 90 ASSERT(isGraphOwner()); | 90 ASSERT(isGraphOwner()); |
| 91 m_dirtySummingJunctions.insert(summingJunction); | 91 m_dirtySummingJunctions.insert(summingJunction); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void DeferredTaskHandler::removeMarkedSummingJunction( | 94 void DeferredTaskHandler::removeMarkedSummingJunction( |
| 95 AudioSummingJunction* summingJunction) { | 95 AudioSummingJunction* summingJunction) { |
| 96 DCHECK(isMainThread()); | 96 DCHECK(isMainThread()); |
| 97 AutoLocker locker(*this); | 97 AutoLocker locker(*this); |
| 98 m_dirtySummingJunctions.remove(summingJunction); | 98 m_dirtySummingJunctions.erase(summingJunction); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void DeferredTaskHandler::markAudioNodeOutputDirty(AudioNodeOutput* output) { | 101 void DeferredTaskHandler::markAudioNodeOutputDirty(AudioNodeOutput* output) { |
| 102 ASSERT(isGraphOwner()); | 102 ASSERT(isGraphOwner()); |
| 103 DCHECK(isMainThread()); | 103 DCHECK(isMainThread()); |
| 104 m_dirtyAudioNodeOutputs.insert(output); | 104 m_dirtyAudioNodeOutputs.insert(output); |
| 105 } | 105 } |
| 106 | 106 |
| 107 void DeferredTaskHandler::removeMarkedAudioNodeOutput(AudioNodeOutput* output) { | 107 void DeferredTaskHandler::removeMarkedAudioNodeOutput(AudioNodeOutput* output) { |
| 108 ASSERT(isGraphOwner()); | 108 ASSERT(isGraphOwner()); |
| 109 DCHECK(isMainThread()); | 109 DCHECK(isMainThread()); |
| 110 m_dirtyAudioNodeOutputs.remove(output); | 110 m_dirtyAudioNodeOutputs.erase(output); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void DeferredTaskHandler::handleDirtyAudioSummingJunctions() { | 113 void DeferredTaskHandler::handleDirtyAudioSummingJunctions() { |
| 114 ASSERT(isGraphOwner()); | 114 ASSERT(isGraphOwner()); |
| 115 | 115 |
| 116 for (AudioSummingJunction* junction : m_dirtySummingJunctions) | 116 for (AudioSummingJunction* junction : m_dirtySummingJunctions) |
| 117 junction->updateRenderingState(); | 117 junction->updateRenderingState(); |
| 118 m_dirtySummingJunctions.clear(); | 118 m_dirtySummingJunctions.clear(); |
| 119 } | 119 } |
| 120 | 120 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 137 if (!m_automaticPullNodes.contains(node)) { | 137 if (!m_automaticPullNodes.contains(node)) { |
| 138 m_automaticPullNodes.insert(node); | 138 m_automaticPullNodes.insert(node); |
| 139 m_automaticPullNodesNeedUpdating = true; | 139 m_automaticPullNodesNeedUpdating = true; |
| 140 } | 140 } |
| 141 } | 141 } |
| 142 | 142 |
| 143 void DeferredTaskHandler::removeAutomaticPullNode(AudioHandler* node) { | 143 void DeferredTaskHandler::removeAutomaticPullNode(AudioHandler* node) { |
| 144 ASSERT(isGraphOwner()); | 144 ASSERT(isGraphOwner()); |
| 145 | 145 |
| 146 if (m_automaticPullNodes.contains(node)) { | 146 if (m_automaticPullNodes.contains(node)) { |
| 147 m_automaticPullNodes.remove(node); | 147 m_automaticPullNodes.erase(node); |
| 148 m_automaticPullNodesNeedUpdating = true; | 148 m_automaticPullNodesNeedUpdating = true; |
| 149 } | 149 } |
| 150 } | 150 } |
| 151 | 151 |
| 152 void DeferredTaskHandler::updateAutomaticPullNodes() { | 152 void DeferredTaskHandler::updateAutomaticPullNodes() { |
| 153 ASSERT(isGraphOwner()); | 153 ASSERT(isGraphOwner()); |
| 154 | 154 |
| 155 if (m_automaticPullNodesNeedUpdating) { | 155 if (m_automaticPullNodesNeedUpdating) { |
| 156 copyToVector(m_automaticPullNodes, m_renderingAutomaticPullNodes); | 156 copyToVector(m_automaticPullNodes, m_renderingAutomaticPullNodes); |
| 157 m_automaticPullNodesNeedUpdating = false; | 157 m_automaticPullNodesNeedUpdating = false; |
| 158 } | 158 } |
| 159 } | 159 } |
| 160 | 160 |
| 161 void DeferredTaskHandler::processAutomaticPullNodes(size_t framesToProcess) { | 161 void DeferredTaskHandler::processAutomaticPullNodes(size_t framesToProcess) { |
| 162 DCHECK(isAudioThread()); | 162 DCHECK(isAudioThread()); |
| 163 | 163 |
| 164 for (unsigned i = 0; i < m_renderingAutomaticPullNodes.size(); ++i) | 164 for (unsigned i = 0; i < m_renderingAutomaticPullNodes.size(); ++i) |
| 165 m_renderingAutomaticPullNodes[i]->processIfNecessary(framesToProcess); | 165 m_renderingAutomaticPullNodes[i]->processIfNecessary(framesToProcess); |
| 166 } | 166 } |
| 167 | 167 |
| 168 void DeferredTaskHandler::addChangedChannelCountMode(AudioHandler* node) { | 168 void DeferredTaskHandler::addChangedChannelCountMode(AudioHandler* node) { |
| 169 ASSERT(isGraphOwner()); | 169 ASSERT(isGraphOwner()); |
| 170 DCHECK(isMainThread()); | 170 DCHECK(isMainThread()); |
| 171 m_deferredCountModeChange.insert(node); | 171 m_deferredCountModeChange.insert(node); |
| 172 } | 172 } |
| 173 | 173 |
| 174 void DeferredTaskHandler::removeChangedChannelCountMode(AudioHandler* node) { | 174 void DeferredTaskHandler::removeChangedChannelCountMode(AudioHandler* node) { |
| 175 ASSERT(isGraphOwner()); | 175 ASSERT(isGraphOwner()); |
| 176 | 176 |
| 177 m_deferredCountModeChange.remove(node); | 177 m_deferredCountModeChange.erase(node); |
| 178 } | 178 } |
| 179 | 179 |
| 180 void DeferredTaskHandler::addChangedChannelInterpretation(AudioHandler* node) { | 180 void DeferredTaskHandler::addChangedChannelInterpretation(AudioHandler* node) { |
| 181 ASSERT(isGraphOwner()); | 181 ASSERT(isGraphOwner()); |
| 182 DCHECK(isMainThread()); | 182 DCHECK(isMainThread()); |
| 183 m_deferredChannelInterpretationChange.insert(node); | 183 m_deferredChannelInterpretationChange.insert(node); |
| 184 } | 184 } |
| 185 | 185 |
| 186 void DeferredTaskHandler::removeChangedChannelInterpretation( | 186 void DeferredTaskHandler::removeChangedChannelInterpretation( |
| 187 AudioHandler* node) { | 187 AudioHandler* node) { |
| 188 ASSERT(isGraphOwner()); | 188 ASSERT(isGraphOwner()); |
| 189 | 189 |
| 190 m_deferredChannelInterpretationChange.remove(node); | 190 m_deferredChannelInterpretationChange.erase(node); |
| 191 } | 191 } |
| 192 | 192 |
| 193 void DeferredTaskHandler::updateChangedChannelCountMode() { | 193 void DeferredTaskHandler::updateChangedChannelCountMode() { |
| 194 ASSERT(isGraphOwner()); | 194 ASSERT(isGraphOwner()); |
| 195 | 195 |
| 196 for (AudioHandler* node : m_deferredCountModeChange) | 196 for (AudioHandler* node : m_deferredCountModeChange) |
| 197 node->updateChannelCountMode(); | 197 node->updateChannelCountMode(); |
| 198 m_deferredCountModeChange.clear(); | 198 m_deferredCountModeChange.clear(); |
| 199 } | 199 } |
| 200 | 200 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 m_deletableOrphanHandlers.clear(); | 281 m_deletableOrphanHandlers.clear(); |
| 282 } | 282 } |
| 283 | 283 |
| 284 void DeferredTaskHandler::setAudioThreadToCurrentThread() { | 284 void DeferredTaskHandler::setAudioThreadToCurrentThread() { |
| 285 DCHECK(!isMainThread()); | 285 DCHECK(!isMainThread()); |
| 286 ThreadIdentifier thread = currentThread(); | 286 ThreadIdentifier thread = currentThread(); |
| 287 releaseStore(&m_audioThread, thread); | 287 releaseStore(&m_audioThread, thread); |
| 288 } | 288 } |
| 289 | 289 |
| 290 } // namespace blink | 290 } // namespace blink |
| OLD | NEW |