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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // Grab data from the provider so that the element continues to make
progress, even if | 122 // Grab data from the provider so that the element continues to make
progress, even if |
123 // we're going to output silence anyway. | 123 // we're going to output silence anyway. |
124 if (m_multiChannelResampler.get()) { | 124 if (m_multiChannelResampler.get()) { |
125 ASSERT(m_sourceSampleRate != sampleRate()); | 125 ASSERT(m_sourceSampleRate != sampleRate()); |
126 m_multiChannelResampler->process(provider, outputBus, numberOfFr
ames); | 126 m_multiChannelResampler->process(provider, outputBus, numberOfFr
ames); |
127 } else { | 127 } else { |
128 // Bypass the resampler completely if the source is at the conte
xt's sample-rate. | 128 // Bypass the resampler completely if the source is at the conte
xt's sample-rate. |
129 ASSERT(m_sourceSampleRate == sampleRate()); | 129 ASSERT(m_sourceSampleRate == sampleRate()); |
130 provider->provideInput(outputBus, numberOfFrames); | 130 provider->provideInput(outputBus, numberOfFrames); |
131 } | 131 } |
132 // Output silence if we don't have access to the element. | |
133 if (!(mediaElement()->webMediaPlayer()->didPassCORSAccessCheck() | |
134 || context()->securityOrigin()->canRequest(mediaElement()->curre
ntSrc()))) { | |
135 outputBus->zero(); | |
136 } | |
137 } else { | 132 } else { |
138 // Either this port doesn't yet support HTMLMediaElement audio strea
m access, | 133 // Either this port doesn't yet support HTMLMediaElement audio strea
m access, |
139 // or the stream is not yet available. | 134 // or the stream is not yet available. |
140 outputBus->zero(); | 135 outputBus->zero(); |
141 } | 136 } |
142 } else { | 137 } else { |
143 // We failed to acquire the lock. | 138 // We failed to acquire the lock. |
144 outputBus->zero(); | 139 outputBus->zero(); |
145 } | 140 } |
146 } | 141 } |
(...skipping 11 matching lines...) Expand all Loading... |
158 void MediaElementAudioSourceNode::trace(Visitor* visitor) | 153 void MediaElementAudioSourceNode::trace(Visitor* visitor) |
159 { | 154 { |
160 visitor->trace(m_mediaElement); | 155 visitor->trace(m_mediaElement); |
161 AudioSourceNode::trace(visitor); | 156 AudioSourceNode::trace(visitor); |
162 AudioSourceProviderClient::trace(visitor); | 157 AudioSourceProviderClient::trace(visitor); |
163 } | 158 } |
164 | 159 |
165 } // namespace blink | 160 } // namespace blink |
166 | 161 |
167 #endif // ENABLE(WEB_AUDIO) | 162 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |