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() && mediaElement()->webMediaP
layer()->didPassCORSAccessCheck()) |
| 134 || context()->securityOrigin()->canRequest(mediaElement()->curre
ntSrc()))) { |
| 135 outputBus->zero(); |
| 136 } |
132 } else { | 137 } else { |
133 // Either this port doesn't yet support HTMLMediaElement audio strea
m access, | 138 // Either this port doesn't yet support HTMLMediaElement audio strea
m access, |
134 // or the stream is not yet available. | 139 // or the stream is not yet available. |
135 outputBus->zero(); | 140 outputBus->zero(); |
136 } | 141 } |
137 } else { | 142 } else { |
138 // We failed to acquire the lock. | 143 // We failed to acquire the lock. |
139 outputBus->zero(); | 144 outputBus->zero(); |
140 } | 145 } |
141 } | 146 } |
(...skipping 11 matching lines...) Expand all Loading... |
153 void MediaElementAudioSourceNode::trace(Visitor* visitor) | 158 void MediaElementAudioSourceNode::trace(Visitor* visitor) |
154 { | 159 { |
155 visitor->trace(m_mediaElement); | 160 visitor->trace(m_mediaElement); |
156 AudioSourceNode::trace(visitor); | 161 AudioSourceNode::trace(visitor); |
157 AudioSourceProviderClient::trace(visitor); | 162 AudioSourceProviderClient::trace(visitor); |
158 } | 163 } |
159 | 164 |
160 } // namespace blink | 165 } // namespace blink |
161 | 166 |
162 #endif // ENABLE(WEB_AUDIO) | 167 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |