| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012, Google Inc. All rights reserved. | 2 * Copyright (C) 2012, 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 { | 58 { |
| 59 uninitialize(); | 59 uninitialize(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 void MediaStreamAudioSourceNode::setFormat(size_t numberOfChannels, float source
SampleRate) | 62 void MediaStreamAudioSourceNode::setFormat(size_t numberOfChannels, float source
SampleRate) |
| 63 { | 63 { |
| 64 if (numberOfChannels != m_sourceNumberOfChannels || sourceSampleRate != samp
leRate()) { | 64 if (numberOfChannels != m_sourceNumberOfChannels || sourceSampleRate != samp
leRate()) { |
| 65 // The sample-rate must be equal to the context's sample-rate. | 65 // The sample-rate must be equal to the context's sample-rate. |
| 66 if (!numberOfChannels || numberOfChannels > AudioContext::maxNumberOfCha
nnels() || sourceSampleRate != sampleRate()) { | 66 if (!numberOfChannels || numberOfChannels > AudioContext::maxNumberOfCha
nnels() || sourceSampleRate != sampleRate()) { |
| 67 // process() will generate silence for these uninitialized values. | 67 // process() will generate silence for these uninitialized values. |
| 68 LOG(Media, "MediaStreamAudioSourceNode::setFormat(%u, %f) - unhandle
d format change", static_cast<unsigned>(numberOfChannels), sourceSampleRate); | 68 LOG_INFO(Media, "MediaStreamAudioSourceNode::setFormat(%u, %f) - unh
andled format change", static_cast<unsigned>(numberOfChannels), sourceSampleRate
); |
| 69 m_sourceNumberOfChannels = 0; | 69 m_sourceNumberOfChannels = 0; |
| 70 return; | 70 return; |
| 71 } | 71 } |
| 72 | 72 |
| 73 // Synchronize with process(). | 73 // Synchronize with process(). |
| 74 MutexLocker locker(m_processLock); | 74 MutexLocker locker(m_processLock); |
| 75 | 75 |
| 76 m_sourceNumberOfChannels = numberOfChannels; | 76 m_sourceNumberOfChannels = numberOfChannels; |
| 77 | 77 |
| 78 { | 78 { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 | 113 |
| 114 void MediaStreamAudioSourceNode::reset() | 114 void MediaStreamAudioSourceNode::reset() |
| 115 { | 115 { |
| 116 } | 116 } |
| 117 | 117 |
| 118 } // namespace WebCore | 118 } // namespace WebCore |
| 119 | 119 |
| 120 #endif // ENABLE(WEB_AUDIO) && ENABLE(MEDIA_STREAM) | 120 #endif // ENABLE(WEB_AUDIO) && ENABLE(MEDIA_STREAM) |
| OLD | NEW |