niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 | |
| 11 | #ifndef TEST_VAD_DTX_H |
| 12 | #define TEST_VAD_DTX_H |
| 13 | |
| 14 | #include "ACMTest.h" |
| 15 | #include "Channel.h" |
| 16 | #include "PCMFile.h" |
| 17 | |
tina.legrand@webrtc.org | 554ae1a | 2011-12-16 10:09:04 +0000 | [diff] [blame] | 18 | namespace webrtc { |
| 19 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 20 | typedef struct |
| 21 | { |
| 22 | bool statusDTX; |
| 23 | bool statusVAD; |
| 24 | ACMVADMode vadMode; |
| 25 | } VADDTXstruct; |
| 26 | |
| 27 | class ActivityMonitor : public ACMVADCallback |
| 28 | { |
| 29 | public: |
| 30 | ActivityMonitor(); |
| 31 | ~ActivityMonitor(); |
| 32 | WebRtc_Word32 InFrameType(WebRtc_Word16 frameType); |
| 33 | void PrintStatistics(int testMode); |
| 34 | void ResetStatistics(); |
| 35 | void GetStatistics(WebRtc_UWord32* getCounter); |
| 36 | private: |
| 37 | // counting according to |
| 38 | /*enum WebRtcACMEncodingType |
| 39 | { |
| 40 | kNoEncoding, |
| 41 | kActiveNormalEncoded, |
| 42 | kPassiveNormalEncoded, |
| 43 | kPassiveDTXNB, |
| 44 | kPassiveDTXWB, |
| 45 | kPassiveDTXSWB |
| 46 | };*/ |
| 47 | WebRtc_UWord32 _counter[6]; |
| 48 | }; |
| 49 | |
| 50 | class TestVADDTX : public ACMTest |
| 51 | { |
| 52 | public: |
| 53 | TestVADDTX(int testMode); |
| 54 | ~TestVADDTX(); |
| 55 | |
| 56 | void Perform(); |
| 57 | private: |
| 58 | // Registration can be based on codec name only, codec name and sampling frequency, or |
| 59 | // codec name, sampling frequency and rate. |
| 60 | WebRtc_Word16 RegisterSendCodec(char side, |
| 61 | char* codecName, |
| 62 | WebRtc_Word32 samplingFreqHz = -1, |
| 63 | WebRtc_Word32 rateKhz = -1); |
| 64 | void Run(); |
| 65 | void OpenOutFile(WebRtc_Word16 testNumber); |
| 66 | void runTestCases(); |
| 67 | void runTestInternalDTX(); |
| 68 | void SetVAD(bool statusDTX, bool statusVAD, WebRtc_Word16 vadMode); |
| 69 | VADDTXstruct GetVAD(); |
| 70 | WebRtc_Word16 VerifyTest();//VADDTXstruct setDTX, VADDTXstruct getDTX); |
| 71 | AudioCodingModule* _acmA; |
| 72 | AudioCodingModule* _acmB; |
| 73 | |
| 74 | Channel* _channelA2B; |
| 75 | |
| 76 | PCMFile _inFileA; |
| 77 | PCMFile _outFileB; |
| 78 | |
| 79 | ActivityMonitor _monitor; |
| 80 | WebRtc_UWord32 _statCounter[6]; |
| 81 | |
| 82 | int _testMode; |
| 83 | int _testResults; |
| 84 | VADDTXstruct _setStruct; |
| 85 | VADDTXstruct _getStruct; |
| 86 | }; |
| 87 | |
tina.legrand@webrtc.org | 554ae1a | 2011-12-16 10:09:04 +0000 | [diff] [blame] | 88 | } // namespace webrtc |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 89 | |
| 90 | #endif |