niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
tina.legrand@webrtc.org | ba46804 | 2012-08-17 10:38:28 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 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 ACM_ISAC_TEST_H |
| 12 | #define ACM_ISAC_TEST_H |
| 13 | |
tina.legrand@webrtc.org | ba46804 | 2012-08-17 10:38:28 +0000 | [diff] [blame] | 14 | #include <string.h> |
| 15 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 16 | #include "ACMTest.h" |
| 17 | #include "Channel.h" |
| 18 | #include "PCMFile.h" |
| 19 | #include "audio_coding_module.h" |
| 20 | #include "utility.h" |
| 21 | #include "common_types.h" |
| 22 | |
| 23 | #define MAX_FILE_NAME_LENGTH_BYTE 500 |
| 24 | #define NO_OF_CLIENTS 15 |
| 25 | |
tina.legrand@webrtc.org | 554ae1a | 2011-12-16 10:09:04 +0000 | [diff] [blame] | 26 | namespace webrtc { |
| 27 | |
tina.legrand@webrtc.org | d5726a1 | 2013-05-03 07:34:12 +0000 | [diff] [blame^] | 28 | struct ACMTestISACConfig { |
| 29 | int32_t currentRateBitPerSec; |
| 30 | int16_t currentFrameSizeMsec; |
| 31 | uint32_t maxRateBitPerSec; |
| 32 | int16_t maxPayloadSizeByte; |
| 33 | int16_t encodingMode; |
| 34 | uint32_t initRateBitPerSec; |
| 35 | int16_t initFrameSizeInMsec; |
| 36 | bool enforceFrameSize; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 37 | }; |
| 38 | |
tina.legrand@webrtc.org | d5726a1 | 2013-05-03 07:34:12 +0000 | [diff] [blame^] | 39 | class ISACTest : public ACMTest { |
| 40 | public: |
| 41 | ISACTest(int testMode); |
| 42 | ~ISACTest(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 43 | |
tina.legrand@webrtc.org | d5726a1 | 2013-05-03 07:34:12 +0000 | [diff] [blame^] | 44 | void Perform(); |
| 45 | private: |
| 46 | int16_t Setup(); |
| 47 | int16_t SetupConference(); |
| 48 | int16_t RunConference(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 49 | |
tina.legrand@webrtc.org | d5726a1 | 2013-05-03 07:34:12 +0000 | [diff] [blame^] | 50 | void Run10ms(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 51 | |
tina.legrand@webrtc.org | d5726a1 | 2013-05-03 07:34:12 +0000 | [diff] [blame^] | 52 | void EncodeDecode(int testNr, ACMTestISACConfig& wbISACConfig, |
| 53 | ACMTestISACConfig& swbISACConfig); |
pbos@webrtc.org | 0946a56 | 2013-04-09 00:28:06 +0000 | [diff] [blame] | 54 | |
tina.legrand@webrtc.org | d5726a1 | 2013-05-03 07:34:12 +0000 | [diff] [blame^] | 55 | void TestBWE(int testNr); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 56 | |
tina.legrand@webrtc.org | d5726a1 | 2013-05-03 07:34:12 +0000 | [diff] [blame^] | 57 | void SwitchingSamplingRate(int testNr, int maxSampRateChange); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 58 | |
tina.legrand@webrtc.org | d5726a1 | 2013-05-03 07:34:12 +0000 | [diff] [blame^] | 59 | AudioCodingModule* _acmA; |
| 60 | AudioCodingModule* _acmB; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 61 | |
tina.legrand@webrtc.org | d5726a1 | 2013-05-03 07:34:12 +0000 | [diff] [blame^] | 62 | Channel* _channel_A2B; |
| 63 | Channel* _channel_B2A; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 64 | |
tina.legrand@webrtc.org | d5726a1 | 2013-05-03 07:34:12 +0000 | [diff] [blame^] | 65 | PCMFile _inFileA; |
| 66 | PCMFile _inFileB; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 67 | |
tina.legrand@webrtc.org | d5726a1 | 2013-05-03 07:34:12 +0000 | [diff] [blame^] | 68 | PCMFile _outFileA; |
| 69 | PCMFile _outFileB; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 70 | |
tina.legrand@webrtc.org | d5726a1 | 2013-05-03 07:34:12 +0000 | [diff] [blame^] | 71 | uint8_t _idISAC16kHz; |
| 72 | uint8_t _idISAC32kHz; |
| 73 | CodecInst _paramISAC16kHz; |
| 74 | CodecInst _paramISAC32kHz; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 75 | |
tina.legrand@webrtc.org | d5726a1 | 2013-05-03 07:34:12 +0000 | [diff] [blame^] | 76 | std::string file_name_swb_; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 77 | |
tina.legrand@webrtc.org | d5726a1 | 2013-05-03 07:34:12 +0000 | [diff] [blame^] | 78 | ACMTestTimer _myTimer; |
| 79 | int _testMode; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 80 | |
tina.legrand@webrtc.org | d5726a1 | 2013-05-03 07:34:12 +0000 | [diff] [blame^] | 81 | AudioCodingModule* _defaultACM32; |
| 82 | AudioCodingModule* _defaultACM16; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 83 | |
tina.legrand@webrtc.org | d5726a1 | 2013-05-03 07:34:12 +0000 | [diff] [blame^] | 84 | AudioCodingModule* _confACM[NO_OF_CLIENTS]; |
| 85 | AudioCodingModule* _clientACM[NO_OF_CLIENTS]; |
| 86 | Channel* _conf2Client[NO_OF_CLIENTS]; |
| 87 | Channel* _client2Conf[NO_OF_CLIENTS]; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 88 | |
tina.legrand@webrtc.org | d5726a1 | 2013-05-03 07:34:12 +0000 | [diff] [blame^] | 89 | PCMFile _clientOutFile[NO_OF_CLIENTS]; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 90 | }; |
| 91 | |
tina.legrand@webrtc.org | d5726a1 | 2013-05-03 07:34:12 +0000 | [diff] [blame^] | 92 | } // namespace webrtc |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 93 | |
| 94 | #endif |