blob: 58f9222048757ad749ced14a43f2870797ba9bc3 [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"
17#include "webrtc/modules/audio_coding/main/interface/audio_coding_module_typedefs.h"
18#include "webrtc/modules/audio_coding/main/test/utility.h"
19#include "webrtc/modules/audio_coding/main/source/acm_common_defs.h"
20#include "webrtc/test/testsupport/fileutils.h"
21#include "webrtc/system_wrappers/interface/trace.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
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000025TestVADDTX::TestVADDTX(int testMode)
26 : _acmA(NULL),
27 _acmB(NULL),
28 _channelA2B(NULL),
29 _testResults(0) {
30 //testMode == 1 for more extensive testing
31 //testMode == 0 for quick test (autotest)
32 _testMode = testMode;
niklase@google.com470e71d2011-07-07 08:21:25 +000033}
34
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000035TestVADDTX::~TestVADDTX() {
36 if (_acmA != NULL) {
37 AudioCodingModule::Destroy(_acmA);
38 _acmA = NULL;
39 }
40 if (_acmB != NULL) {
41 AudioCodingModule::Destroy(_acmB);
42 _acmB = NULL;
43 }
44 if (_channelA2B != NULL) {
45 delete _channelA2B;
46 _channelA2B = NULL;
47 }
niklase@google.com470e71d2011-07-07 08:21:25 +000048}
49
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000050void TestVADDTX::Perform() {
51 if (_testMode == 0) {
52 printf("Running VAD/DTX Test");
53 WEBRTC_TRACE(webrtc::kTraceStateInfo, webrtc::kTraceAudioCoding, -1,
54 "---------- TestVADDTX ----------");
55 }
56
57 const std::string file_name = webrtc::test::ResourcePath(
58 "audio_coding/testfile32kHz", "pcm");
59 _inFileA.Open(file_name, 32000, "rb");
60
61 _acmA = AudioCodingModule::Create(0);
62 _acmB = AudioCodingModule::Create(1);
63
64 _acmA->InitializeReceiver();
65 _acmB->InitializeReceiver();
66
67 uint8_t numEncoders = _acmA->NumberOfCodecs();
68 CodecInst myCodecParam;
69 if (_testMode != 0) {
70 printf("Registering codecs at receiver... \n");
71 }
72 for (uint8_t n = 0; n < numEncoders; n++) {
73 _acmB->Codec(n, &myCodecParam);
74 if (_testMode != 0) {
75 printf("%s\n", myCodecParam.plname);
niklase@google.com470e71d2011-07-07 08:21:25 +000076 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000077 if (!strcmp(myCodecParam.plname, "opus")) {
78 // Use mono decoding for Opus in the VAD/DTX test.
79 myCodecParam.channels = 1;
niklase@google.com470e71d2011-07-07 08:21:25 +000080 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000081 _acmB->RegisterReceiveCodec(myCodecParam);
82 }
niklase@google.com470e71d2011-07-07 08:21:25 +000083
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000084 // Create and connect the channel
85 _channelA2B = new Channel;
86 _acmA->RegisterTransportCallback(_channelA2B);
87 _channelA2B->RegisterReceiverACM(_acmB);
niklase@google.com470e71d2011-07-07 08:21:25 +000088
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000089 _acmA->RegisterVADCallback(&_monitor);
niklase@google.com470e71d2011-07-07 08:21:25 +000090
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000091 int16_t testCntr = 1;
92 int16_t testResults = 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000093
94#ifdef WEBRTC_CODEC_ISAC
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000095 // Open outputfile
96 OpenOutFile(testCntr++);
niklase@google.com470e71d2011-07-07 08:21:25 +000097
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000098 // Register iSAC WB as send codec
99 char nameISAC[] = "ISAC";
100 RegisterSendCodec('A', nameISAC, 16000);
niklase@google.com470e71d2011-07-07 08:21:25 +0000101
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000102 // Run the five test cased
103 runTestCases();
niklase@google.com470e71d2011-07-07 08:21:25 +0000104
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000105 // Close file
106 _outFileB.Close();
niklase@google.com470e71d2011-07-07 08:21:25 +0000107
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000108 // Open outputfile
109 OpenOutFile(testCntr++);
niklase@google.com470e71d2011-07-07 08:21:25 +0000110
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000111 // Register iSAC SWB as send codec
112 RegisterSendCodec('A', nameISAC, 32000);
niklase@google.com470e71d2011-07-07 08:21:25 +0000113
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000114 // Run the five test cased
115 runTestCases();
niklase@google.com470e71d2011-07-07 08:21:25 +0000116
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000117 // Close file
118 _outFileB.Close();
niklase@google.com470e71d2011-07-07 08:21:25 +0000119#endif
120#ifdef WEBRTC_CODEC_ILBC
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000121 // Open outputfile
122 OpenOutFile(testCntr++);
niklase@google.com470e71d2011-07-07 08:21:25 +0000123
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000124 // Register iLBC as send codec
125 char nameILBC[] = "ilbc";
126 RegisterSendCodec('A', nameILBC);
niklase@google.com470e71d2011-07-07 08:21:25 +0000127
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000128 // Run the five test cased
129 runTestCases();
niklase@google.com470e71d2011-07-07 08:21:25 +0000130
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000131 // Close file
132 _outFileB.Close();
niklase@google.com470e71d2011-07-07 08:21:25 +0000133
134#endif
tina.legrand@webrtc.orga7d83872012-10-18 10:00:52 +0000135#ifdef WEBRTC_CODEC_OPUS
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000136 // Open outputfile
137 OpenOutFile(testCntr++);
tina.legrand@webrtc.orga7d83872012-10-18 10:00:52 +0000138
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000139 // Register Opus as send codec
140 char nameOPUS[] = "opus";
141 RegisterSendCodec('A', nameOPUS);
tina.legrand@webrtc.orga7d83872012-10-18 10:00:52 +0000142
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000143 // Run the five test cased
144 runTestCases();
tina.legrand@webrtc.orga7d83872012-10-18 10:00:52 +0000145
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000146 // Close file
147 _outFileB.Close();
tina.legrand@webrtc.orga7d83872012-10-18 10:00:52 +0000148
149#endif
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000150 if (_testMode) {
151 printf("Done!\n");
152 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000153
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000154 printf("VAD/DTX test completed with %d subtests failed\n", testResults);
155 if (testResults > 0) {
156 printf("Press return\n\n");
157 getchar();
158 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000159}
160
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000161void TestVADDTX::runTestCases() {
162 if (_testMode != 0) {
niklase@google.com470e71d2011-07-07 08:21:25 +0000163 CodecInst myCodecParam;
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000164 _acmA->SendCodec(&myCodecParam);
165 printf("%s\n", myCodecParam.plname);
166 } else {
167 printf(".");
168 }
169 // #1 DTX = OFF, VAD = ON, VADNormal
170 if (_testMode != 0)
171 printf("Test #1 ");
172 SetVAD(false, true, VADNormal);
173 Run();
174 _testResults += VerifyTest();
niklase@google.com470e71d2011-07-07 08:21:25 +0000175
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000176 // #2 DTX = OFF, VAD = ON, VADAggr
177 if (_testMode != 0)
178 printf("Test #2 ");
179 SetVAD(false, true, VADAggr);
180 Run();
181 _testResults += VerifyTest();
niklase@google.com470e71d2011-07-07 08:21:25 +0000182
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000183 // #3 DTX = ON, VAD = ON, VADLowBitrate
184 if (_testMode != 0)
185 printf("Test #3 ");
186 SetVAD(true, true, VADLowBitrate);
187 Run();
188 _testResults += VerifyTest();
189
190 // #4 DTX = ON, VAD = ON, VADVeryAggr
191 if (_testMode != 0)
192 printf("Test #4 ");
193 SetVAD(true, true, VADVeryAggr);
194 Run();
195 _testResults += VerifyTest();
196
197 // #5 DTX = ON, VAD = OFF, VADNormal
198 if (_testMode != 0)
199 printf("Test #5 ");
200 SetVAD(true, false, VADNormal);
201 Run();
202 _testResults += VerifyTest();
203
204}
205void TestVADDTX::runTestInternalDTX() {
206 // #6 DTX = ON, VAD = ON, VADNormal
207 if (_testMode != 0)
208 printf("Test #6 ");
209
210 SetVAD(true, true, VADNormal);
211 if (_acmA->ReplaceInternalDTXWithWebRtc(true) < 0) {
212 printf("Was not able to replace DTX since CN was not registered\n");
213 }
214 Run();
215 _testResults += VerifyTest();
niklase@google.com470e71d2011-07-07 08:21:25 +0000216}
217
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000218void TestVADDTX::SetVAD(bool statusDTX, bool statusVAD, int16_t vadMode) {
219 bool dtxEnabled, vadEnabled;
220 ACMVADMode vadModeSet;
niklase@google.com470e71d2011-07-07 08:21:25 +0000221
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000222 if (_acmA->SetVAD(statusDTX, statusVAD, (ACMVADMode) vadMode) < 0) {
223 assert(false);
224 }
225 if (_acmA->VAD(&dtxEnabled, &vadEnabled, &vadModeSet) < 0) {
226 assert(false);
227 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000228
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000229 if (_testMode != 0) {
230 if (statusDTX != dtxEnabled) {
231 printf("DTX: %s not the same as requested: %s\n",
232 dtxEnabled ? "ON" : "OFF", dtxEnabled ? "OFF" : "ON");
niklase@google.com470e71d2011-07-07 08:21:25 +0000233 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000234 if (((statusVAD == true) && (vadEnabled == false)) ||
235 ((statusVAD == false) && (vadEnabled == false) &&
236 (statusDTX == true))) {
237 printf("VAD: %s not the same as requested: %s\n",
238 vadEnabled ? "ON" : "OFF", vadEnabled ? "OFF" : "ON");
239 }
240 if (vadModeSet != vadMode) {
241 printf("VAD mode: %d not the same as requested: %d\n",
242 (int16_t) vadModeSet, (int16_t) vadMode);
243 }
244 }
245
246 // Requested VAD/DTX settings
247 _setStruct.statusDTX = statusDTX;
248 _setStruct.statusVAD = statusVAD;
249 _setStruct.vadMode = (ACMVADMode) vadMode;
250
251 // VAD settings after setting VAD in ACM
252 _getStruct.statusDTX = dtxEnabled;
253 _getStruct.statusVAD = vadEnabled;
254 _getStruct.vadMode = vadModeSet;
255
256}
257
258VADDTXstruct TestVADDTX::GetVAD() {
259 VADDTXstruct retStruct;
260 bool dtxEnabled, vadEnabled;
261 ACMVADMode vadModeSet;
262
263 if (_acmA->VAD(&dtxEnabled, &vadEnabled, &vadModeSet) < 0) {
264 assert(false);
265 }
266
267 retStruct.statusDTX = dtxEnabled;
268 retStruct.statusVAD = vadEnabled;
269 retStruct.vadMode = vadModeSet;
270 return retStruct;
271}
272
273int16_t TestVADDTX::RegisterSendCodec(char side, char* codecName,
274 int32_t samplingFreqHz,
275 int32_t rateKbps) {
276 if (_testMode != 0) {
277 printf("Registering %s for side %c\n", codecName, side);
278 }
279 std::cout << std::flush;
280 AudioCodingModule* myACM;
281 switch (side) {
282 case 'A': {
283 myACM = _acmA;
284 break;
285 }
286 case 'B': {
287 myACM = _acmB;
288 break;
289 }
290 default:
291 return -1;
292 }
293
294 if (myACM == NULL) {
295 return -1;
296 }
297
298 CodecInst myCodecParam;
299 for (int16_t codecCntr = 0; codecCntr < myACM->NumberOfCodecs();
300 codecCntr++) {
301 CHECK_ERROR(myACM->Codec((uint8_t) codecCntr, &myCodecParam));
302 if (!STR_CASE_CMP(myCodecParam.plname, codecName)) {
303 if ((samplingFreqHz == -1) || (myCodecParam.plfreq == samplingFreqHz)) {
304 if ((rateKbps == -1) || (myCodecParam.rate == rateKbps)) {
305 break;
306 }
307 }
308 }
309 }
310
311 // We only allow VAD/DTX when sending mono.
312 myCodecParam.channels = 1;
313 CHECK_ERROR(myACM->RegisterSendCodec(myCodecParam));
314
315 // initialization was succesful
316 return 0;
317}
318
319void TestVADDTX::Run() {
320 AudioFrame audioFrame;
321
322 uint16_t SamplesIn10MsecA = _inFileA.PayloadLength10Ms();
323 uint32_t timestampA = 1;
324 int32_t outFreqHzB = _outFileB.SamplingFrequency();
325
326 while (!_inFileA.EndOfFile()) {
327 _inFileA.Read10MsData(audioFrame);
328 audioFrame.timestamp_ = timestampA;
329 timestampA += SamplesIn10MsecA;
330 CHECK_ERROR(_acmA->Add10MsData(audioFrame));
331
332 CHECK_ERROR(_acmA->Process());
333
334 CHECK_ERROR(_acmB->PlayoutData10Ms(outFreqHzB, &audioFrame));
335 _outFileB.Write10MsData(audioFrame.data_, audioFrame.samples_per_channel_);
336 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000337#ifdef PRINT_STAT
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000338 _monitor.PrintStatistics(_testMode);
niklase@google.com470e71d2011-07-07 08:21:25 +0000339#endif
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000340 _inFileA.Rewind();
341 _monitor.GetStatistics(_statCounter);
342 _monitor.ResetStatistics();
niklase@google.com470e71d2011-07-07 08:21:25 +0000343}
344
pbos@webrtc.org0946a562013-04-09 00:28:06 +0000345void TestVADDTX::OpenOutFile(int16_t test_number) {
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +0000346 std::string file_name;
347 std::stringstream file_stream;
348 file_stream << webrtc::test::OutputPath();
349 if (_testMode == 0) {
350 file_stream << "testVADDTX_autoFile_";
351 } else {
352 file_stream << "testVADDTX_outFile_";
353 }
354 file_stream << test_number << ".pcm";
355 file_name = file_stream.str();
356 _outFileB.Open(file_name, 16000, "wb");
niklase@google.com470e71d2011-07-07 08:21:25 +0000357}
358
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000359int16_t TestVADDTX::VerifyTest() {
360 // Verify empty frame result
361 uint8_t statusEF = 0;
362 uint8_t vadPattern = 0;
363 uint8_t emptyFramePattern[6];
364 CodecInst myCodecParam;
365 _acmA->SendCodec(&myCodecParam);
366 bool dtxInUse = true;
367 bool isReplaced = false;
368 if ((STR_CASE_CMP(myCodecParam.plname, "G729") == 0)
369 || (STR_CASE_CMP(myCodecParam.plname, "G723") == 0)
370 || (STR_CASE_CMP(myCodecParam.plname, "AMR") == 0)
371 || (STR_CASE_CMP(myCodecParam.plname, "AMR-wb") == 0)
372 || (STR_CASE_CMP(myCodecParam.plname, "speex") == 0)) {
373 _acmA->IsInternalDTXReplacedWithWebRtc(&isReplaced);
374 if (!isReplaced) {
375 dtxInUse = false;
niklase@google.com470e71d2011-07-07 08:21:25 +0000376 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000377 }
phoglund@webrtc.orgd1a860b2012-01-26 14:49:28 +0000378
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000379 // Check for error in VAD/DTX settings
380 if (_getStruct.statusDTX != _setStruct.statusDTX) {
381 // DTX status doesn't match expected
382 vadPattern |= 4;
383 }
384 if (_getStruct.statusDTX) {
385 if ((!_getStruct.statusVAD && dtxInUse)
386 || (!dtxInUse && (_getStruct.statusVAD != _setStruct.statusVAD))) {
387 // Missmatch in VAD setting
388 vadPattern |= 2;
niklase@google.com470e71d2011-07-07 08:21:25 +0000389 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000390 } else {
391 if (_getStruct.statusVAD != _setStruct.statusVAD) {
392 // VAD status doesn't match expected
393 vadPattern |= 2;
394 }
395 }
396 if (_getStruct.vadMode != _setStruct.vadMode) {
397 // VAD Mode doesn't match expected
398 vadPattern |= 1;
399 }
400
401 // Set expected empty frame pattern
402 int ii;
403 for (ii = 0; ii < 6; ii++) {
404 emptyFramePattern[ii] = 0;
405 }
406 // 0 - "kNoEncoding", not important to check.
407 // Codecs with packetsize != 80 samples will get this output.
408 // 1 - "kActiveNormalEncoded", expect to receive some frames with this label .
409 // 2 - "kPassiveNormalEncoded".
410 // 3 - "kPassiveDTXNB".
411 // 4 - "kPassiveDTXWB".
412 // 5 - "kPassiveDTXSWB".
413 emptyFramePattern[0] = 1;
414 emptyFramePattern[1] = 1;
415 emptyFramePattern[2] = (((!_getStruct.statusDTX && _getStruct.statusVAD)
416 || (!dtxInUse && _getStruct.statusDTX)));
417 emptyFramePattern[3] = ((_getStruct.statusDTX && dtxInUse
418 && (_acmA->SendFrequency() == 8000)));
419 emptyFramePattern[4] = ((_getStruct.statusDTX && dtxInUse
420 && (_acmA->SendFrequency() == 16000)));
421 emptyFramePattern[5] = ((_getStruct.statusDTX && dtxInUse
422 && (_acmA->SendFrequency() == 32000)));
423
424 // Check pattern 1-5 (skip 0)
425 for (int ii = 1; ii < 6; ii++) {
426 if (emptyFramePattern[ii]) {
427 statusEF |= (_statCounter[ii] == 0);
niklase@google.com470e71d2011-07-07 08:21:25 +0000428 } else {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000429 statusEF |= (_statCounter[ii] > 0);
niklase@google.com470e71d2011-07-07 08:21:25 +0000430 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000431 }
432 if ((statusEF == 0) && (vadPattern == 0)) {
433 if (_testMode != 0) {
434 printf(" Test OK!\n");
niklase@google.com470e71d2011-07-07 08:21:25 +0000435 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000436 return 0;
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000437 } else {
438 if (statusEF) {
439 printf("\t\t\tUnexpected empty frame result!\n");
niklase@google.com470e71d2011-07-07 08:21:25 +0000440 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000441 if (vadPattern) {
442 printf("\t\t\tUnexpected SetVAD() result!\tDTX: %d\tVAD: %d\tMode: %d\n",
443 (vadPattern >> 2) & 1, (vadPattern >> 1) & 1, vadPattern & 1);
niklase@google.com470e71d2011-07-07 08:21:25 +0000444 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000445 return 1;
446 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000447}
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000448
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000449ActivityMonitor::ActivityMonitor() {
450 _counter[0] = _counter[1] = _counter[2] = _counter[3] = _counter[4] =
451 _counter[5] = 0;
452}
453
454ActivityMonitor::~ActivityMonitor() {
455}
456
457int32_t ActivityMonitor::InFrameType(int16_t frameType) {
458 _counter[frameType]++;
459 return 0;
460}
461
462void ActivityMonitor::PrintStatistics(int testMode) {
463 if (testMode != 0) {
464 printf("\n");
465 printf("kActiveNormalEncoded kPassiveNormalEncoded kPassiveDTXWB ");
466 printf("kPassiveDTXNB kPassiveDTXSWB kFrameEmpty\n");
467 printf("%19u", _counter[1]);
468 printf("%22u", _counter[2]);
469 printf("%14u", _counter[3]);
470 printf("%14u", _counter[4]);
471 printf("%14u", _counter[5]);
472 printf("%11u", _counter[0]);
473 printf("\n\n");
474 }
475}
476
477void ActivityMonitor::ResetStatistics() {
478 _counter[0] = _counter[1] = _counter[2] = _counter[3] = _counter[4] =
479 _counter[5] = 0;
480}
481
482void ActivityMonitor::GetStatistics(uint32_t* getCounter) {
483 for (int ii = 0; ii < 6; ii++) {
484 getCounter[ii] = _counter[ii];
485 }
486}
487
488} // namespace webrtc