OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 while (!input_->ended()) { | 64 while (!input_->ended()) { |
65 // Advance time to next event. | 65 // Advance time to next event. |
66 RTC_DCHECK(input_->NextEventTime()); | 66 RTC_DCHECK(input_->NextEventTime()); |
67 time_now_ms = *input_->NextEventTime(); | 67 time_now_ms = *input_->NextEventTime(); |
68 // Check if it is time to insert packet. | 68 // Check if it is time to insert packet. |
69 if (input_->NextPacketTime() && time_now_ms >= *input_->NextPacketTime()) { | 69 if (input_->NextPacketTime() && time_now_ms >= *input_->NextPacketTime()) { |
70 std::unique_ptr<NetEqInput::PacketData> packet_data = input_->PopPacket(); | 70 std::unique_ptr<NetEqInput::PacketData> packet_data = input_->PopPacket(); |
71 RTC_CHECK(packet_data); | 71 RTC_CHECK(packet_data); |
72 int error = neteq_->InsertPacket( | 72 int error = neteq_->InsertPacket( |
73 packet_data->header.header, | 73 packet_data->header, |
74 rtc::ArrayView<const uint8_t>(packet_data->payload), | 74 rtc::ArrayView<const uint8_t>(packet_data->payload), |
75 static_cast<uint32_t>(packet_data->time_ms * sample_rate_hz_ / 1000)); | 75 static_cast<uint32_t>(packet_data->time_ms * sample_rate_hz_ / 1000)); |
76 if (error != NetEq::kOK && error_callback_) { | 76 if (error != NetEq::kOK && error_callback_) { |
77 error_callback_->OnInsertPacketError(neteq_->LastError(), *packet_data); | 77 error_callback_->OnInsertPacketError(neteq_->LastError(), *packet_data); |
78 } | 78 } |
79 } | 79 } |
80 | 80 |
81 // Check if it is time to get output audio. | 81 // Check if it is time to get output audio. |
82 if (input_->NextOutputEventTime() && | 82 if (input_->NextOutputEventTime() && |
83 time_now_ms >= *input_->NextOutputEventTime()) { | 83 time_now_ms >= *input_->NextOutputEventTime()) { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 neteq_->RegisterExternalDecoder(c.second.decoder, c.second.codec, | 127 neteq_->RegisterExternalDecoder(c.second.decoder, c.second.codec, |
128 c.second.codec_name, c.first), | 128 c.second.codec_name, c.first), |
129 NetEq::kOK) | 129 NetEq::kOK) |
130 << "Cannot register " << c.second.codec_name << " to payload type " | 130 << "Cannot register " << c.second.codec_name << " to payload type " |
131 << c.first; | 131 << c.first; |
132 } | 132 } |
133 } | 133 } |
134 | 134 |
135 } // namespace test | 135 } // namespace test |
136 } // namespace webrtc | 136 } // namespace webrtc |
OLD | NEW |