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

Side by Side Diff: webrtc/common_audio/blocker_unittest.cc

Issue 1712513002: Replace scoped_ptr with unique_ptr in webrtc/common_audio/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 10 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 | « webrtc/common_audio/blocker.h ('k') | webrtc/common_audio/channel_buffer.h » ('j') | 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) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #include <memory>
12
11 #include "webrtc/common_audio/blocker.h" 13 #include "webrtc/common_audio/blocker.h"
12 14
13 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
14 #include "webrtc/base/arraysize.h" 16 #include "webrtc/base/arraysize.h"
15 17
16 namespace { 18 namespace {
17 19
18 // Callback Function to add 3 to every sample in the signal. 20 // Callback Function to add 3 to every sample in the signal.
19 class PlusThreeBlockerCallback : public webrtc::BlockerCallback { 21 class PlusThreeBlockerCallback : public webrtc::BlockerCallback {
20 public: 22 public:
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 } 302 }
301 } 303 }
302 ChannelBuffer<float> input_cb(kNumFrames, kNumInputChannels); 304 ChannelBuffer<float> input_cb(kNumFrames, kNumInputChannels);
303 input_cb.SetDataForTesting(input[0], sizeof(input) / sizeof(**input)); 305 input_cb.SetDataForTesting(input[0], sizeof(input) / sizeof(**input));
304 306
305 ChannelBuffer<float> output_cb(kNumFrames, kNumOutputChannels); 307 ChannelBuffer<float> output_cb(kNumFrames, kNumOutputChannels);
306 308
307 CopyBlockerCallback callback; 309 CopyBlockerCallback callback;
308 310
309 for (size_t i = 0; i < arraysize(kChunkSize); ++i) { 311 for (size_t i = 0; i < arraysize(kChunkSize); ++i) {
310 rtc::scoped_ptr<float[]> window(new float[kBlockSize[i]]); 312 std::unique_ptr<float[]> window(new float[kBlockSize[i]]);
311 for (size_t j = 0; j < kBlockSize[i]; ++j) { 313 for (size_t j = 0; j < kBlockSize[i]; ++j) {
312 window[j] = 1.f; 314 window[j] = 1.f;
313 } 315 }
314 316
315 ChannelBuffer<float> input_chunk_cb(kChunkSize[i], kNumInputChannels); 317 ChannelBuffer<float> input_chunk_cb(kChunkSize[i], kNumInputChannels);
316 ChannelBuffer<float> output_chunk_cb(kChunkSize[i], kNumOutputChannels); 318 ChannelBuffer<float> output_chunk_cb(kChunkSize[i], kNumOutputChannels);
317 319
318 Blocker blocker(kChunkSize[i], 320 Blocker blocker(kChunkSize[i],
319 kBlockSize[i], 321 kBlockSize[i],
320 kNumInputChannels, 322 kNumInputChannels,
(...skipping 13 matching lines...) Expand all
334 kNumOutputChannels); 336 kNumOutputChannels);
335 337
336 ValidateInitialDelay(output_cb.channels(), 338 ValidateInitialDelay(output_cb.channels(),
337 kNumOutputChannels, 339 kNumOutputChannels,
338 kNumFrames, 340 kNumFrames,
339 kInitialDelay[i]); 341 kInitialDelay[i]);
340 } 342 }
341 } 343 }
342 344
343 } // namespace webrtc 345 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/common_audio/blocker.h ('k') | webrtc/common_audio/channel_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698