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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 154 |
155 ~OfflineGraphAutoLocker() { m_handler.unlock(); } | 155 ~OfflineGraphAutoLocker() { m_handler.unlock(); } |
156 | 156 |
157 private: | 157 private: |
158 DeferredTaskHandler& m_handler; | 158 DeferredTaskHandler& m_handler; |
159 }; | 159 }; |
160 | 160 |
161 private: | 161 private: |
162 DeferredTaskHandler(); | 162 DeferredTaskHandler(); |
163 void updateAutomaticPullNodes(); | 163 void updateAutomaticPullNodes(); |
164 void updateChangedChannelCountMode(); | |
165 void updateChangedChannelInterpretation(); | |
166 void handleDirtyAudioSummingJunctions(); | 164 void handleDirtyAudioSummingJunctions(); |
167 void handleDirtyAudioNodeOutputs(); | 165 void handleDirtyAudioNodeOutputs(); |
168 void deleteHandlersOnMainThread(); | 166 void deleteHandlersOnMainThread(); |
169 | 167 |
170 // For the sake of thread safety, we maintain a seperate Vector of automatic | 168 // For the sake of thread safety, we maintain a seperate Vector of automatic |
171 // pull nodes for rendering in m_renderingAutomaticPullNodes. It will be | 169 // pull nodes for rendering in m_renderingAutomaticPullNodes. It will be |
172 // copied from m_automaticPullNodes by updateAutomaticPullNodes() at the | 170 // copied from m_automaticPullNodes by updateAutomaticPullNodes() at the |
173 // very start or end of the rendering quantum. | 171 // very start or end of the rendering quantum. |
174 HashSet<AudioHandler*> m_automaticPullNodes; | 172 HashSet<AudioHandler*> m_automaticPullNodes; |
175 Vector<AudioHandler*> m_renderingAutomaticPullNodes; | 173 Vector<AudioHandler*> m_renderingAutomaticPullNodes; |
176 // m_automaticPullNodesNeedUpdating keeps track if m_automaticPullNodes is m
odified. | 174 // m_automaticPullNodesNeedUpdating keeps track if m_automaticPullNodes is m
odified. |
177 bool m_automaticPullNodesNeedUpdating; | 175 bool m_automaticPullNodesNeedUpdating; |
178 | 176 |
179 // Collection of nodes where the channel count mode has changed. We want the | |
180 // channel count mode to change in the pre- or post-rendering phase so as | |
181 // not to disturb the running audio thread. | |
182 HashSet<AudioHandler*> m_deferredCountModeChange; | |
183 | |
184 HashSet<AudioHandler*> m_deferredChannelInterpretationChange; | |
185 | |
186 // These two HashSet must be accessed only when the graph lock is held. | 177 // These two HashSet must be accessed only when the graph lock is held. |
187 // These raw pointers are safe because their destructors unregister them. | 178 // These raw pointers are safe because their destructors unregister them. |
188 HashSet<AudioSummingJunction*> m_dirtySummingJunctions; | 179 HashSet<AudioSummingJunction*> m_dirtySummingJunctions; |
189 HashSet<AudioNodeOutput*> m_dirtyAudioNodeOutputs; | 180 HashSet<AudioNodeOutput*> m_dirtyAudioNodeOutputs; |
190 | 181 |
191 // Only accessed in the audio thread. | 182 // Only accessed in the audio thread. |
192 Vector<AudioHandler*> m_deferredBreakConnectionList; | 183 Vector<AudioHandler*> m_deferredBreakConnectionList; |
193 | 184 |
194 Vector<RefPtr<AudioHandler>> m_renderingOrphanHandlers; | 185 Vector<RefPtr<AudioHandler>> m_renderingOrphanHandlers; |
195 Vector<RefPtr<AudioHandler>> m_deletableOrphanHandlers; | 186 Vector<RefPtr<AudioHandler>> m_deletableOrphanHandlers; |
196 | 187 |
197 // Graph locking. | 188 // Graph locking. |
198 RecursiveMutex m_contextGraphMutex; | 189 RecursiveMutex m_contextGraphMutex; |
199 volatile ThreadIdentifier m_audioThread; | 190 volatile ThreadIdentifier m_audioThread; |
200 }; | 191 }; |
201 | 192 |
202 } // namespace blink | 193 } // namespace blink |
203 | 194 |
204 #endif // DeferredTaskHandler_h | 195 #endif // DeferredTaskHandler_h |
OLD | NEW |