| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // Default to stereo. This could change depending on what the media element
.src is set to. | 56 // Default to stereo. This could change depending on what the media element
.src is set to. |
| 57 addOutput(adoptPtr(new AudioNodeOutput(this, 2))); | 57 addOutput(adoptPtr(new AudioNodeOutput(this, 2))); |
| 58 | 58 |
| 59 setNodeType(NodeTypeMediaElementAudioSource); | 59 setNodeType(NodeTypeMediaElementAudioSource); |
| 60 | 60 |
| 61 initialize(); | 61 initialize(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 MediaElementAudioSourceNode::~MediaElementAudioSourceNode() | 64 MediaElementAudioSourceNode::~MediaElementAudioSourceNode() |
| 65 { | 65 { |
| 66 #if !ENABLE(OILPAN) |
| 66 m_mediaElement->setAudioSourceNode(0); | 67 m_mediaElement->setAudioSourceNode(0); |
| 68 #endif |
| 67 uninitialize(); | 69 uninitialize(); |
| 68 } | 70 } |
| 69 | 71 |
| 70 void MediaElementAudioSourceNode::setFormat(size_t numberOfChannels, float sourc
eSampleRate) | 72 void MediaElementAudioSourceNode::setFormat(size_t numberOfChannels, float sourc
eSampleRate) |
| 71 { | 73 { |
| 72 if (numberOfChannels != m_sourceNumberOfChannels || sourceSampleRate != m_so
urceSampleRate) { | 74 if (numberOfChannels != m_sourceNumberOfChannels || sourceSampleRate != m_so
urceSampleRate) { |
| 73 if (!numberOfChannels || numberOfChannels > AudioContext::maxNumberOfCha
nnels() || sourceSampleRate < minSampleRate || sourceSampleRate > maxSampleRate)
{ | 75 if (!numberOfChannels || numberOfChannels > AudioContext::maxNumberOfCha
nnels() || sourceSampleRate < minSampleRate || sourceSampleRate > maxSampleRate)
{ |
| 74 // process() will generate silence for these uninitialized values. | 76 // process() will generate silence for these uninitialized values. |
| 75 WTF_LOG(Media, "MediaElementAudioSourceNode::setFormat(%u, %f) - unh
andled format change", static_cast<unsigned>(numberOfChannels), sourceSampleRate
); | 77 WTF_LOG(Media, "MediaElementAudioSourceNode::setFormat(%u, %f) - unh
andled format change", static_cast<unsigned>(numberOfChannels), sourceSampleRate
); |
| 76 m_sourceNumberOfChannels = 0; | 78 m_sourceNumberOfChannels = 0; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 ref(); | 143 ref(); |
| 142 m_processLock.lock(); | 144 m_processLock.lock(); |
| 143 } | 145 } |
| 144 | 146 |
| 145 void MediaElementAudioSourceNode::unlock() | 147 void MediaElementAudioSourceNode::unlock() |
| 146 { | 148 { |
| 147 m_processLock.unlock(); | 149 m_processLock.unlock(); |
| 148 deref(); | 150 deref(); |
| 149 } | 151 } |
| 150 | 152 |
| 153 void MediaElementAudioSourceNode::trace(Visitor* visitor) |
| 154 { |
| 155 visitor->trace(m_mediaElement); |
| 156 AudioSourceNode::trace(visitor); |
| 157 AudioSourceProviderClient::trace(visitor); |
| 158 } |
| 159 |
| 151 } // namespace WebCore | 160 } // namespace WebCore |
| 152 | 161 |
| 153 #endif // ENABLE(WEB_AUDIO) | 162 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |