| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012, Google Inc. All rights reserved. | 2 * Copyright (C) 2012, 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 // This copies m_outputs to m_renderingOutputs. Please see comments for thes
e lists below. | 51 // This copies m_outputs to m_renderingOutputs. Please see comments for thes
e lists below. |
| 52 // This must be called when we own the context's graph lock in the audio thr
ead at the very start or end of the render quantum. | 52 // This must be called when we own the context's graph lock in the audio thr
ead at the very start or end of the render quantum. |
| 53 void updateRenderingState(); | 53 void updateRenderingState(); |
| 54 | 54 |
| 55 // Rendering code accesses its version of the current connections here. | 55 // Rendering code accesses its version of the current connections here. |
| 56 unsigned numberOfRenderingConnections() const { return m_renderingOutputs.si
ze(); } | 56 unsigned numberOfRenderingConnections() const { return m_renderingOutputs.si
ze(); } |
| 57 AudioNodeOutput* renderingOutput(unsigned i) { return m_renderingOutputs[i];
} | 57 AudioNodeOutput* renderingOutput(unsigned i) { return m_renderingOutputs[i];
} |
| 58 bool isConnected() const { return numberOfRenderingConnections() > 0; } | 58 bool isConnected() const { return numberOfRenderingConnections() > 0; } |
| 59 | 59 |
| 60 #if !ENABLE(OILPAN) | |
| 61 virtual bool canUpdateState() = 0; | 60 virtual bool canUpdateState() = 0; |
| 62 #endif | |
| 63 virtual void didUpdate() = 0; | 61 virtual void didUpdate() = 0; |
| 64 | 62 |
| 65 protected: | 63 protected: |
| 66 explicit AudioSummingJunction(AudioContext*); | 64 explicit AudioSummingJunction(AudioContext*); |
| 67 | 65 |
| 68 RefPtrWillBeMember<AudioContext> m_context; | 66 RefPtrWillBeMember<AudioContext> m_context; |
| 69 | 67 |
| 70 // m_outputs contains the AudioNodeOutputs representing current connections
which are not disabled. | 68 // m_outputs contains the AudioNodeOutputs representing current connections
which are not disabled. |
| 71 // The rendering code should never use this directly, but instead uses m_ren
deringOutputs. | 69 // The rendering code should never use this directly, but instead uses m_ren
deringOutputs. |
| 72 // Oilpan: Since items are added to the hash set by the audio thread (not re
gistered to Oilpan), | 70 // Oilpan: Since items are added to the hash set by the audio thread (not re
gistered to Oilpan), |
| 73 // we cannot use a HeapHashSet. | 71 // we cannot use a HeapHashSet. |
| 74 HashSet<AudioNodeOutput*> m_outputs; | 72 HashSet<AudioNodeOutput*> m_outputs; |
| 75 | 73 |
| 76 // m_renderingOutputs is a copy of m_outputs which will never be modified du
ring the graph rendering on the audio thread. | 74 // m_renderingOutputs is a copy of m_outputs which will never be modified du
ring the graph rendering on the audio thread. |
| 77 // This is the list which is used by the rendering code. | 75 // This is the list which is used by the rendering code. |
| 78 // Whenever m_outputs is modified, the context is told so it can later updat
e m_renderingOutputs from m_outputs at a safe time. | 76 // Whenever m_outputs is modified, the context is told so it can later updat
e m_renderingOutputs from m_outputs at a safe time. |
| 79 // Most of the time, m_renderingOutputs is identical to m_outputs. | 77 // Most of the time, m_renderingOutputs is identical to m_outputs. |
| 80 // Oilpan: Since items are added to the vector by the audio thread (not regi
stered to Oilpan), | 78 // Oilpan: Since items are added to the vector by the audio thread (not regi
stered to Oilpan), |
| 81 // we cannot use a HeapVector. | 79 // we cannot use a HeapVector. |
| 82 Vector<AudioNodeOutput*> m_renderingOutputs; | 80 Vector<AudioNodeOutput*> m_renderingOutputs; |
| 83 | 81 |
| 84 // m_renderingStateNeedUpdating keeps track if m_outputs is modified. | 82 // m_renderingStateNeedUpdating keeps track if m_outputs is modified. |
| 85 bool m_renderingStateNeedUpdating; | 83 bool m_renderingStateNeedUpdating; |
| 86 }; | 84 }; |
| 87 | 85 |
| 88 } // namespace blink | 86 } // namespace blink |
| 89 | 87 |
| 90 #endif // AudioSummingJunction_h | 88 #endif // AudioSummingJunction_h |
| OLD | NEW |