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

Side by Side Diff: webrtc/modules/audio_device/test/audio_device_test_api.cc

Issue 1316523002: Convert channel counts to size_t. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Fix compile Created 4 years, 11 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) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 AudioTransportAPI(AudioDeviceModule* audioDevice) 78 AudioTransportAPI(AudioDeviceModule* audioDevice)
79 : rec_count_(0), 79 : rec_count_(0),
80 play_count_(0) { 80 play_count_(0) {
81 } 81 }
82 82
83 ~AudioTransportAPI() {} 83 ~AudioTransportAPI() {}
84 84
85 int32_t RecordedDataIsAvailable(const void* audioSamples, 85 int32_t RecordedDataIsAvailable(const void* audioSamples,
86 const size_t nSamples, 86 const size_t nSamples,
87 const size_t nBytesPerSample, 87 const size_t nBytesPerSample,
88 const uint8_t nChannels, 88 const size_t nChannels,
89 const uint32_t sampleRate, 89 const uint32_t sampleRate,
90 const uint32_t totalDelay, 90 const uint32_t totalDelay,
91 const int32_t clockSkew, 91 const int32_t clockSkew,
92 const uint32_t currentMicLevel, 92 const uint32_t currentMicLevel,
93 const bool keyPressed, 93 const bool keyPressed,
94 uint32_t& newMicLevel) override { 94 uint32_t& newMicLevel) override {
95 rec_count_++; 95 rec_count_++;
96 if (rec_count_ % 100 == 0) { 96 if (rec_count_ % 100 == 0) {
97 if (nChannels == 1) { 97 if (nChannels == 1) {
98 // mono 98 // mono
99 TEST_LOG("-"); 99 TEST_LOG("-");
100 } else if ((nChannels == 2) && (nBytesPerSample == 2)) { 100 } else if ((nChannels == 2) && (nBytesPerSample == 2)) {
101 // stereo but only using one channel 101 // stereo but only using one channel
102 TEST_LOG("-|"); 102 TEST_LOG("-|");
103 } else { 103 } else {
104 // stereo 104 // stereo
105 TEST_LOG("--"); 105 TEST_LOG("--");
106 } 106 }
107 } 107 }
108 return 0; 108 return 0;
109 } 109 }
110 110
111 int32_t NeedMorePlayData(const size_t nSamples, 111 int32_t NeedMorePlayData(const size_t nSamples,
112 const size_t nBytesPerSample, 112 const size_t nBytesPerSample,
113 const uint8_t nChannels, 113 const size_t nChannels,
114 const uint32_t sampleRate, 114 const uint32_t sampleRate,
115 void* audioSamples, 115 void* audioSamples,
116 size_t& nSamplesOut, 116 size_t& nSamplesOut,
117 int64_t* elapsed_time_ms, 117 int64_t* elapsed_time_ms,
118 int64_t* ntp_time_ms) override { 118 int64_t* ntp_time_ms) override {
119 play_count_++; 119 play_count_++;
120 if (play_count_ % 100 == 0) { 120 if (play_count_ % 100 == 0) {
121 if (nChannels == 1) { 121 if (nChannels == 1) {
122 TEST_LOG("+"); 122 TEST_LOG("+");
123 } else { 123 } else {
(...skipping 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after
1804 // TODO(kjellander): Fix so these tests pass on Mac. 1804 // TODO(kjellander): Fix so these tests pass on Mac.
1805 #if !defined(WEBRTC_MAC) 1805 #if !defined(WEBRTC_MAC)
1806 EXPECT_EQ(0, audio_device_->InitPlayout()); 1806 EXPECT_EQ(0, audio_device_->InitPlayout());
1807 EXPECT_EQ(0, audio_device_->StartPlayout()); 1807 EXPECT_EQ(0, audio_device_->StartPlayout());
1808 #endif 1808 #endif
1809 1809
1810 EXPECT_EQ(-1, audio_device_->GetLoudspeakerStatus(&loudspeakerOn)); 1810 EXPECT_EQ(-1, audio_device_->GetLoudspeakerStatus(&loudspeakerOn));
1811 #endif 1811 #endif
1812 EXPECT_EQ(0, audio_device_->StopPlayout()); 1812 EXPECT_EQ(0, audio_device_->StopPlayout());
1813 } 1813 }
OLDNEW
« no previous file with comments | « webrtc/modules/audio_device/ios/audio_device_unittest_ios.cc ('k') | webrtc/modules/audio_device/test/func_test_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698