blob: 35f5059db2ae256908e8551388f50b790eb8d51e [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.orgee92b662013-08-27 07:33:51 +000025TestVADDTX::TestVADDTX()
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000026 : _acmA(NULL),
27 _acmB(NULL),
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000028 _channelA2B(NULL) {
niklase@google.com470e71d2011-07-07 08:21:25 +000029}
30
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000031TestVADDTX::~TestVADDTX() {
32 if (_acmA != NULL) {
33 AudioCodingModule::Destroy(_acmA);
34 _acmA = NULL;
35 }
36 if (_acmB != NULL) {
37 AudioCodingModule::Destroy(_acmB);
38 _acmB = NULL;
39 }
40 if (_channelA2B != NULL) {
41 delete _channelA2B;
42 _channelA2B = NULL;
43 }
niklase@google.com470e71d2011-07-07 08:21:25 +000044}
45
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000046void TestVADDTX::Perform() {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000047 const std::string file_name = webrtc::test::ResourcePath(
48 "audio_coding/testfile32kHz", "pcm");
49 _inFileA.Open(file_name, 32000, "rb");
50
51 _acmA = AudioCodingModule::Create(0);
52 _acmB = AudioCodingModule::Create(1);
53
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000054 EXPECT_EQ(0, _acmA->InitializeReceiver());
55 EXPECT_EQ(0, _acmB->InitializeReceiver());
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000056
57 uint8_t numEncoders = _acmA->NumberOfCodecs();
58 CodecInst myCodecParam;
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000059 for (uint8_t n = 0; n < numEncoders; n++) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000060 EXPECT_EQ(0, _acmB->Codec(n, &myCodecParam));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000061 if (!strcmp(myCodecParam.plname, "opus")) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000062 // Register Opus as mono.
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000063 myCodecParam.channels = 1;
niklase@google.com470e71d2011-07-07 08:21:25 +000064 }
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000065 EXPECT_EQ(0, _acmB->RegisterReceiveCodec(myCodecParam));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000066 }
niklase@google.com470e71d2011-07-07 08:21:25 +000067
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000068 // Create and connect the channel
69 _channelA2B = new Channel;
70 _acmA->RegisterTransportCallback(_channelA2B);
71 _channelA2B->RegisterReceiverACM(_acmB);
niklase@google.com470e71d2011-07-07 08:21:25 +000072
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000073 _acmA->RegisterVADCallback(&_monitor);
niklase@google.com470e71d2011-07-07 08:21:25 +000074
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000075 int16_t testCntr = 1;
niklase@google.com470e71d2011-07-07 08:21:25 +000076
77#ifdef WEBRTC_CODEC_ISAC
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000078 // Open outputfile
79 OpenOutFile(testCntr++);
niklase@google.com470e71d2011-07-07 08:21:25 +000080
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000081 // Register iSAC WB as send codec
82 char nameISAC[] = "ISAC";
83 RegisterSendCodec('A', nameISAC, 16000);
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
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000091 // Open outputfile
92 OpenOutFile(testCntr++);
niklase@google.com470e71d2011-07-07 08:21:25 +000093
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000094 // Register iSAC SWB as send codec
95 RegisterSendCodec('A', nameISAC, 32000);
niklase@google.com470e71d2011-07-07 08:21:25 +000096
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000097 // Run the five test cased
98 runTestCases();
niklase@google.com470e71d2011-07-07 08:21:25 +000099
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000100 // Close file
101 _outFileB.Close();
niklase@google.com470e71d2011-07-07 08:21:25 +0000102#endif
103#ifdef WEBRTC_CODEC_ILBC
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000104 // Open outputfile
105 OpenOutFile(testCntr++);
niklase@google.com470e71d2011-07-07 08:21:25 +0000106
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000107 // Register iLBC as send codec
108 char nameILBC[] = "ilbc";
109 RegisterSendCodec('A', nameILBC);
niklase@google.com470e71d2011-07-07 08:21:25 +0000110
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000111 // Run the five test cased
112 runTestCases();
niklase@google.com470e71d2011-07-07 08:21:25 +0000113
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000114 // Close file
115 _outFileB.Close();
niklase@google.com470e71d2011-07-07 08:21:25 +0000116
117#endif
tina.legrand@webrtc.orga7d83872012-10-18 10:00:52 +0000118#ifdef WEBRTC_CODEC_OPUS
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000119 // Open outputfile
120 OpenOutFile(testCntr++);
tina.legrand@webrtc.orga7d83872012-10-18 10:00:52 +0000121
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000122 // Register Opus as send codec
123 char nameOPUS[] = "opus";
124 RegisterSendCodec('A', nameOPUS);
tina.legrand@webrtc.orga7d83872012-10-18 10:00:52 +0000125
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000126 // Run the five test cased
127 runTestCases();
tina.legrand@webrtc.orga7d83872012-10-18 10:00:52 +0000128
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000129 // Close file
130 _outFileB.Close();
tina.legrand@webrtc.orga7d83872012-10-18 10:00:52 +0000131
132#endif
niklase@google.com470e71d2011-07-07 08:21:25 +0000133}
134
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000135void TestVADDTX::runTestCases() {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000136 // #1 DTX = OFF, VAD = ON, VADNormal
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000137 SetVAD(false, true, VADNormal);
138 Run();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000139 VerifyTest();
niklase@google.com470e71d2011-07-07 08:21:25 +0000140
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000141 // #2 DTX = OFF, VAD = ON, VADAggr
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000142 SetVAD(false, true, VADAggr);
143 Run();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000144 VerifyTest();
niklase@google.com470e71d2011-07-07 08:21:25 +0000145
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000146 // #3 DTX = ON, VAD = ON, VADLowBitrate
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000147 SetVAD(true, true, VADLowBitrate);
148 Run();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000149 VerifyTest();
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000150
151 // #4 DTX = ON, VAD = ON, VADVeryAggr
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000152 SetVAD(true, true, VADVeryAggr);
153 Run();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000154 VerifyTest();
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000155
156 // #5 DTX = ON, VAD = OFF, VADNormal
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000157 SetVAD(true, false, VADNormal);
158 Run();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000159 VerifyTest();
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000160}
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000161
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000162void TestVADDTX::runTestInternalDTX(int expected_result) {
163 // #6 DTX = ON, VAD = ON, VADNormal
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000164 SetVAD(true, true, VADNormal);
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000165 EXPECT_EQ(expected_result, _acmA->ReplaceInternalDTXWithWebRtc(true));
166 if (expected_result == 0) {
167 Run();
168 VerifyTest();
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000169 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000170}
171
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000172void TestVADDTX::SetVAD(bool statusDTX, bool statusVAD, int16_t vadMode) {
173 bool dtxEnabled, vadEnabled;
174 ACMVADMode vadModeSet;
niklase@google.com470e71d2011-07-07 08:21:25 +0000175
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000176 EXPECT_EQ(0, _acmA->SetVAD(statusDTX, statusVAD, (ACMVADMode) vadMode));
177 EXPECT_EQ(0, _acmA->VAD(&dtxEnabled, &vadEnabled, &vadModeSet));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000178
179 // Requested VAD/DTX settings
180 _setStruct.statusDTX = statusDTX;
181 _setStruct.statusVAD = statusVAD;
182 _setStruct.vadMode = (ACMVADMode) vadMode;
183
184 // VAD settings after setting VAD in ACM
185 _getStruct.statusDTX = dtxEnabled;
186 _getStruct.statusVAD = vadEnabled;
187 _getStruct.vadMode = vadModeSet;
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000188}
189
190VADDTXstruct TestVADDTX::GetVAD() {
191 VADDTXstruct retStruct;
192 bool dtxEnabled, vadEnabled;
193 ACMVADMode vadModeSet;
194
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000195 EXPECT_EQ(0, _acmA->VAD(&dtxEnabled, &vadEnabled, &vadModeSet));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000196
197 retStruct.statusDTX = dtxEnabled;
198 retStruct.statusVAD = vadEnabled;
199 retStruct.vadMode = vadModeSet;
200 return retStruct;
201}
202
203int16_t TestVADDTX::RegisterSendCodec(char side, char* codecName,
204 int32_t samplingFreqHz,
205 int32_t rateKbps) {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000206 std::cout << std::flush;
207 AudioCodingModule* myACM;
208 switch (side) {
209 case 'A': {
210 myACM = _acmA;
211 break;
212 }
213 case 'B': {
214 myACM = _acmB;
215 break;
216 }
217 default:
218 return -1;
219 }
220
221 if (myACM == NULL) {
222 return -1;
223 }
224
225 CodecInst myCodecParam;
226 for (int16_t codecCntr = 0; codecCntr < myACM->NumberOfCodecs();
227 codecCntr++) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000228 EXPECT_EQ(0, myACM->Codec((uint8_t) codecCntr, &myCodecParam));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000229 if (!STR_CASE_CMP(myCodecParam.plname, codecName)) {
230 if ((samplingFreqHz == -1) || (myCodecParam.plfreq == samplingFreqHz)) {
231 if ((rateKbps == -1) || (myCodecParam.rate == rateKbps)) {
232 break;
233 }
234 }
235 }
236 }
237
238 // We only allow VAD/DTX when sending mono.
239 myCodecParam.channels = 1;
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000240 EXPECT_EQ(0, myACM->RegisterSendCodec(myCodecParam));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000241
242 // initialization was succesful
243 return 0;
244}
245
246void TestVADDTX::Run() {
247 AudioFrame audioFrame;
248
249 uint16_t SamplesIn10MsecA = _inFileA.PayloadLength10Ms();
250 uint32_t timestampA = 1;
251 int32_t outFreqHzB = _outFileB.SamplingFrequency();
252
253 while (!_inFileA.EndOfFile()) {
254 _inFileA.Read10MsData(audioFrame);
255 audioFrame.timestamp_ = timestampA;
256 timestampA += SamplesIn10MsecA;
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000257 EXPECT_EQ(0, _acmA->Add10MsData(audioFrame));
258 EXPECT_GT(_acmA->Process(), -1);
259 EXPECT_EQ(0, _acmB->PlayoutData10Ms(outFreqHzB, &audioFrame));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000260 _outFileB.Write10MsData(audioFrame.data_, audioFrame.samples_per_channel_);
261 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000262#ifdef PRINT_STAT
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000263 _monitor.PrintStatistics();
niklase@google.com470e71d2011-07-07 08:21:25 +0000264#endif
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000265 _inFileA.Rewind();
266 _monitor.GetStatistics(_statCounter);
267 _monitor.ResetStatistics();
niklase@google.com470e71d2011-07-07 08:21:25 +0000268}
269
pbos@webrtc.org0946a562013-04-09 00:28:06 +0000270void TestVADDTX::OpenOutFile(int16_t test_number) {
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +0000271 std::string file_name;
272 std::stringstream file_stream;
273 file_stream << webrtc::test::OutputPath();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000274 file_stream << "testVADDTX_outFile_";
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +0000275 file_stream << test_number << ".pcm";
276 file_name = file_stream.str();
277 _outFileB.Open(file_name, 16000, "wb");
niklase@google.com470e71d2011-07-07 08:21:25 +0000278}
279
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000280int16_t TestVADDTX::VerifyTest() {
281 // Verify empty frame result
282 uint8_t statusEF = 0;
283 uint8_t vadPattern = 0;
284 uint8_t emptyFramePattern[6];
285 CodecInst myCodecParam;
286 _acmA->SendCodec(&myCodecParam);
287 bool dtxInUse = true;
288 bool isReplaced = false;
289 if ((STR_CASE_CMP(myCodecParam.plname, "G729") == 0)
290 || (STR_CASE_CMP(myCodecParam.plname, "G723") == 0)
291 || (STR_CASE_CMP(myCodecParam.plname, "AMR") == 0)
292 || (STR_CASE_CMP(myCodecParam.plname, "AMR-wb") == 0)
293 || (STR_CASE_CMP(myCodecParam.plname, "speex") == 0)) {
294 _acmA->IsInternalDTXReplacedWithWebRtc(&isReplaced);
295 if (!isReplaced) {
296 dtxInUse = false;
niklase@google.com470e71d2011-07-07 08:21:25 +0000297 }
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000298 } else if (STR_CASE_CMP(myCodecParam.plname, "opus") == 0) {
299 if (_getStruct.statusDTX != false) {
300 // DTX status doesn't match expected.
301 vadPattern |= 4;
302 } else if (_getStruct.statusVAD != false) {
303 // Mismatch in VAD setting.
304 vadPattern |= 2;
305 } else {
306 _setStruct.statusDTX = false;
307 _setStruct.statusVAD = false;
308 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000309 }
phoglund@webrtc.orgd1a860b2012-01-26 14:49:28 +0000310
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000311 // Check for error in VAD/DTX settings
312 if (_getStruct.statusDTX != _setStruct.statusDTX) {
313 // DTX status doesn't match expected
314 vadPattern |= 4;
315 }
316 if (_getStruct.statusDTX) {
317 if ((!_getStruct.statusVAD && dtxInUse)
318 || (!dtxInUse && (_getStruct.statusVAD != _setStruct.statusVAD))) {
319 // Missmatch in VAD setting
320 vadPattern |= 2;
niklase@google.com470e71d2011-07-07 08:21:25 +0000321 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000322 } else {
323 if (_getStruct.statusVAD != _setStruct.statusVAD) {
324 // VAD status doesn't match expected
325 vadPattern |= 2;
326 }
327 }
328 if (_getStruct.vadMode != _setStruct.vadMode) {
329 // VAD Mode doesn't match expected
330 vadPattern |= 1;
331 }
332
333 // Set expected empty frame pattern
334 int ii;
335 for (ii = 0; ii < 6; ii++) {
336 emptyFramePattern[ii] = 0;
337 }
338 // 0 - "kNoEncoding", not important to check.
339 // Codecs with packetsize != 80 samples will get this output.
340 // 1 - "kActiveNormalEncoded", expect to receive some frames with this label .
341 // 2 - "kPassiveNormalEncoded".
342 // 3 - "kPassiveDTXNB".
343 // 4 - "kPassiveDTXWB".
344 // 5 - "kPassiveDTXSWB".
345 emptyFramePattern[0] = 1;
346 emptyFramePattern[1] = 1;
347 emptyFramePattern[2] = (((!_getStruct.statusDTX && _getStruct.statusVAD)
348 || (!dtxInUse && _getStruct.statusDTX)));
349 emptyFramePattern[3] = ((_getStruct.statusDTX && dtxInUse
350 && (_acmA->SendFrequency() == 8000)));
351 emptyFramePattern[4] = ((_getStruct.statusDTX && dtxInUse
352 && (_acmA->SendFrequency() == 16000)));
353 emptyFramePattern[5] = ((_getStruct.statusDTX && dtxInUse
354 && (_acmA->SendFrequency() == 32000)));
355
356 // Check pattern 1-5 (skip 0)
357 for (int ii = 1; ii < 6; ii++) {
358 if (emptyFramePattern[ii]) {
359 statusEF |= (_statCounter[ii] == 0);
niklase@google.com470e71d2011-07-07 08:21:25 +0000360 } else {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000361 statusEF |= (_statCounter[ii] > 0);
niklase@google.com470e71d2011-07-07 08:21:25 +0000362 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000363 }
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000364 EXPECT_EQ(0, statusEF);
365 EXPECT_EQ(0, vadPattern);
366
367 return 0;
niklase@google.com470e71d2011-07-07 08:21:25 +0000368}
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000369
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000370ActivityMonitor::ActivityMonitor() {
371 _counter[0] = _counter[1] = _counter[2] = _counter[3] = _counter[4] =
372 _counter[5] = 0;
373}
374
375ActivityMonitor::~ActivityMonitor() {
376}
377
378int32_t ActivityMonitor::InFrameType(int16_t frameType) {
379 _counter[frameType]++;
380 return 0;
381}
382
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000383void ActivityMonitor::PrintStatistics() {
384 printf("\n");
385 printf("kActiveNormalEncoded kPassiveNormalEncoded kPassiveDTXWB ");
386 printf("kPassiveDTXNB kPassiveDTXSWB kFrameEmpty\n");
387 printf("%19u", _counter[1]);
388 printf("%22u", _counter[2]);
389 printf("%14u", _counter[3]);
390 printf("%14u", _counter[4]);
391 printf("%14u", _counter[5]);
392 printf("%11u", _counter[0]);
393 printf("\n\n");
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000394}
395
396void ActivityMonitor::ResetStatistics() {
397 _counter[0] = _counter[1] = _counter[2] = _counter[3] = _counter[4] =
398 _counter[5] = 0;
399}
400
401void ActivityMonitor::GetStatistics(uint32_t* getCounter) {
402 for (int ii = 0; ii < 6; ii++) {
403 getCounter[ii] = _counter[ii];
404 }
405}
406
407} // namespace webrtc