Chromium Code Reviews| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 { | 53 { |
| 54 uninitialize(); | 54 uninitialize(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void MediaStreamAudioSourceHandler::setFormat(size_t numberOfChannels, float sou rceSampleRate) | 57 void MediaStreamAudioSourceHandler::setFormat(size_t numberOfChannels, float sou rceSampleRate) |
| 58 { | 58 { |
| 59 if (numberOfChannels != m_sourceNumberOfChannels || sourceSampleRate != samp leRate()) { | 59 if (numberOfChannels != m_sourceNumberOfChannels || sourceSampleRate != samp leRate()) { |
| 60 // The sample-rate must be equal to the context's sample-rate. | 60 // The sample-rate must be equal to the context's sample-rate. |
| 61 if (!numberOfChannels || numberOfChannels > AbstractAudioContext::maxNum berOfChannels() || sourceSampleRate != sampleRate()) { | 61 if (!numberOfChannels || numberOfChannels > AbstractAudioContext::maxNum berOfChannels() || sourceSampleRate != sampleRate()) { |
| 62 // process() will generate silence for these uninitialized values. | 62 // process() will generate silence for these uninitialized values. |
| 63 WTF_LOG(Media, "MediaStreamAudioSourceNode::setFormat(%u, %f) - unha ndled format change", static_cast<unsigned>(numberOfChannels), sourceSampleRate) ; | 63 DVLOG(3) << "setFormat(" << numberOfChannels << ", " << sourceSample Rate << ") - unhandled format change"; |
|
Raymond Toy
2016/05/19 14:48:42
Same comment as for MediaElementAudioSource
| |
| 64 m_sourceNumberOfChannels = 0; | 64 m_sourceNumberOfChannels = 0; |
| 65 return; | 65 return; |
| 66 } | 66 } |
| 67 | 67 |
| 68 // Synchronize with process(). | 68 // Synchronize with process(). |
| 69 MutexLocker locker(m_processLock); | 69 MutexLocker locker(m_processLock); |
| 70 | 70 |
| 71 m_sourceNumberOfChannels = numberOfChannels; | 71 m_sourceNumberOfChannels = numberOfChannels; |
| 72 | 72 |
| 73 { | 73 { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 135 return mediaStreamAudioSourceHandler().getMediaStream(); | 135 return mediaStreamAudioSourceHandler().getMediaStream(); |
| 136 } | 136 } |
| 137 | 137 |
| 138 void MediaStreamAudioSourceNode::setFormat(size_t numberOfChannels, float source SampleRate) | 138 void MediaStreamAudioSourceNode::setFormat(size_t numberOfChannels, float source SampleRate) |
| 139 { | 139 { |
| 140 mediaStreamAudioSourceHandler().setFormat(numberOfChannels, sourceSampleRate ); | 140 mediaStreamAudioSourceHandler().setFormat(numberOfChannels, sourceSampleRate ); |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // namespace blink | 143 } // namespace blink |
| 144 | 144 |
| OLD | NEW |