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 MODULES_AUDIO_CODING_TEST_TESTREDFEC_H_ 12 #define MODULES_AUDIO_CODING_TEST_TESTREDFEC_H_ 13 14 #include <memory> 15 #include <string> 16 17 #include "api/audio_codecs/audio_decoder_factory.h" 18 #include "api/audio_codecs/audio_encoder_factory.h" 19 #include "common_audio/vad/include/vad.h" 20 #include "modules/audio_coding/test/Channel.h" 21 #include "modules/audio_coding/test/PCMFile.h" 22 23 namespace webrtc { 24 25 class TestRedFec { 26 public: 27 explicit TestRedFec(); 28 ~TestRedFec(); 29 30 void Perform(); 31 32 private: 33 void RegisterSendCodec(const std::unique_ptr<AudioCodingModule>& acm, 34 const SdpAudioFormat& codec_format, 35 absl::optional<Vad::Aggressiveness> vad_mode, 36 bool use_red); 37 void Run(); 38 void OpenOutFile(int16_t testNumber); 39 40 const rtc::scoped_refptr<AudioEncoderFactory> encoder_factory_; 41 const rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_; 42 std::unique_ptr<AudioCodingModule> _acmA; 43 std::unique_ptr<AudioCodingModule> _acmB; 44 45 Channel* _channelA2B; 46 47 PCMFile _inFileA; 48 PCMFile _outFileB; 49 int16_t _testCntr; 50 }; 51 52 } // namespace webrtc 53 54 #endif // MODULES_AUDIO_CODING_TEST_TESTREDFEC_H_ 55