blob: 173b03f4fc841dd8581acc5feb437f04bcced537 [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"
Henrik Lundin84f75692023-02-01 12:07:10 +000020#include "modules/audio_coding/acm2/acm_receiver.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020021#include "modules/audio_coding/test/Channel.h"
22#include "modules/audio_coding/test/PCMFile.h"
Jonas Orelanda943e732022-03-16 13:50:58 +010023#include "test/scoped_key_value_config.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000024
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000025namespace webrtc {
26
Henrik Lundin84f75692023-02-01 12:07:10 +000027class TestRedFec final {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000028 public:
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +000029 explicit TestRedFec();
30 ~TestRedFec();
niklase@google.com470e71d2011-07-07 08:21:25 +000031
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000032 void Perform();
Yves Gerey665174f2018-06-19 15:03:05 +020033
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000034 private:
Karl Wibergc2c4d042018-10-04 12:38:03 +020035 void RegisterSendCodec(const std::unique_ptr<AudioCodingModule>& acm,
36 const SdpAudioFormat& codec_format,
37 absl::optional<Vad::Aggressiveness> vad_mode,
38 bool use_red);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000039 void Run();
40 void OpenOutFile(int16_t testNumber);
Karl Wibergc2c4d042018-10-04 12:38:03 +020041
Jonas Orelanda943e732022-03-16 13:50:58 +010042 test::ScopedKeyValueConfig field_trials_;
Karl Wibergc2c4d042018-10-04 12:38:03 +020043 const rtc::scoped_refptr<AudioEncoderFactory> encoder_factory_;
44 const rtc::scoped_refptr<AudioDecoderFactory> decoder_factory_;
kwiberg37478382016-02-14 20:40:57 -080045 std::unique_ptr<AudioCodingModule> _acmA;
Henrik Lundin84f75692023-02-01 12:07:10 +000046 std::unique_ptr<acm2::AcmReceiver> _acm_receiver;
niklase@google.com470e71d2011-07-07 08:21:25 +000047
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000048 Channel* _channelA2B;
niklase@google.com470e71d2011-07-07 08:21:25 +000049
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000050 PCMFile _inFileA;
51 PCMFile _outFileB;
52 int16_t _testCntr;
niklase@google.com470e71d2011-07-07 08:21:25 +000053};
54
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000055} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +000056
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020057#endif // MODULES_AUDIO_CODING_TEST_TESTREDFEC_H_