TestRedFec.h (1928B)
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 <cstdint> 15 #include <memory> 16 #include <optional> 17 18 #include "api/audio_codecs/audio_decoder_factory.h" 19 #include "api/audio_codecs/audio_encoder_factory.h" 20 #include "api/audio_codecs/audio_format.h" 21 #include "api/environment/environment.h" 22 #include "api/neteq/neteq.h" 23 #include "api/scoped_refptr.h" 24 #include "common_audio/vad/include/vad.h" 25 #include "modules/audio_coding/acm2/acm_resampler.h" 26 #include "modules/audio_coding/include/audio_coding_module.h" 27 #include "modules/audio_coding/test/Channel.h" 28 #include "modules/audio_coding/test/PCMFile.h" 29 30 namespace webrtc { 31 32 class TestRedFec final { 33 public: 34 explicit TestRedFec(); 35 ~TestRedFec(); 36 37 void Perform(); 38 39 private: 40 void RegisterSendCodec(const std::unique_ptr<AudioCodingModule>& acm, 41 const SdpAudioFormat& codec_format, 42 std::optional<Vad::Aggressiveness> vad_mode, 43 bool use_red); 44 void Run(); 45 void OpenOutFile(int16_t testNumber); 46 47 const Environment env_; 48 const scoped_refptr<AudioEncoderFactory> encoder_factory_; 49 const scoped_refptr<AudioDecoderFactory> decoder_factory_; 50 std::unique_ptr<AudioCodingModule> _acmA; 51 std::unique_ptr<NetEq> _neteq; 52 acm2::ResamplerHelper _resampler_helper; 53 54 Channel* _channelA2B; 55 56 PCMFile _inFileA; 57 PCMFile _outFileB; 58 int16_t _testCntr; 59 }; 60 61 } // namespace webrtc 62 63 #endif // MODULES_AUDIO_CODING_TEST_TESTREDFEC_H_