Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / modules / audio_coding / main / acm2 / acm_receive_test.h
1 /*
2  *  Copyright (c) 2014 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 WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_RECEIVE_TEST_H_
12 #define WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_RECEIVE_TEST_H_
13
14 #include "webrtc/base/constructormagic.h"
15 #include "webrtc/system_wrappers/interface/clock.h"
16 #include "webrtc/system_wrappers/interface/scoped_ptr.h"
17
18 namespace webrtc {
19 class AudioCodingModule;
20 struct CodecInst;
21
22 namespace test {
23 class AudioSink;
24 class PacketSource;
25
26 class AcmReceiveTest {
27  public:
28   AcmReceiveTest(PacketSource* packet_source,
29                  AudioSink* audio_sink,
30                  int output_freq_hz);
31   virtual ~AcmReceiveTest() {}
32
33   // Registers the codecs with default parameters from ACM.
34   void RegisterDefaultCodecs();
35
36   // Registers codecs with payload types matching the pre-encoded NetEq test
37   // files.
38   void RegisterNetEqTestCodecs();
39
40   // Runs the test and returns true if successful.
41   void Run();
42
43  private:
44   SimulatedClock clock_;
45   scoped_ptr<AudioCodingModule> acm_;
46   PacketSource* packet_source_;
47   AudioSink* audio_sink_;
48   const int output_freq_hz_;
49
50   DISALLOW_COPY_AND_ASSIGN(AcmReceiveTest);
51 };
52
53 }  // namespace test
54 }  // namespace webrtc
55 #endif  // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_RECEIVE_TEST_H_