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

Side by Side Diff: third_party/WebKit/Source/platform/audio/Reverb.cpp

Issue 1981823002: Remove OwnPtr::release() calls in platform/ (part 1). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 // The reverb can handle a mono impulse response and still do stereo process ing 111 // The reverb can handle a mono impulse response and still do stereo process ing
112 size_t numResponseChannels = impulseResponseBuffer->numberOfChannels(); 112 size_t numResponseChannels = impulseResponseBuffer->numberOfChannels();
113 m_convolvers.reserveCapacity(numberOfChannels); 113 m_convolvers.reserveCapacity(numberOfChannels);
114 114
115 int convolverRenderPhase = 0; 115 int convolverRenderPhase = 0;
116 for (size_t i = 0; i < numResponseChannels; ++i) { 116 for (size_t i = 0; i < numResponseChannels; ++i) {
117 AudioChannel* channel = impulseResponseBuffer->channel(i); 117 AudioChannel* channel = impulseResponseBuffer->channel(i);
118 118
119 OwnPtr<ReverbConvolver> convolver = adoptPtr(new ReverbConvolver(channel , renderSliceSize, maxFFTSize, convolverRenderPhase, useBackgroundThreads)); 119 OwnPtr<ReverbConvolver> convolver = adoptPtr(new ReverbConvolver(channel , renderSliceSize, maxFFTSize, convolverRenderPhase, useBackgroundThreads));
120 m_convolvers.append(convolver.release()); 120 m_convolvers.append(std::move(convolver));
121 121
122 convolverRenderPhase += renderSliceSize; 122 convolverRenderPhase += renderSliceSize;
123 } 123 }
124 124
125 // For "True" stereo processing we allocate a temporary buffer to avoid repe atedly allocating it in the process() method. 125 // For "True" stereo processing we allocate a temporary buffer to avoid repe atedly allocating it in the process() method.
126 // It can be bad to allocate memory in a real-time thread. 126 // It can be bad to allocate memory in a real-time thread.
127 if (numResponseChannels == 4) 127 if (numResponseChannels == 4)
128 m_tempBuffer = AudioBus::create(2, MaxFrameSize); 128 m_tempBuffer = AudioBus::create(2, MaxFrameSize);
129 } 129 }
130 130
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 m_convolvers[i]->reset(); 226 m_convolvers[i]->reset();
227 } 227 }
228 228
229 size_t Reverb::latencyFrames() const 229 size_t Reverb::latencyFrames() const
230 { 230 {
231 return !m_convolvers.isEmpty() ? m_convolvers.first()->latencyFrames() : 0; 231 return !m_convolvers.isEmpty() ? m_convolvers.first()->latencyFrames() : 0;
232 } 232 }
233 233
234 } // namespace blink 234 } // namespace blink
235 235
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/audio/HRTFKernel.cpp ('k') | third_party/WebKit/Source/platform/audio/ReverbConvolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698