blob: 20ccde6e6c4ea513c70a6bd54b60a5a79e04d1cd [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
andrew@webrtc.org63a50982012-05-02 23:56:37 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000011#include "webrtc/modules/audio_coding/main/test/TestVADDTX.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000012
niklase@google.com470e71d2011-07-07 08:21:25 +000013#include <iostream>
kjellander@webrtc.org5490c712011-12-21 13:34:18 +000014
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000015#include "webrtc/common_types.h"
16#include "webrtc/engine_configurations.h"
turaj@webrtc.org6ea3d1c2013-10-02 21:44:33 +000017#include "webrtc/modules/audio_coding/main/acm2/acm_common_defs.h"
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000018#include "webrtc/modules/audio_coding/main/interface/audio_coding_module_typedefs.h"
19#include "webrtc/modules/audio_coding/main/test/utility.h"
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000020#include "webrtc/system_wrappers/interface/trace.h"
turaj@webrtc.org6ea3d1c2013-10-02 21:44:33 +000021#include "webrtc/test/testsupport/fileutils.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000022
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000023namespace webrtc {
niklase@google.com470e71d2011-07-07 08:21:25 +000024
henrik.lundin@webrtc.orgadaf8092014-04-17 08:29:10 +000025TestVADDTX::TestVADDTX()
26 : _acmA(AudioCodingModule::Create(0)),
27 _acmB(AudioCodingModule::Create(1)),
28 _channelA2B(NULL) {}
niklase@google.com470e71d2011-07-07 08:21:25 +000029
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000030TestVADDTX::~TestVADDTX() {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000031 if (_channelA2B != NULL) {
32 delete _channelA2B;
33 _channelA2B = NULL;
34 }
niklase@google.com470e71d2011-07-07 08:21:25 +000035}
36
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000037void TestVADDTX::Perform() {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000038 const std::string file_name = webrtc::test::ResourcePath(
39 "audio_coding/testfile32kHz", "pcm");
40 _inFileA.Open(file_name, 32000, "rb");
41
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000042 EXPECT_EQ(0, _acmA->InitializeReceiver());
43 EXPECT_EQ(0, _acmB->InitializeReceiver());
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000044
45 uint8_t numEncoders = _acmA->NumberOfCodecs();
46 CodecInst myCodecParam;
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000047 for (uint8_t n = 0; n < numEncoders; n++) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000048 EXPECT_EQ(0, _acmB->Codec(n, &myCodecParam));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000049 if (!strcmp(myCodecParam.plname, "opus")) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000050 // Register Opus as mono.
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000051 myCodecParam.channels = 1;
niklase@google.com470e71d2011-07-07 08:21:25 +000052 }
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000053 EXPECT_EQ(0, _acmB->RegisterReceiveCodec(myCodecParam));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000054 }
niklase@google.com470e71d2011-07-07 08:21:25 +000055
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000056 // Create and connect the channel
57 _channelA2B = new Channel;
58 _acmA->RegisterTransportCallback(_channelA2B);
andrew@webrtc.org89df0922013-09-12 01:27:43 +000059 _channelA2B->RegisterReceiverACM(_acmB.get());
niklase@google.com470e71d2011-07-07 08:21:25 +000060
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000061 _acmA->RegisterVADCallback(&_monitor);
niklase@google.com470e71d2011-07-07 08:21:25 +000062
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000063 int16_t testCntr = 1;
niklase@google.com470e71d2011-07-07 08:21:25 +000064
65#ifdef WEBRTC_CODEC_ISAC
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000066 // Open outputfile
67 OpenOutFile(testCntr++);
niklase@google.com470e71d2011-07-07 08:21:25 +000068
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000069 // Register iSAC WB as send codec
70 char nameISAC[] = "ISAC";
71 RegisterSendCodec('A', nameISAC, 16000);
niklase@google.com470e71d2011-07-07 08:21:25 +000072
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000073 // Run the five test cased
74 runTestCases();
niklase@google.com470e71d2011-07-07 08:21:25 +000075
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000076 // Close file
77 _outFileB.Close();
niklase@google.com470e71d2011-07-07 08:21:25 +000078
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000079 // Open outputfile
80 OpenOutFile(testCntr++);
niklase@google.com470e71d2011-07-07 08:21:25 +000081
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000082 // Register iSAC SWB as send codec
83 RegisterSendCodec('A', nameISAC, 32000);
niklase@google.com470e71d2011-07-07 08:21:25 +000084
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000085 // Run the five test cased
86 runTestCases();
niklase@google.com470e71d2011-07-07 08:21:25 +000087
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000088 // Close file
89 _outFileB.Close();
niklase@google.com470e71d2011-07-07 08:21:25 +000090#endif
91#ifdef WEBRTC_CODEC_ILBC
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000092 // Open outputfile
93 OpenOutFile(testCntr++);
niklase@google.com470e71d2011-07-07 08:21:25 +000094
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000095 // Register iLBC as send codec
96 char nameILBC[] = "ilbc";
97 RegisterSendCodec('A', nameILBC);
niklase@google.com470e71d2011-07-07 08:21:25 +000098
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000099 // Run the five test cased
100 runTestCases();
niklase@google.com470e71d2011-07-07 08:21:25 +0000101
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000102 // Close file
103 _outFileB.Close();
niklase@google.com470e71d2011-07-07 08:21:25 +0000104
105#endif
tina.legrand@webrtc.orga7d83872012-10-18 10:00:52 +0000106#ifdef WEBRTC_CODEC_OPUS
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000107 // Open outputfile
108 OpenOutFile(testCntr++);
tina.legrand@webrtc.orga7d83872012-10-18 10:00:52 +0000109
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000110 // Register Opus as send codec
111 char nameOPUS[] = "opus";
112 RegisterSendCodec('A', nameOPUS);
tina.legrand@webrtc.orga7d83872012-10-18 10:00:52 +0000113
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000114 // Run the five test cased
115 runTestCases();
tina.legrand@webrtc.orga7d83872012-10-18 10:00:52 +0000116
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000117 // Close file
118 _outFileB.Close();
tina.legrand@webrtc.orga7d83872012-10-18 10:00:52 +0000119
120#endif
niklase@google.com470e71d2011-07-07 08:21:25 +0000121}
122
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000123void TestVADDTX::runTestCases() {
henrik.lundin@webrtc.org664ccb72015-01-28 14:49:05 +0000124 // #1 DTX = OFF, VAD = OFF, VADNormal
125 SetVAD(false, false, VADNormal);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000126 Run();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000127 VerifyTest();
niklase@google.com470e71d2011-07-07 08:21:25 +0000128
henrik.lundin@webrtc.org664ccb72015-01-28 14:49:05 +0000129 // #2 DTX = ON, VAD = ON, VADAggr
130 SetVAD(true, true, VADAggr);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000131 Run();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000132 VerifyTest();
niklase@google.com470e71d2011-07-07 08:21:25 +0000133
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000134 // #3 DTX = ON, VAD = ON, VADLowBitrate
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000135 SetVAD(true, true, VADLowBitrate);
136 Run();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000137 VerifyTest();
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000138
139 // #4 DTX = ON, VAD = ON, VADVeryAggr
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000140 SetVAD(true, true, VADVeryAggr);
141 Run();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000142 VerifyTest();
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000143
henrik.lundin@webrtc.org664ccb72015-01-28 14:49:05 +0000144 // #5 DTX = ON, VAD = ON, VADNormal
145 SetVAD(true, true, VADNormal);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000146 Run();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000147 VerifyTest();
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000148}
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000149
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000150void TestVADDTX::runTestInternalDTX(int expected_result) {
151 // #6 DTX = ON, VAD = ON, VADNormal
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000152 SetVAD(true, true, VADNormal);
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000153 EXPECT_EQ(expected_result, _acmA->ReplaceInternalDTXWithWebRtc(true));
154 if (expected_result == 0) {
155 Run();
156 VerifyTest();
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000157 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000158}
159
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000160void TestVADDTX::SetVAD(bool statusDTX, bool statusVAD, int16_t vadMode) {
161 bool dtxEnabled, vadEnabled;
162 ACMVADMode vadModeSet;
niklase@google.com470e71d2011-07-07 08:21:25 +0000163
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000164 EXPECT_EQ(0, _acmA->SetVAD(statusDTX, statusVAD, (ACMVADMode) vadMode));
165 EXPECT_EQ(0, _acmA->VAD(&dtxEnabled, &vadEnabled, &vadModeSet));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000166
167 // Requested VAD/DTX settings
168 _setStruct.statusDTX = statusDTX;
169 _setStruct.statusVAD = statusVAD;
170 _setStruct.vadMode = (ACMVADMode) vadMode;
171
172 // VAD settings after setting VAD in ACM
173 _getStruct.statusDTX = dtxEnabled;
174 _getStruct.statusVAD = vadEnabled;
175 _getStruct.vadMode = vadModeSet;
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000176}
177
178VADDTXstruct TestVADDTX::GetVAD() {
179 VADDTXstruct retStruct;
180 bool dtxEnabled, vadEnabled;
181 ACMVADMode vadModeSet;
182
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000183 EXPECT_EQ(0, _acmA->VAD(&dtxEnabled, &vadEnabled, &vadModeSet));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000184
185 retStruct.statusDTX = dtxEnabled;
186 retStruct.statusVAD = vadEnabled;
187 retStruct.vadMode = vadModeSet;
188 return retStruct;
189}
190
191int16_t TestVADDTX::RegisterSendCodec(char side, char* codecName,
192 int32_t samplingFreqHz,
193 int32_t rateKbps) {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000194 std::cout << std::flush;
195 AudioCodingModule* myACM;
196 switch (side) {
197 case 'A': {
andrew@webrtc.org89df0922013-09-12 01:27:43 +0000198 myACM = _acmA.get();
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000199 break;
200 }
201 case 'B': {
andrew@webrtc.org89df0922013-09-12 01:27:43 +0000202 myACM = _acmB.get();
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000203 break;
204 }
205 default:
206 return -1;
207 }
208
209 if (myACM == NULL) {
210 return -1;
211 }
212
213 CodecInst myCodecParam;
214 for (int16_t codecCntr = 0; codecCntr < myACM->NumberOfCodecs();
215 codecCntr++) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000216 EXPECT_EQ(0, myACM->Codec((uint8_t) codecCntr, &myCodecParam));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000217 if (!STR_CASE_CMP(myCodecParam.plname, codecName)) {
218 if ((samplingFreqHz == -1) || (myCodecParam.plfreq == samplingFreqHz)) {
219 if ((rateKbps == -1) || (myCodecParam.rate == rateKbps)) {
220 break;
221 }
222 }
223 }
224 }
225
226 // We only allow VAD/DTX when sending mono.
227 myCodecParam.channels = 1;
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000228 EXPECT_EQ(0, myACM->RegisterSendCodec(myCodecParam));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000229
230 // initialization was succesful
231 return 0;
232}
233
234void TestVADDTX::Run() {
235 AudioFrame audioFrame;
236
237 uint16_t SamplesIn10MsecA = _inFileA.PayloadLength10Ms();
238 uint32_t timestampA = 1;
239 int32_t outFreqHzB = _outFileB.SamplingFrequency();
240
241 while (!_inFileA.EndOfFile()) {
242 _inFileA.Read10MsData(audioFrame);
243 audioFrame.timestamp_ = timestampA;
244 timestampA += SamplesIn10MsecA;
henrik.lundin@webrtc.orgf56c1622015-03-02 12:29:30 +0000245 EXPECT_GE(_acmA->Add10MsData(audioFrame), 0);
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000246 EXPECT_EQ(0, _acmB->PlayoutData10Ms(outFreqHzB, &audioFrame));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000247 _outFileB.Write10MsData(audioFrame.data_, audioFrame.samples_per_channel_);
248 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000249#ifdef PRINT_STAT
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000250 _monitor.PrintStatistics();
niklase@google.com470e71d2011-07-07 08:21:25 +0000251#endif
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000252 _inFileA.Rewind();
253 _monitor.GetStatistics(_statCounter);
254 _monitor.ResetStatistics();
niklase@google.com470e71d2011-07-07 08:21:25 +0000255}
256
pbos@webrtc.org0946a562013-04-09 00:28:06 +0000257void TestVADDTX::OpenOutFile(int16_t test_number) {
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +0000258 std::string file_name;
259 std::stringstream file_stream;
260 file_stream << webrtc::test::OutputPath();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000261 file_stream << "testVADDTX_outFile_";
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +0000262 file_stream << test_number << ".pcm";
263 file_name = file_stream.str();
264 _outFileB.Open(file_name, 16000, "wb");
niklase@google.com470e71d2011-07-07 08:21:25 +0000265}
266
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000267int16_t TestVADDTX::VerifyTest() {
268 // Verify empty frame result
269 uint8_t statusEF = 0;
270 uint8_t vadPattern = 0;
271 uint8_t emptyFramePattern[6];
272 CodecInst myCodecParam;
273 _acmA->SendCodec(&myCodecParam);
minyue@webrtc.orgabe3f182014-12-11 08:53:21 +0000274
275 // TODO(minyue): Remove these treatment on Opus when DTX is properly handled
276 // by ACMOpus.
277 if (STR_CASE_CMP(myCodecParam.plname, "opus") == 0) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000278 _setStruct.statusDTX = false;
279 _setStruct.statusVAD = false;
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000280 }
phoglund@webrtc.orgd1a860b2012-01-26 14:49:28 +0000281
minyue@webrtc.orgabe3f182014-12-11 08:53:21 +0000282 bool isReplaced = false;
283 _acmA->IsInternalDTXReplacedWithWebRtc(&isReplaced);
284 bool webRtcDtxInUse = _getStruct.statusDTX && isReplaced;
285 bool codecDtxInUse = _getStruct.statusDTX && !isReplaced;
286
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000287 // Check for error in VAD/DTX settings
288 if (_getStruct.statusDTX != _setStruct.statusDTX) {
minyue@webrtc.orgabe3f182014-12-11 08:53:21 +0000289 // DTX status doesn't match expected.
290 vadPattern |= 1;
291 }
292 if (!_getStruct.statusVAD && webRtcDtxInUse) {
293 // WebRTC DTX cannot run without WebRTC VAD.
294 vadPattern |= 2;
295 }
296 if ((!_getStruct.statusDTX || codecDtxInUse) &&
297 (_getStruct.statusVAD != _setStruct.statusVAD)) {
298 // Using no DTX or codec Internal DTX should not affect setting of VAD.
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000299 vadPattern |= 4;
300 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000301 if (_getStruct.vadMode != _setStruct.vadMode) {
minyue@webrtc.orgabe3f182014-12-11 08:53:21 +0000302 // VAD Mode doesn't match expected.
303 vadPattern |= 8;
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000304 }
305
306 // Set expected empty frame pattern
307 int ii;
308 for (ii = 0; ii < 6; ii++) {
309 emptyFramePattern[ii] = 0;
310 }
311 // 0 - "kNoEncoding", not important to check.
312 // Codecs with packetsize != 80 samples will get this output.
313 // 1 - "kActiveNormalEncoded", expect to receive some frames with this label .
314 // 2 - "kPassiveNormalEncoded".
315 // 3 - "kPassiveDTXNB".
316 // 4 - "kPassiveDTXWB".
317 // 5 - "kPassiveDTXSWB".
318 emptyFramePattern[0] = 1;
319 emptyFramePattern[1] = 1;
minyue@webrtc.orgabe3f182014-12-11 08:53:21 +0000320 emptyFramePattern[2] = _getStruct.statusVAD && !webRtcDtxInUse;
321 emptyFramePattern[3] = webRtcDtxInUse && (_acmA->SendFrequency() == 8000);
322 emptyFramePattern[4] = webRtcDtxInUse && (_acmA->SendFrequency() == 16000);
323 emptyFramePattern[5] = webRtcDtxInUse && (_acmA->SendFrequency() == 32000);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000324
325 // Check pattern 1-5 (skip 0)
326 for (int ii = 1; ii < 6; ii++) {
327 if (emptyFramePattern[ii]) {
328 statusEF |= (_statCounter[ii] == 0);
niklase@google.com470e71d2011-07-07 08:21:25 +0000329 } else {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000330 statusEF |= (_statCounter[ii] > 0);
niklase@google.com470e71d2011-07-07 08:21:25 +0000331 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000332 }
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000333 EXPECT_EQ(0, statusEF);
334 EXPECT_EQ(0, vadPattern);
335
336 return 0;
niklase@google.com470e71d2011-07-07 08:21:25 +0000337}
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000338
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000339ActivityMonitor::ActivityMonitor() {
340 _counter[0] = _counter[1] = _counter[2] = _counter[3] = _counter[4] =
341 _counter[5] = 0;
342}
343
344ActivityMonitor::~ActivityMonitor() {
345}
346
347int32_t ActivityMonitor::InFrameType(int16_t frameType) {
348 _counter[frameType]++;
349 return 0;
350}
351
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000352void ActivityMonitor::PrintStatistics() {
353 printf("\n");
354 printf("kActiveNormalEncoded kPassiveNormalEncoded kPassiveDTXWB ");
355 printf("kPassiveDTXNB kPassiveDTXSWB kFrameEmpty\n");
356 printf("%19u", _counter[1]);
357 printf("%22u", _counter[2]);
358 printf("%14u", _counter[3]);
359 printf("%14u", _counter[4]);
360 printf("%14u", _counter[5]);
361 printf("%11u", _counter[0]);
362 printf("\n\n");
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000363}
364
365void ActivityMonitor::ResetStatistics() {
366 _counter[0] = _counter[1] = _counter[2] = _counter[3] = _counter[4] =
367 _counter[5] = 0;
368}
369
370void ActivityMonitor::GetStatistics(uint32_t* getCounter) {
371 for (int ii = 0; ii < 6; ii++) {
372 getCounter[ii] = _counter[ii];
373 }
374}
375
376} // namespace webrtc