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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 initialize(); | 57 initialize(); |
58 } | 58 } |
59 | 59 |
60 MediaElementAudioSourceNode::~MediaElementAudioSourceNode() | 60 MediaElementAudioSourceNode::~MediaElementAudioSourceNode() |
61 { | 61 { |
62 ASSERT(!isInitialized()); | 62 ASSERT(!isInitialized()); |
63 } | 63 } |
64 | 64 |
65 void MediaElementAudioSourceNode::dispose() | 65 void MediaElementAudioSourceNode::dispose() |
66 { | 66 { |
67 m_mediaElement->setAudioSourceNode(0); | 67 m_mediaElement->setAudioSourceNode(nullptr); |
68 uninitialize(); | 68 uninitialize(); |
69 AudioSourceNode::dispose(); | 69 AudioSourceNode::dispose(); |
70 } | 70 } |
71 | 71 |
72 void MediaElementAudioSourceNode::setFormat(size_t numberOfChannels, float sourc
eSampleRate) | 72 void MediaElementAudioSourceNode::setFormat(size_t numberOfChannels, float sourc
eSampleRate) |
73 { | 73 { |
74 if (numberOfChannels != m_sourceNumberOfChannels || sourceSampleRate != m_so
urceSampleRate) { | 74 if (numberOfChannels != m_sourceNumberOfChannels || sourceSampleRate != m_so
urceSampleRate) { |
75 if (!numberOfChannels || numberOfChannels > AudioContext::maxNumberOfCha
nnels() || !AudioUtilities::isValidAudioBufferSampleRate(sourceSampleRate)) { | 75 if (!numberOfChannels || numberOfChannels > AudioContext::maxNumberOfCha
nnels() || !AudioUtilities::isValidAudioBufferSampleRate(sourceSampleRate)) { |
76 // process() will generate silence for these uninitialized values. | 76 // process() will generate silence for these uninitialized values. |
77 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
); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 DEFINE_TRACE(MediaElementAudioSourceNode) | 158 DEFINE_TRACE(MediaElementAudioSourceNode) |
159 { | 159 { |
160 visitor->trace(m_mediaElement); | 160 visitor->trace(m_mediaElement); |
161 AudioSourceNode::trace(visitor); | 161 AudioSourceNode::trace(visitor); |
162 AudioSourceProviderClient::trace(visitor); | 162 AudioSourceProviderClient::trace(visitor); |
163 } | 163 } |
164 | 164 |
165 } // namespace blink | 165 } // namespace blink |
166 | 166 |
167 #endif // ENABLE(WEB_AUDIO) | 167 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |