TestRedFec.h 1.6 KB

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