Note: We no longer publish the latest version of our code here. We primarily use a kumc-bmi github organization. The heron ETL repository, in particular, is not public. Peers in the informatics community should see MultiSiteDev for details on requesting access.

source: webrtc/webrtc/modules/audio_coding/main/test/TestAllCodecs.h @ 0:4bda6873e34c

pub_scrub_3792 tip
Last change on this file since 0:4bda6873e34c was 0:4bda6873e34c, checked in by Michael Prittie <mprittie@…>, 6 years ago

Scrubbed password for publication.

File size: 2.5 KB
Line 
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 WEBRTC_MODULES_AUDIO_CODING_MAIN_TEST_TESTALLCODECS_H_
12#define WEBRTC_MODULES_AUDIO_CODING_MAIN_TEST_TESTALLCODECS_H_
13
14#include "webrtc/common.h"
15#include "webrtc/modules/audio_coding/main/test/ACMTest.h"
16#include "webrtc/modules/audio_coding/main/test/Channel.h"
17#include "webrtc/modules/audio_coding/main/test/PCMFile.h"
18#include "webrtc/system_wrappers/interface/scoped_ptr.h"
19#include "webrtc/typedefs.h"
20
21namespace webrtc {
22
23class Config;
24
25class TestPack : public AudioPacketizationCallback {
26 public:
27  TestPack();
28  ~TestPack();
29
30  void RegisterReceiverACM(AudioCodingModule* acm);
31
32  int32_t SendData(FrameType frame_type, uint8_t payload_type,
33                   uint32_t timestamp, const uint8_t* payload_data,
34                   uint16_t payload_size,
35                   const RTPFragmentationHeader* fragmentation);
36
37  uint16_t payload_size();
38  uint32_t timestamp_diff();
39  void reset_payload_size();
40
41 private:
42  AudioCodingModule* receiver_acm_;
43  uint16_t sequence_number_;
44  uint8_t payload_data_[60 * 32 * 2 * 2];
45  uint32_t timestamp_diff_;
46  uint32_t last_in_timestamp_;
47  uint64_t total_bytes_;
48  uint16_t payload_size_;
49};
50
51class TestAllCodecs : public ACMTest {
52 public:
53  TestAllCodecs(int test_mode, const Config& config);
54  ~TestAllCodecs();
55
56  void Perform();
57
58 private:
59  // The default value of '-1' indicates that the registration is based only on
60  // codec name, and a sampling frequency matching is not required.
61  // This is useful for codecs which support several sampling frequency.
62  // Note! Only mono mode is tested in this test.
63  void RegisterSendCodec(char side, char* codec_name, int32_t sampling_freq_hz,
64                         int rate, int packet_size, int extra_byte);
65
66  void Run(TestPack* channel);
67  void OpenOutFile(int test_number);
68  void DisplaySendReceiveCodec();
69
70  int test_mode_;
71  scoped_ptr<AudioCodingModule> acm_a_;
72  scoped_ptr<AudioCodingModule> acm_b_;
73  TestPack* channel_a_to_b_;
74  PCMFile infile_a_;
75  PCMFile outfile_b_;
76  int test_count_;
77  uint16_t packet_size_samples_;
78  uint16_t packet_size_bytes_;
79};
80
81}  // namespace webrtc
82
83#endif  // WEBRTC_MODULES_AUDIO_CODING_MAIN_TEST_TESTALLCODECS_H_
Note: See TracBrowser for help on using the repository browser.