henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016 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 Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #include "modules/audio_coding/neteq/tools/neteq_test.h" |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 12 | |
Ivo Creusen | 2db46b0 | 2018-12-14 16:49:12 +0100 | [diff] [blame] | 13 | #include <iomanip> |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 14 | #include <iostream> |
| 15 | |
Ivo Creusen | 2db46b0 | 2018-12-14 16:49:12 +0100 | [diff] [blame] | 16 | #include "modules/rtp_rtcp/source/byte_io.h" |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 17 | |
| 18 | namespace webrtc { |
| 19 | namespace test { |
Ivo Creusen | 55de08e | 2018-09-03 11:49:27 +0200 | [diff] [blame] | 20 | namespace { |
| 21 | |
| 22 | absl::optional<Operations> ActionToOperations( |
| 23 | absl::optional<NetEqSimulator::Action> a) { |
| 24 | if (!a) { |
| 25 | return absl::nullopt; |
| 26 | } |
| 27 | switch (*a) { |
| 28 | case NetEqSimulator::Action::kAccelerate: |
| 29 | return absl::make_optional(kAccelerate); |
| 30 | case NetEqSimulator::Action::kExpand: |
| 31 | return absl::make_optional(kExpand); |
| 32 | case NetEqSimulator::Action::kNormal: |
| 33 | return absl::make_optional(kNormal); |
| 34 | case NetEqSimulator::Action::kPreemptiveExpand: |
| 35 | return absl::make_optional(kPreemptiveExpand); |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | } // namespace |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 40 | |
| 41 | void DefaultNetEqTestErrorCallback::OnInsertPacketError( |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 42 | const NetEqInput::PacketData& packet) { |
Henrik Lundin | c417d9e | 2017-06-14 12:29:03 +0200 | [diff] [blame] | 43 | std::cerr << "InsertPacket returned an error." << std::endl; |
henrik.lundin | 7a38fd2 | 2017-04-28 01:35:53 -0700 | [diff] [blame] | 44 | std::cerr << "Packet data: " << packet.ToString() << std::endl; |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 45 | FATAL(); |
| 46 | } |
| 47 | |
Henrik Lundin | c417d9e | 2017-06-14 12:29:03 +0200 | [diff] [blame] | 48 | void DefaultNetEqTestErrorCallback::OnGetAudioError() { |
| 49 | std::cerr << "GetAudio returned an error." << std::endl; |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 50 | FATAL(); |
| 51 | } |
| 52 | |
| 53 | NetEqTest::NetEqTest(const NetEq::Config& config, |
Niels Möller | 3f651d8 | 2018-12-19 15:06:17 +0100 | [diff] [blame] | 54 | rtc::scoped_refptr<AudioDecoderFactory> decoder_factory, |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 55 | const DecoderMap& codecs, |
Ivo Creusen | 2db46b0 | 2018-12-14 16:49:12 +0100 | [diff] [blame] | 56 | std::unique_ptr<std::ofstream> text_log, |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 57 | std::unique_ptr<NetEqInput> input, |
| 58 | std::unique_ptr<AudioSink> output, |
henrik.lundin | 02739d9 | 2017-05-04 06:09:06 -0700 | [diff] [blame] | 59 | Callbacks callbacks) |
Niels Möller | 3f651d8 | 2018-12-19 15:06:17 +0100 | [diff] [blame] | 60 | : neteq_(NetEq::Create(config, decoder_factory)), |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 61 | input_(std::move(input)), |
| 62 | output_(std::move(output)), |
henrik.lundin | 02739d9 | 2017-05-04 06:09:06 -0700 | [diff] [blame] | 63 | callbacks_(callbacks), |
Ivo Creusen | 2db46b0 | 2018-12-14 16:49:12 +0100 | [diff] [blame] | 64 | sample_rate_hz_(config.sample_rate_hz), |
| 65 | text_log_(std::move(text_log)) { |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 66 | RTC_CHECK(!config.enable_muted_state) |
| 67 | << "The code does not handle enable_muted_state"; |
| 68 | RegisterDecoders(codecs); |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 69 | } |
| 70 | |
Mirko Bonadei | 682aac5 | 2018-07-20 13:59:20 +0200 | [diff] [blame] | 71 | NetEqTest::~NetEqTest() = default; |
| 72 | |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 73 | int64_t NetEqTest::Run() { |
Ivo Creusen | 55de08e | 2018-09-03 11:49:27 +0200 | [diff] [blame] | 74 | int64_t simulation_time = 0; |
| 75 | SimulationStepResult step_result; |
| 76 | do { |
| 77 | step_result = RunToNextGetAudio(); |
| 78 | simulation_time += step_result.simulation_step_ms; |
| 79 | } while (!step_result.is_simulation_finished); |
| 80 | if (callbacks_.simulation_ended_callback) { |
| 81 | callbacks_.simulation_ended_callback->SimulationEnded(simulation_time); |
| 82 | } |
| 83 | return simulation_time; |
| 84 | } |
| 85 | |
| 86 | NetEqTest::SimulationStepResult NetEqTest::RunToNextGetAudio() { |
| 87 | SimulationStepResult result; |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 88 | const int64_t start_time_ms = *input_->NextEventTime(); |
| 89 | int64_t time_now_ms = start_time_ms; |
Ivo Creusen | 4384f53 | 2018-09-07 17:19:56 +0200 | [diff] [blame] | 90 | current_state_.packet_iat_ms.clear(); |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 91 | |
| 92 | while (!input_->ended()) { |
| 93 | // Advance time to next event. |
| 94 | RTC_DCHECK(input_->NextEventTime()); |
| 95 | time_now_ms = *input_->NextEventTime(); |
| 96 | // Check if it is time to insert packet. |
| 97 | if (input_->NextPacketTime() && time_now_ms >= *input_->NextPacketTime()) { |
| 98 | std::unique_ptr<NetEqInput::PacketData> packet_data = input_->PopPacket(); |
| 99 | RTC_CHECK(packet_data); |
Minyue Li | 1a80018 | 2018-09-12 12:52:48 +0200 | [diff] [blame] | 100 | const size_t payload_data_length = |
| 101 | packet_data->payload.size() - packet_data->header.paddingLength; |
| 102 | if (payload_data_length != 0) { |
| 103 | int error = neteq_->InsertPacket( |
| 104 | packet_data->header, |
| 105 | rtc::ArrayView<const uint8_t>(packet_data->payload), |
| 106 | static_cast<uint32_t>(packet_data->time_ms * sample_rate_hz_ / |
| 107 | 1000)); |
| 108 | if (error != NetEq::kOK && callbacks_.error_callback) { |
| 109 | callbacks_.error_callback->OnInsertPacketError(*packet_data); |
| 110 | } |
| 111 | if (callbacks_.post_insert_packet) { |
| 112 | callbacks_.post_insert_packet->AfterInsertPacket(*packet_data, |
| 113 | neteq_.get()); |
| 114 | } |
| 115 | } else { |
| 116 | neteq_->InsertEmptyPacket(packet_data->header); |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 117 | } |
Ivo Creusen | 4384f53 | 2018-09-07 17:19:56 +0200 | [diff] [blame] | 118 | if (last_packet_time_ms_) { |
| 119 | current_state_.packet_iat_ms.push_back(time_now_ms - |
| 120 | *last_packet_time_ms_); |
| 121 | } |
Ivo Creusen | 2db46b0 | 2018-12-14 16:49:12 +0100 | [diff] [blame] | 122 | if (text_log_) { |
| 123 | const auto ops_state = neteq_->GetOperationsAndState(); |
| 124 | const auto delta_wallclock = |
| 125 | last_packet_time_ms_ ? (time_now_ms - *last_packet_time_ms_) : -1; |
| 126 | const auto delta_timestamp = |
| 127 | last_packet_timestamp_ |
| 128 | ? (static_cast<int64_t>(packet_data->header.timestamp) - |
| 129 | *last_packet_timestamp_) * |
| 130 | 1000 / sample_rate_hz_ |
| 131 | : -1; |
| 132 | const auto packet_size_bytes = |
| 133 | packet_data->payload.size() == 12 |
| 134 | ? ByteReader<uint32_t>::ReadLittleEndian( |
| 135 | &packet_data->payload[8]) |
| 136 | : -1; |
| 137 | *text_log_ << "Packet - wallclock: " << std::setw(5) << time_now_ms |
| 138 | << ", delta wc: " << std::setw(4) << delta_wallclock |
| 139 | << ", timestamp: " << std::setw(10) |
| 140 | << packet_data->header.timestamp |
| 141 | << ", delta ts: " << std::setw(4) << delta_timestamp |
| 142 | << ", size: " << std::setw(5) << packet_size_bytes |
| 143 | << ", frame size: " << std::setw(3) |
| 144 | << ops_state.current_frame_size_ms |
| 145 | << ", buffer size: " << std::setw(4) |
| 146 | << ops_state.current_buffer_size_ms << std::endl; |
| 147 | } |
Ivo Creusen | 4384f53 | 2018-09-07 17:19:56 +0200 | [diff] [blame] | 148 | last_packet_time_ms_ = absl::make_optional<int>(time_now_ms); |
Ivo Creusen | 2db46b0 | 2018-12-14 16:49:12 +0100 | [diff] [blame] | 149 | last_packet_timestamp_ = |
| 150 | absl::make_optional<uint32_t>(packet_data->header.timestamp); |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 151 | } |
| 152 | |
| 153 | // Check if it is time to get output audio. |
| 154 | if (input_->NextOutputEventTime() && |
| 155 | time_now_ms >= *input_->NextOutputEventTime()) { |
henrik.lundin | 02739d9 | 2017-05-04 06:09:06 -0700 | [diff] [blame] | 156 | if (callbacks_.get_audio_callback) { |
| 157 | callbacks_.get_audio_callback->BeforeGetAudio(neteq_.get()); |
| 158 | } |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 159 | AudioFrame out_frame; |
| 160 | bool muted; |
Ivo Creusen | 55de08e | 2018-09-03 11:49:27 +0200 | [diff] [blame] | 161 | int error = neteq_->GetAudio(&out_frame, &muted, |
| 162 | ActionToOperations(next_action_)); |
| 163 | next_action_ = absl::nullopt; |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 164 | RTC_CHECK(!muted) << "The code does not handle enable_muted_state"; |
| 165 | if (error != NetEq::kOK) { |
henrik.lundin | 02739d9 | 2017-05-04 06:09:06 -0700 | [diff] [blame] | 166 | if (callbacks_.error_callback) { |
Henrik Lundin | c417d9e | 2017-06-14 12:29:03 +0200 | [diff] [blame] | 167 | callbacks_.error_callback->OnGetAudioError(); |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 168 | } |
| 169 | } else { |
| 170 | sample_rate_hz_ = out_frame.sample_rate_hz_; |
| 171 | } |
henrik.lundin | 02739d9 | 2017-05-04 06:09:06 -0700 | [diff] [blame] | 172 | if (callbacks_.get_audio_callback) { |
| 173 | callbacks_.get_audio_callback->AfterGetAudio(time_now_ms, out_frame, |
| 174 | muted, neteq_.get()); |
| 175 | } |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 176 | |
| 177 | if (output_) { |
| 178 | RTC_CHECK(output_->WriteArray( |
yujo | 36b1a5f | 2017-06-12 12:45:32 -0700 | [diff] [blame] | 179 | out_frame.data(), |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 180 | out_frame.samples_per_channel_ * out_frame.num_channels_)); |
| 181 | } |
| 182 | |
| 183 | input_->AdvanceOutputEvent(); |
Henrik Lundin | 9be7745 | 2018-09-10 12:53:27 +0200 | [diff] [blame] | 184 | result.simulation_step_ms = |
| 185 | input_->NextEventTime().value_or(time_now_ms) - start_time_ms; |
Ivo Creusen | d1c2f78 | 2018-09-13 14:39:55 +0200 | [diff] [blame] | 186 | const auto operations_state = neteq_->GetOperationsAndState(); |
| 187 | current_state_.current_delay_ms = operations_state.current_buffer_size_ms; |
Ivo Creusen | dc6d553 | 2018-09-27 11:43:42 +0200 | [diff] [blame] | 188 | current_state_.packet_size_ms = operations_state.current_frame_size_ms; |
| 189 | current_state_.next_packet_available = |
| 190 | operations_state.next_packet_available; |
| 191 | current_state_.packet_buffer_flushed = |
| 192 | operations_state.packet_buffer_flushes > |
| 193 | prev_ops_state_.packet_buffer_flushes; |
Ivo Creusen | d1c2f78 | 2018-09-13 14:39:55 +0200 | [diff] [blame] | 194 | // TODO(ivoc): Add more accurate reporting by tracking the origin of |
| 195 | // samples in the sync buffer. |
| 196 | result.action_times_ms[Action::kExpand] = 0; |
| 197 | result.action_times_ms[Action::kAccelerate] = 0; |
| 198 | result.action_times_ms[Action::kPreemptiveExpand] = 0; |
| 199 | result.action_times_ms[Action::kNormal] = 0; |
| 200 | |
| 201 | if (out_frame.speech_type_ == AudioFrame::SpeechType::kPLC || |
| 202 | out_frame.speech_type_ == AudioFrame::SpeechType::kPLCCNG) { |
| 203 | // Consider the whole frame to be the result of expansion. |
| 204 | result.action_times_ms[Action::kExpand] = 10; |
| 205 | } else if (operations_state.accelerate_samples - |
| 206 | prev_ops_state_.accelerate_samples > |
| 207 | 0) { |
| 208 | // Consider the whole frame to be the result of acceleration. |
| 209 | result.action_times_ms[Action::kAccelerate] = 10; |
| 210 | } else if (operations_state.preemptive_samples - |
| 211 | prev_ops_state_.preemptive_samples > |
| 212 | 0) { |
| 213 | // Consider the whole frame to be the result of preemptive expansion. |
| 214 | result.action_times_ms[Action::kPreemptiveExpand] = 10; |
| 215 | } else { |
| 216 | // Consider the whole frame to be the result of normal playout. |
| 217 | result.action_times_ms[Action::kNormal] = 10; |
| 218 | } |
Ivo Creusen | 2db46b0 | 2018-12-14 16:49:12 +0100 | [diff] [blame] | 219 | auto lifetime_stats = LifetimeStats(); |
| 220 | if (text_log_) { |
| 221 | const bool plc = |
| 222 | (out_frame.speech_type_ == AudioFrame::SpeechType::kPLC) || |
| 223 | (out_frame.speech_type_ == AudioFrame::SpeechType::kPLCCNG); |
| 224 | const bool cng = out_frame.speech_type_ == AudioFrame::SpeechType::kCNG; |
| 225 | const bool voice_concealed = |
| 226 | lifetime_stats.voice_concealed_samples > |
| 227 | prev_lifetime_stats_.voice_concealed_samples; |
| 228 | *text_log_ << "GetAudio - wallclock: " << std::setw(5) << time_now_ms |
| 229 | << ", delta wc: " << std::setw(4) |
| 230 | << (input_->NextEventTime().value_or(time_now_ms) - |
| 231 | start_time_ms) |
| 232 | << ", CNG: " << cng << ", PLC: " << plc |
| 233 | << ", voice concealed: " << voice_concealed |
| 234 | << ", buffer size: " << std::setw(4) |
| 235 | << current_state_.current_delay_ms << std::endl; |
| 236 | if (operations_state.discarded_primary_packets > |
| 237 | prev_ops_state_.discarded_primary_packets) { |
| 238 | *text_log_ << "Discarded " |
| 239 | << (operations_state.discarded_primary_packets - |
| 240 | prev_ops_state_.discarded_primary_packets) |
| 241 | << " primary packets." << std::endl; |
| 242 | } |
| 243 | if (operations_state.packet_buffer_flushes > |
| 244 | prev_ops_state_.packet_buffer_flushes) { |
| 245 | *text_log_ << "Flushed packet buffer " |
| 246 | << (operations_state.packet_buffer_flushes - |
| 247 | prev_ops_state_.packet_buffer_flushes) |
| 248 | << " times." << std::endl; |
| 249 | } |
| 250 | } |
| 251 | prev_lifetime_stats_ = lifetime_stats; |
Ivo Creusen | 55de08e | 2018-09-03 11:49:27 +0200 | [diff] [blame] | 252 | result.is_simulation_finished = input_->ended(); |
Ivo Creusen | d1c2f78 | 2018-09-13 14:39:55 +0200 | [diff] [blame] | 253 | prev_ops_state_ = operations_state; |
Ivo Creusen | 55de08e | 2018-09-03 11:49:27 +0200 | [diff] [blame] | 254 | return result; |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 255 | } |
| 256 | } |
Henrik Lundin | 9be7745 | 2018-09-10 12:53:27 +0200 | [diff] [blame] | 257 | result.simulation_step_ms = |
| 258 | input_->NextEventTime().value_or(time_now_ms) - start_time_ms; |
Ivo Creusen | 55de08e | 2018-09-03 11:49:27 +0200 | [diff] [blame] | 259 | result.is_simulation_finished = true; |
| 260 | return result; |
| 261 | } |
| 262 | |
| 263 | void NetEqTest::SetNextAction(NetEqTest::Action next_operation) { |
| 264 | next_action_ = absl::optional<Action>(next_operation); |
| 265 | } |
| 266 | |
| 267 | NetEqTest::NetEqState NetEqTest::GetNetEqState() { |
Ivo Creusen | 4384f53 | 2018-09-07 17:19:56 +0200 | [diff] [blame] | 268 | return current_state_; |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 269 | } |
| 270 | |
| 271 | NetEqNetworkStatistics NetEqTest::SimulationStats() { |
| 272 | NetEqNetworkStatistics stats; |
| 273 | RTC_CHECK_EQ(neteq_->NetworkStatistics(&stats), 0); |
| 274 | return stats; |
| 275 | } |
| 276 | |
Alex Narest | 7ff6ca5 | 2018-02-07 18:46:33 +0100 | [diff] [blame] | 277 | NetEqLifetimeStatistics NetEqTest::LifetimeStats() const { |
| 278 | return neteq_->GetLifetimeStatistics(); |
| 279 | } |
| 280 | |
Henrik Lundin | 7687ad5 | 2018-07-02 10:14:46 +0200 | [diff] [blame] | 281 | NetEqTest::DecoderMap NetEqTest::StandardDecoderMap() { |
| 282 | DecoderMap codecs = { |
Niels Möller | 0554368 | 2019-01-10 16:55:06 +0100 | [diff] [blame] | 283 | {0, SdpAudioFormat("pcmu", 8000, 1)}, |
| 284 | {8, SdpAudioFormat("pcma", 8000, 1)}, |
Henrik Lundin | 7687ad5 | 2018-07-02 10:14:46 +0200 | [diff] [blame] | 285 | #ifdef WEBRTC_CODEC_ILBC |
Niels Möller | 0554368 | 2019-01-10 16:55:06 +0100 | [diff] [blame] | 286 | {102, SdpAudioFormat("ilbc", 8000, 1)}, |
Henrik Lundin | 7687ad5 | 2018-07-02 10:14:46 +0200 | [diff] [blame] | 287 | #endif |
Niels Möller | 0554368 | 2019-01-10 16:55:06 +0100 | [diff] [blame] | 288 | {103, SdpAudioFormat("isac", 16000, 1)}, |
Henrik Lundin | 7687ad5 | 2018-07-02 10:14:46 +0200 | [diff] [blame] | 289 | #if !defined(WEBRTC_ANDROID) |
Niels Möller | 0554368 | 2019-01-10 16:55:06 +0100 | [diff] [blame] | 290 | {104, SdpAudioFormat("isac", 32000, 1)}, |
Henrik Lundin | 7687ad5 | 2018-07-02 10:14:46 +0200 | [diff] [blame] | 291 | #endif |
| 292 | #ifdef WEBRTC_CODEC_OPUS |
Niels Möller | 0554368 | 2019-01-10 16:55:06 +0100 | [diff] [blame] | 293 | {111, SdpAudioFormat("opus", 48000, 2)}, |
Henrik Lundin | 7687ad5 | 2018-07-02 10:14:46 +0200 | [diff] [blame] | 294 | #endif |
Niels Möller | 0554368 | 2019-01-10 16:55:06 +0100 | [diff] [blame] | 295 | {93, SdpAudioFormat("l16", 8000, 1)}, |
| 296 | {94, SdpAudioFormat("l16", 16000, 1)}, |
| 297 | {95, SdpAudioFormat("l16", 32000, 1)}, |
| 298 | {96, SdpAudioFormat("l16", 48000, 1)}, |
| 299 | {9, SdpAudioFormat("g722", 8000, 1)}, |
| 300 | {106, SdpAudioFormat("telephone-event", 8000, 1)}, |
| 301 | {114, SdpAudioFormat("telephone-event", 16000, 1)}, |
| 302 | {115, SdpAudioFormat("telephone-event", 32000, 1)}, |
| 303 | {116, SdpAudioFormat("telephone-event", 48000, 1)}, |
| 304 | {117, SdpAudioFormat("red", 8000, 1)}, |
| 305 | {13, SdpAudioFormat("cn", 8000, 1)}, |
| 306 | {98, SdpAudioFormat("cn", 16000, 1)}, |
| 307 | {99, SdpAudioFormat("cn", 32000, 1)}, |
| 308 | {100, SdpAudioFormat("cn", 48000, 1)} |
Henrik Lundin | 7687ad5 | 2018-07-02 10:14:46 +0200 | [diff] [blame] | 309 | }; |
| 310 | return codecs; |
| 311 | } |
| 312 | |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 313 | void NetEqTest::RegisterDecoders(const DecoderMap& codecs) { |
| 314 | for (const auto& c : codecs) { |
Niels Möller | 0554368 | 2019-01-10 16:55:06 +0100 | [diff] [blame] | 315 | RTC_CHECK(neteq_->RegisterPayloadType(c.first, c.second)) |
| 316 | << "Cannot register " << c.second.name << " to payload type " |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 317 | << c.first; |
| 318 | } |
| 319 | } |
| 320 | |
henrik.lundin | e8a77e3 | 2016-06-22 06:34:03 -0700 | [diff] [blame] | 321 | } // namespace test |
| 322 | } // namespace webrtc |