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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 99 |
100 // Returns true on success. | 100 // Returns true on success. |
101 bool renderFromBuffer(AudioBus*, unsigned destinationFrameOffset, size_t num
berOfFrames); | 101 bool renderFromBuffer(AudioBus*, unsigned destinationFrameOffset, size_t num
berOfFrames); |
102 | 102 |
103 // Render silence starting from "index" frame in AudioBus. | 103 // Render silence starting from "index" frame in AudioBus. |
104 inline bool renderSilenceAndFinishIfNotLooping(AudioBus*, unsigned index, si
ze_t framesToProcess); | 104 inline bool renderSilenceAndFinishIfNotLooping(AudioBus*, unsigned index, si
ze_t framesToProcess); |
105 | 105 |
106 // m_buffer holds the sample data which this node outputs. | 106 // m_buffer holds the sample data which this node outputs. |
107 RefPtr<AudioBuffer> m_buffer; | 107 RefPtr<AudioBuffer> m_buffer; |
108 | 108 |
| 109 // Used for setBuffer() called with null. |
| 110 RefPtr<AudioBuffer> m_nullableBuffer; |
| 111 |
109 // Pointers for the buffer and destination. | 112 // Pointers for the buffer and destination. |
110 OwnPtr<const float*[]> m_sourceChannels; | 113 OwnPtr<const float*[]> m_sourceChannels; |
111 OwnPtr<float*[]> m_destinationChannels; | 114 OwnPtr<float*[]> m_destinationChannels; |
112 | 115 |
113 // Used for the "gain" and "playbackRate" attributes. | 116 // Used for the "gain" and "playbackRate" attributes. |
114 RefPtr<AudioParam> m_gain; | 117 RefPtr<AudioParam> m_gain; |
115 RefPtr<AudioParam> m_playbackRate; | 118 RefPtr<AudioParam> m_playbackRate; |
116 | 119 |
117 // If m_isLooping is false, then this node will be done playing and become i
nactive after it reaches the end of the sample data in the buffer. | 120 // If m_isLooping is false, then this node will be done playing and become i
nactive after it reaches the end of the sample data in the buffer. |
118 // If true, it will wrap around to the start of the buffer each time it reac
hes the end. | 121 // If true, it will wrap around to the start of the buffer each time it reac
hes the end. |
(...skipping 22 matching lines...) Expand all Loading... |
141 // the pitch rate. We manually manage ref-counting because we want to use Re
fTypeConnection. | 144 // the pitch rate. We manually manage ref-counting because we want to use Re
fTypeConnection. |
142 PannerNode* m_pannerNode; | 145 PannerNode* m_pannerNode; |
143 | 146 |
144 // This synchronizes process() with setBuffer() which can cause dynamic chan
nel count changes. | 147 // This synchronizes process() with setBuffer() which can cause dynamic chan
nel count changes. |
145 mutable Mutex m_processLock; | 148 mutable Mutex m_processLock; |
146 }; | 149 }; |
147 | 150 |
148 } // namespace WebCore | 151 } // namespace WebCore |
149 | 152 |
150 #endif // AudioBufferSourceNode_h | 153 #endif // AudioBufferSourceNode_h |
OLD | NEW |