blob: dbadd8848752e8859d03c2491d88d4ed5b4717f4 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef MODULES_AUDIO_CODING_TEST_TESTREDFEC_H_
12#define MODULES_AUDIO_CODING_TEST_TESTREDFEC_H_
niklase@google.com470e71d2011-07-07 08:21:25 +000013
kwiberg37478382016-02-14 20:40:57 -080014#include <memory>
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +000015#include <string>
kwiberg37478382016-02-14 20:40:57 -080016
Karl Wibergc2c4d042018-10-04 12:38:03 +020017#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"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020020#include "modules/audio_coding/test/Channel.h"
21#include "modules/audio_coding/test/PCMFile.h"
Jonas Orelanda943e732022-03-16 13:50:58 +010022#include "test/scoped_key_value_config.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000023
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000024namespace webrtc {
25
Karl Wiberg3ff52ff2018-10-01 12:31:22 +020026class TestRedFec {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000027 public:
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +000028 explicit TestRedFec();
29 ~TestRedFec();
niklase@google.com470e71d2011-07-07 08:21:25 +000030
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000031 void Perform();
Yves Gerey665174f2018-06-19 15:03:05 +020032
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000033 private:
Karl Wibergc2c4d042018-10-04 12:38:03 +020034 void RegisterSendCodec(const std::unique_ptr<AudioCodingModule>& acm,
35 const SdpAudioFormat& codec_format,
36 absl::optional<Vad::Aggressiveness> vad_mode,
37 bool use_red);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000038 void Run();
39 void OpenOutFile(int16_t testNumber);
Karl Wibergc2c4d042018-10-04 12:38:03 +020040
Jonas Orelanda943e732022-03-16 13:50:58 +010041 test::ScopedKeyValueConfig field_trials_;
Karl Wibergc2c4d042018-10-04 12:38:03 +020042 const rtc::scoped_refptr<AudioEncoderFactory> encoder_factory_;
43 const rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_;
kwiberg37478382016-02-14 20:40:57 -080044 std::unique_ptr<AudioCodingModule> _acmA;
45 std::unique_ptr<AudioCodingModule> _acmB;
niklase@google.com470e71d2011-07-07 08:21:25 +000046
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000047 Channel* _channelA2B;
niklase@google.com470e71d2011-07-07 08:21:25 +000048
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000049 PCMFile _inFileA;
50 PCMFile _outFileB;
51 int16_t _testCntr;
niklase@google.com470e71d2011-07-07 08:21:25 +000052};
53
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000054} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +000055
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020056#endif // MODULES_AUDIO_CODING_TEST_TESTREDFEC_H_