OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_NETEQ_QUALITY_TEST_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_NETEQ_QUALITY_TEST_H_ |
12 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_NETEQ_QUALITY_TEST_H_ | 12 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_NETEQ_QUALITY_TEST_H_ |
13 | 13 |
14 #include <fstream> | 14 #include <fstream> |
15 #include <memory> | 15 #include <memory> |
16 #include <gflags/gflags.h> | 16 #include <gflags/gflags.h> |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 #include "webrtc/modules/audio_coding/neteq/include/neteq.h" | 18 #include "webrtc/modules/audio_coding/neteq/include/neteq.h" |
19 #include "webrtc/modules/audio_coding/neteq/tools/audio_sink.h" | 19 #include "webrtc/modules/audio_coding/neteq/tools/audio_sink.h" |
20 #include "webrtc/modules/audio_coding/neteq/tools/input_audio_file.h" | 20 #include "webrtc/modules/audio_coding/neteq/tools/input_audio_file.h" |
21 #include "webrtc/modules/audio_coding/neteq/tools/rtp_generator.h" | 21 #include "webrtc/modules/audio_coding/neteq/tools/rtp_generator.h" |
| 22 #include "webrtc/modules/include/module_common_types.h" |
22 #include "webrtc/typedefs.h" | 23 #include "webrtc/typedefs.h" |
23 | 24 |
24 using google::RegisterFlagValidator; | 25 using google::RegisterFlagValidator; |
25 | 26 |
26 namespace webrtc { | 27 namespace webrtc { |
27 namespace test { | 28 namespace test { |
28 | 29 |
29 class LossModel { | 30 class LossModel { |
30 public: | 31 public: |
31 virtual ~LossModel() {}; | 32 virtual ~LossModel() {}; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 int decodable_time_ms_; | 107 int decodable_time_ms_; |
107 double drift_factor_; | 108 double drift_factor_; |
108 int packet_loss_rate_; | 109 int packet_loss_rate_; |
109 const int block_duration_ms_; | 110 const int block_duration_ms_; |
110 const int in_sampling_khz_; | 111 const int in_sampling_khz_; |
111 const int out_sampling_khz_; | 112 const int out_sampling_khz_; |
112 | 113 |
113 // Number of samples per channel in a frame. | 114 // Number of samples per channel in a frame. |
114 const size_t in_size_samples_; | 115 const size_t in_size_samples_; |
115 | 116 |
116 // Expected output number of samples per channel in a frame. | |
117 const size_t out_size_samples_; | |
118 | |
119 size_t payload_size_bytes_; | 117 size_t payload_size_bytes_; |
120 size_t max_payload_bytes_; | 118 size_t max_payload_bytes_; |
121 | 119 |
122 std::unique_ptr<InputAudioFile> in_file_; | 120 std::unique_ptr<InputAudioFile> in_file_; |
123 std::unique_ptr<AudioSink> output_; | 121 std::unique_ptr<AudioSink> output_; |
124 std::ofstream log_file_; | 122 std::ofstream log_file_; |
125 | 123 |
126 std::unique_ptr<RtpGenerator> rtp_generator_; | 124 std::unique_ptr<RtpGenerator> rtp_generator_; |
127 std::unique_ptr<NetEq> neteq_; | 125 std::unique_ptr<NetEq> neteq_; |
128 std::unique_ptr<LossModel> loss_model_; | 126 std::unique_ptr<LossModel> loss_model_; |
129 | 127 |
130 std::unique_ptr<int16_t[]> in_data_; | 128 std::unique_ptr<int16_t[]> in_data_; |
131 rtc::Buffer payload_; | 129 rtc::Buffer payload_; |
132 std::unique_ptr<int16_t[]> out_data_; | 130 AudioFrame out_frame_; |
133 WebRtcRTPHeader rtp_header_; | 131 WebRtcRTPHeader rtp_header_; |
134 | 132 |
135 size_t total_payload_size_bytes_; | 133 size_t total_payload_size_bytes_; |
136 }; | 134 }; |
137 | 135 |
138 } // namespace test | 136 } // namespace test |
139 } // namespace webrtc | 137 } // namespace webrtc |
140 | 138 |
141 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_NETEQ_QUALITY_TEST_H_ | 139 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_TOOLS_NETEQ_QUALITY_TEST_H_ |
OLD | NEW |