1 /*
2  *  Copyright (c) 2012 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_TWOWAYCOMMUNICATION_H_
12 #define MODULES_AUDIO_CODING_TEST_TWOWAYCOMMUNICATION_H_
13 
14 #include <memory>
15 
16 #include "api/audio_codecs/audio_encoder_factory.h"
17 #include "api/audio_codecs/audio_format.h"
18 #include "modules/audio_coding/include/audio_coding_module.h"
19 #include "modules/audio_coding/test/Channel.h"
20 #include "modules/audio_coding/test/PCMFile.h"
21 
22 namespace webrtc {
23 
24 class TwoWayCommunication {
25  public:
26   TwoWayCommunication();
27   ~TwoWayCommunication();
28 
29   void Perform();
30 
31  private:
32   void SetUpAutotest(AudioEncoderFactory* const encoder_factory,
33                      const SdpAudioFormat& format1,
34                      const int payload_type1,
35                      const SdpAudioFormat& format2,
36                      const int payload_type2);
37 
38   std::unique_ptr<AudioCodingModule> _acmA;
39   std::unique_ptr<AudioCodingModule> _acmB;
40 
41   std::unique_ptr<AudioCodingModule> _acmRefA;
42   std::unique_ptr<AudioCodingModule> _acmRefB;
43 
44   Channel* _channel_A2B;
45   Channel* _channel_B2A;
46 
47   Channel* _channelRef_A2B;
48   Channel* _channelRef_B2A;
49 
50   PCMFile _inFileA;
51   PCMFile _inFileB;
52 
53   PCMFile _outFileA;
54   PCMFile _outFileB;
55 
56   PCMFile _outFileRefA;
57   PCMFile _outFileRefB;
58 };
59 
60 }  // namespace webrtc
61 
62 #endif  // MODULES_AUDIO_CODING_TEST_TWOWAYCOMMUNICATION_H_
63