Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(723)

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/WaveShaperProcessor.cpp

Issue 2389253002: reflow comments in modules/{webaudio,vr} (Closed)
Patch Set: . Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/webaudio/WaveShaperProcessor.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 bool channelCountMatches = 87 bool channelCountMatches =
88 source->numberOfChannels() == destination->numberOfChannels() && 88 source->numberOfChannels() == destination->numberOfChannels() &&
89 source->numberOfChannels() == m_kernels.size(); 89 source->numberOfChannels() == m_kernels.size();
90 DCHECK(channelCountMatches); 90 DCHECK(channelCountMatches);
91 if (!channelCountMatches) 91 if (!channelCountMatches)
92 return; 92 return;
93 93
94 // The audio thread can't block on this lock, so we call tryLock() instead. 94 // The audio thread can't block on this lock, so we call tryLock() instead.
95 MutexTryLocker tryLocker(m_processLock); 95 MutexTryLocker tryLocker(m_processLock);
96 if (tryLocker.locked()) { 96 if (tryLocker.locked()) {
97 // For each channel of our input, process using the corresponding WaveShaper DSPKernel into the output channel. 97 // For each channel of our input, process using the corresponding
98 // WaveShaperDSPKernel into the output channel.
98 for (unsigned i = 0; i < m_kernels.size(); ++i) 99 for (unsigned i = 0; i < m_kernels.size(); ++i)
99 m_kernels[i]->process(source->channel(i)->data(), 100 m_kernels[i]->process(source->channel(i)->data(),
100 destination->channel(i)->mutableData(), 101 destination->channel(i)->mutableData(),
101 framesToProcess); 102 framesToProcess);
102 } else { 103 } else {
103 // Too bad - the tryLock() failed. We must be in the middle of a setCurve() call. 104 // Too bad - the tryLock() failed. We must be in the middle of a setCurve()
105 // call.
104 destination->zero(); 106 destination->zero();
105 } 107 }
106 } 108 }
107 109
108 } // namespace blink 110 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webaudio/WaveShaperProcessor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698