tina.legrand@webrtc.org ee92b664b3 Re-organizing ACM tests
The ACM tests needed re-writing, because all tests were not individual gtests, and the result was difficult to interpret.

While doing the re-write, I discovered a bug related to 48 kHz CNG. We can't have the 48 kHz CNG active at the moment. The bug is fixed in this CL.

I also needed to rewrite parts of the VAD/DTX implementation, so that the status of VAD and DTX (enabled or not) is propagated back from the function SetVAD().

BUG=issue2173
R=minyue@webrtc.org, turaj@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1961004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4625 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-08-27 07:33:51 +00:00

81 lines
1.7 KiB
C++

/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef ACM_ISAC_TEST_H
#define ACM_ISAC_TEST_H
#include <string.h>
#include "ACMTest.h"
#include "Channel.h"
#include "PCMFile.h"
#include "audio_coding_module.h"
#include "utility.h"
#include "common_types.h"
#define MAX_FILE_NAME_LENGTH_BYTE 500
#define NO_OF_CLIENTS 15
namespace webrtc {
struct ACMTestISACConfig {
int32_t currentRateBitPerSec;
int16_t currentFrameSizeMsec;
uint32_t maxRateBitPerSec;
int16_t maxPayloadSizeByte;
int16_t encodingMode;
uint32_t initRateBitPerSec;
int16_t initFrameSizeInMsec;
bool enforceFrameSize;
};
class ISACTest : public ACMTest {
public:
ISACTest(int testMode);
~ISACTest();
void Perform();
private:
void Setup();
void Run10ms();
void EncodeDecode(int testNr, ACMTestISACConfig& wbISACConfig,
ACMTestISACConfig& swbISACConfig);
void SwitchingSamplingRate(int testNr, int maxSampRateChange);
AudioCodingModule* _acmA;
AudioCodingModule* _acmB;
Channel* _channel_A2B;
Channel* _channel_B2A;
PCMFile _inFileA;
PCMFile _inFileB;
PCMFile _outFileA;
PCMFile _outFileB;
uint8_t _idISAC16kHz;
uint8_t _idISAC32kHz;
CodecInst _paramISAC16kHz;
CodecInst _paramISAC32kHz;
std::string file_name_swb_;
ACMTestTimer _myTimer;
int _testMode;
};
} // namespace webrtc
#endif