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

Side by Side Diff: webrtc/modules/audio_processing/audio_processing_impl_locking_unittest.cc

Issue 2750783004: Add mute state field to AudioFrame. (Closed)
Patch Set: Update new usages of AudioFrame::data_ Created 3 years, 6 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) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 } 472 }
473 } 473 }
474 } 474 }
475 475
476 // Populates an audioframe frame of AudioFrame type with random data. 476 // Populates an audioframe frame of AudioFrame type with random data.
477 void PopulateAudioFrame(AudioFrame* frame, 477 void PopulateAudioFrame(AudioFrame* frame,
478 int16_t amplitude, 478 int16_t amplitude,
479 RandomGenerator* rand_gen) { 479 RandomGenerator* rand_gen) {
480 ASSERT_GT(amplitude, 0); 480 ASSERT_GT(amplitude, 0);
481 ASSERT_LE(amplitude, 32767); 481 ASSERT_LE(amplitude, 32767);
482 int16_t* frame_data = frame->mutable_data();
482 for (size_t ch = 0; ch < frame->num_channels_; ch++) { 483 for (size_t ch = 0; ch < frame->num_channels_; ch++) {
483 for (size_t k = 0; k < frame->samples_per_channel_; k++) { 484 for (size_t k = 0; k < frame->samples_per_channel_; k++) {
484 // Store random 16 bit number between -(amplitude+1) and 485 // Store random 16 bit number between -(amplitude+1) and
485 // amplitude. 486 // amplitude.
486 frame->data_[k * ch] = 487 frame_data[k * ch] =
487 rand_gen->RandInt(2 * amplitude + 1) - amplitude - 1; 488 rand_gen->RandInt(2 * amplitude + 1) - amplitude - 1;
488 } 489 }
489 } 490 }
490 } 491 }
491 492
492 AudioProcessingImplLockTest::AudioProcessingImplLockTest() 493 AudioProcessingImplLockTest::AudioProcessingImplLockTest()
493 : test_complete_(false, false), 494 : test_complete_(false, false),
494 render_call_event_(false, false), 495 render_call_event_(false, false),
495 capture_call_event_(false, false), 496 capture_call_event_(false, false),
496 render_thread_(RenderProcessorThreadFunc, this, "render"), 497 render_thread_(RenderProcessorThreadFunc, this, "render"),
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 DISABLED_AudioProcessingImplLockExtensive, 1127 DISABLED_AudioProcessingImplLockExtensive,
1127 AudioProcessingImplLockTest, 1128 AudioProcessingImplLockTest,
1128 ::testing::ValuesIn(TestConfig::GenerateExtensiveTestConfigs())); 1129 ::testing::ValuesIn(TestConfig::GenerateExtensiveTestConfigs()));
1129 1130
1130 INSTANTIATE_TEST_CASE_P( 1131 INSTANTIATE_TEST_CASE_P(
1131 AudioProcessingImplLockBrief, 1132 AudioProcessingImplLockBrief,
1132 AudioProcessingImplLockTest, 1133 AudioProcessingImplLockTest,
1133 ::testing::ValuesIn(TestConfig::GenerateBriefTestConfigs())); 1134 ::testing::ValuesIn(TestConfig::GenerateBriefTestConfigs()));
1134 1135
1135 } // namespace webrtc 1136 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/audio_processing_impl.cc ('k') | webrtc/modules/audio_processing/audio_processing_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698