Revert of Change NetEq::InsertPacket to take an RTPHeader (patchset #2 id:20001 of https://codereview.webrtc.org/2807273004/ )
Reason for revert:
Broke downstream dependencies.
Original issue's description:
> Change NetEq::InsertPacket to take an RTPHeader
>
> It used to take a WebRtcRTPHeader as input, which has an RTPHeader as
> a member. None of the other member in WebRtcRTPHeader where used in
> NetEq.
>
> This CL adapts the production code; tests and tools will be converted
> in a follow-up CL.
>
> BUG=webrtc:7467
>
> Review-Url: https://codereview.webrtc.org/2807273004
> Cr-Commit-Position: refs/heads/master@{#17652}
> Committed: 4d027576a6
TBR=ivoc@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:7467
Review-Url: https://codereview.webrtc.org/2812933002
Cr-Commit-Position: refs/heads/master@{#17657}
This commit is contained in:
committed by
Commit bot
parent
80ff00cd2b
commit
10d095d4f7
@ -324,13 +324,12 @@ void NetEqDecodingTest::Process() {
|
||||
// Ignore payload type 104 (iSAC-swb) if ISAC is not supported.
|
||||
if (rtp_header.header.payloadType != 104)
|
||||
#endif
|
||||
ASSERT_EQ(0,
|
||||
neteq_->InsertPacket(
|
||||
rtp_header.header,
|
||||
rtc::ArrayView<const uint8_t>(
|
||||
packet_->payload(), packet_->payload_length_bytes()),
|
||||
static_cast<uint32_t>(packet_->time_ms() *
|
||||
(output_sample_rate_ / 1000))));
|
||||
ASSERT_EQ(0, neteq_->InsertPacket(
|
||||
rtp_header,
|
||||
rtc::ArrayView<const uint8_t>(
|
||||
packet_->payload(), packet_->payload_length_bytes()),
|
||||
static_cast<uint32_t>(packet_->time_ms() *
|
||||
(output_sample_rate_ / 1000))));
|
||||
}
|
||||
// Get next packet.
|
||||
packet_ = rtp_source_->NextPacket();
|
||||
@ -527,7 +526,7 @@ TEST_F(NetEqDecodingTestFaxMode, TestFrameWaitingTimeStatistics) {
|
||||
rtp_info.header.ssrc = 0x1234; // Just an arbitrary SSRC.
|
||||
rtp_info.header.payloadType = 94; // PCM16b WB codec.
|
||||
rtp_info.header.markerBit = 0;
|
||||
ASSERT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload, 0));
|
||||
ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, 0));
|
||||
}
|
||||
// Pull out all data.
|
||||
for (size_t i = 0; i < num_frames; ++i) {
|
||||
@ -568,7 +567,7 @@ TEST_F(NetEqDecodingTest, TestAverageInterArrivalTimeNegative) {
|
||||
uint8_t payload[kPayloadBytes] = {0};
|
||||
WebRtcRTPHeader rtp_info;
|
||||
PopulateRtpInfo(frame_index, frame_index * kSamples, &rtp_info);
|
||||
ASSERT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload, 0));
|
||||
ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, 0));
|
||||
++frame_index;
|
||||
}
|
||||
|
||||
@ -596,7 +595,7 @@ TEST_F(NetEqDecodingTest, TestAverageInterArrivalTimePositive) {
|
||||
uint8_t payload[kPayloadBytes] = {0};
|
||||
WebRtcRTPHeader rtp_info;
|
||||
PopulateRtpInfo(frame_index, frame_index * kSamples, &rtp_info);
|
||||
ASSERT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload, 0));
|
||||
ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, 0));
|
||||
++frame_index;
|
||||
}
|
||||
|
||||
@ -634,7 +633,7 @@ void NetEqDecodingTest::LongCngWithClockDrift(double drift_factor,
|
||||
uint8_t payload[kPayloadBytes] = {0};
|
||||
WebRtcRTPHeader rtp_info;
|
||||
PopulateRtpInfo(seq_no, timestamp, &rtp_info);
|
||||
ASSERT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload, 0));
|
||||
ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, 0));
|
||||
++seq_no;
|
||||
timestamp += kSamples;
|
||||
next_input_time_ms += static_cast<double>(kFrameSizeMs) * drift_factor;
|
||||
@ -662,7 +661,7 @@ void NetEqDecodingTest::LongCngWithClockDrift(double drift_factor,
|
||||
WebRtcRTPHeader rtp_info;
|
||||
PopulateCng(seq_no, timestamp, &rtp_info, payload, &payload_len);
|
||||
ASSERT_EQ(0, neteq_->InsertPacket(
|
||||
rtp_info.header,
|
||||
rtp_info,
|
||||
rtc::ArrayView<const uint8_t>(payload, payload_len), 0));
|
||||
++seq_no;
|
||||
timestamp += kCngPeriodSamples;
|
||||
@ -705,7 +704,7 @@ void NetEqDecodingTest::LongCngWithClockDrift(double drift_factor,
|
||||
WebRtcRTPHeader rtp_info;
|
||||
PopulateCng(seq_no, timestamp, &rtp_info, payload, &payload_len);
|
||||
ASSERT_EQ(0, neteq_->InsertPacket(
|
||||
rtp_info.header,
|
||||
rtp_info,
|
||||
rtc::ArrayView<const uint8_t>(payload, payload_len), 0));
|
||||
++seq_no;
|
||||
timestamp += kCngPeriodSamples;
|
||||
@ -722,7 +721,7 @@ void NetEqDecodingTest::LongCngWithClockDrift(double drift_factor,
|
||||
uint8_t payload[kPayloadBytes] = {0};
|
||||
WebRtcRTPHeader rtp_info;
|
||||
PopulateRtpInfo(seq_no, timestamp, &rtp_info);
|
||||
ASSERT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload, 0));
|
||||
ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, 0));
|
||||
++seq_no;
|
||||
timestamp += kSamples;
|
||||
next_input_time_ms += kFrameSizeMs * drift_factor;
|
||||
@ -834,7 +833,7 @@ TEST_F(NetEqDecodingTest, UnknownPayloadType) {
|
||||
WebRtcRTPHeader rtp_info;
|
||||
PopulateRtpInfo(0, 0, &rtp_info);
|
||||
rtp_info.header.payloadType = 1; // Not registered as a decoder.
|
||||
EXPECT_EQ(NetEq::kFail, neteq_->InsertPacket(rtp_info.header, payload, 0));
|
||||
EXPECT_EQ(NetEq::kFail, neteq_->InsertPacket(rtp_info, payload, 0));
|
||||
EXPECT_EQ(NetEq::kUnknownRtpPayloadType, neteq_->LastError());
|
||||
}
|
||||
|
||||
@ -850,7 +849,7 @@ TEST_F(NetEqDecodingTest, MAYBE_DecoderError) {
|
||||
WebRtcRTPHeader rtp_info;
|
||||
PopulateRtpInfo(0, 0, &rtp_info);
|
||||
rtp_info.header.payloadType = 103; // iSAC, but the payload is invalid.
|
||||
EXPECT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload, 0));
|
||||
EXPECT_EQ(0, neteq_->InsertPacket(rtp_info, payload, 0));
|
||||
// Set all of |out_data_| to 1, and verify that it was set to 0 by the call
|
||||
// to GetAudio.
|
||||
for (size_t i = 0; i < AudioFrame::kMaxDataSizeSamples; ++i) {
|
||||
@ -957,10 +956,9 @@ class NetEqBgnTest : public NetEqDecodingTest {
|
||||
WebRtcPcm16b_Encode(block.data(), block.size(), payload);
|
||||
ASSERT_EQ(enc_len_bytes, expected_samples_per_channel * 2);
|
||||
|
||||
ASSERT_EQ(0, neteq_->InsertPacket(
|
||||
rtp_info.header,
|
||||
rtc::ArrayView<const uint8_t>(payload, enc_len_bytes),
|
||||
receive_timestamp));
|
||||
ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, rtc::ArrayView<const uint8_t>(
|
||||
payload, enc_len_bytes),
|
||||
receive_timestamp));
|
||||
output.Reset();
|
||||
ASSERT_EQ(0, neteq_->GetAudio(&output, &muted));
|
||||
ASSERT_EQ(1u, output.num_channels_);
|
||||
@ -1094,8 +1092,8 @@ void NetEqDecodingTest::WrapTest(uint16_t start_seq_no,
|
||||
PopulateRtpInfo(seq_no, timestamp, &rtp_info);
|
||||
if (drop_seq_numbers.find(seq_no) == drop_seq_numbers.end()) {
|
||||
// This sequence number was not in the set to drop. Insert it.
|
||||
ASSERT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload,
|
||||
receive_timestamp));
|
||||
ASSERT_EQ(0,
|
||||
neteq_->InsertPacket(rtp_info, payload, receive_timestamp));
|
||||
++packets_inserted;
|
||||
}
|
||||
NetEqNetworkStatistics network_stats;
|
||||
@ -1183,7 +1181,7 @@ void NetEqDecodingTest::DuplicateCng() {
|
||||
bool muted;
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
PopulateRtpInfo(seq_no, timestamp, &rtp_info);
|
||||
ASSERT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload, 0));
|
||||
ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, 0));
|
||||
++seq_no;
|
||||
timestamp += kSamples;
|
||||
|
||||
@ -1200,9 +1198,9 @@ void NetEqDecodingTest::DuplicateCng() {
|
||||
size_t payload_len;
|
||||
PopulateCng(seq_no, timestamp, &rtp_info, payload, &payload_len);
|
||||
// This is the first time this CNG packet is inserted.
|
||||
ASSERT_EQ(0, neteq_->InsertPacket(
|
||||
rtp_info.header,
|
||||
rtc::ArrayView<const uint8_t>(payload, payload_len), 0));
|
||||
ASSERT_EQ(
|
||||
0, neteq_->InsertPacket(
|
||||
rtp_info, rtc::ArrayView<const uint8_t>(payload, payload_len), 0));
|
||||
|
||||
// Pull audio once and make sure CNG is played.
|
||||
ASSERT_EQ(0, neteq_->GetAudio(&out_frame_, &muted));
|
||||
@ -1214,9 +1212,9 @@ void NetEqDecodingTest::DuplicateCng() {
|
||||
|
||||
// Insert the same CNG packet again. Note that at this point it is old, since
|
||||
// we have already decoded the first copy of it.
|
||||
ASSERT_EQ(0, neteq_->InsertPacket(
|
||||
rtp_info.header,
|
||||
rtc::ArrayView<const uint8_t>(payload, payload_len), 0));
|
||||
ASSERT_EQ(
|
||||
0, neteq_->InsertPacket(
|
||||
rtp_info, rtc::ArrayView<const uint8_t>(payload, payload_len), 0));
|
||||
|
||||
// Pull audio until we have played |kCngPeriodMs| of CNG. Start at 10 ms since
|
||||
// we have already pulled out CNG once.
|
||||
@ -1233,7 +1231,7 @@ void NetEqDecodingTest::DuplicateCng() {
|
||||
++seq_no;
|
||||
timestamp += kCngPeriodSamples;
|
||||
PopulateRtpInfo(seq_no, timestamp, &rtp_info);
|
||||
ASSERT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload, 0));
|
||||
ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, 0));
|
||||
|
||||
// Pull audio once and verify that the output is speech again.
|
||||
ASSERT_EQ(0, neteq_->GetAudio(&out_frame_, &muted));
|
||||
@ -1266,10 +1264,10 @@ TEST_F(NetEqDecodingTest, CngFirst) {
|
||||
WebRtcRTPHeader rtp_info;
|
||||
|
||||
PopulateCng(seq_no, timestamp, &rtp_info, payload, &payload_len);
|
||||
ASSERT_EQ(NetEq::kOK,
|
||||
neteq_->InsertPacket(
|
||||
rtp_info.header,
|
||||
rtc::ArrayView<const uint8_t>(payload, payload_len), 0));
|
||||
ASSERT_EQ(
|
||||
NetEq::kOK,
|
||||
neteq_->InsertPacket(
|
||||
rtp_info, rtc::ArrayView<const uint8_t>(payload, payload_len), 0));
|
||||
++seq_no;
|
||||
timestamp += kCngPeriodSamples;
|
||||
|
||||
@ -1285,7 +1283,7 @@ TEST_F(NetEqDecodingTest, CngFirst) {
|
||||
do {
|
||||
ASSERT_LT(timeout_counter++, 20) << "Test timed out";
|
||||
PopulateRtpInfo(seq_no, timestamp, &rtp_info);
|
||||
ASSERT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload, 0));
|
||||
ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, 0));
|
||||
++seq_no;
|
||||
timestamp += kSamples;
|
||||
|
||||
@ -1311,7 +1309,7 @@ class NetEqDecodingTestWithMutedState : public NetEqDecodingTest {
|
||||
uint8_t payload[kPayloadBytes] = {0};
|
||||
WebRtcRTPHeader rtp_info;
|
||||
PopulateRtpInfo(0, rtp_timestamp, &rtp_info);
|
||||
EXPECT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload, 0));
|
||||
EXPECT_EQ(0, neteq_->InsertPacket(rtp_info, payload, 0));
|
||||
}
|
||||
|
||||
void InsertCngPacket(uint32_t rtp_timestamp) {
|
||||
@ -1319,10 +1317,10 @@ class NetEqDecodingTestWithMutedState : public NetEqDecodingTest {
|
||||
WebRtcRTPHeader rtp_info;
|
||||
size_t payload_len;
|
||||
PopulateCng(0, rtp_timestamp, &rtp_info, payload, &payload_len);
|
||||
EXPECT_EQ(NetEq::kOK,
|
||||
neteq_->InsertPacket(
|
||||
rtp_info.header,
|
||||
rtc::ArrayView<const uint8_t>(payload, payload_len), 0));
|
||||
EXPECT_EQ(
|
||||
NetEq::kOK,
|
||||
neteq_->InsertPacket(
|
||||
rtp_info, rtc::ArrayView<const uint8_t>(payload, payload_len), 0));
|
||||
}
|
||||
|
||||
bool GetAudioReturnMuted() {
|
||||
@ -1547,8 +1545,8 @@ TEST_F(NetEqDecodingTestTwoInstances, CompareMutedStateOnOff) {
|
||||
uint8_t payload[kPayloadBytes] = {0};
|
||||
WebRtcRTPHeader rtp_info;
|
||||
PopulateRtpInfo(0, 0, &rtp_info);
|
||||
EXPECT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload, 0));
|
||||
EXPECT_EQ(0, neteq2_->InsertPacket(rtp_info.header, payload, 0));
|
||||
EXPECT_EQ(0, neteq_->InsertPacket(rtp_info, payload, 0));
|
||||
EXPECT_EQ(0, neteq2_->InsertPacket(rtp_info, payload, 0));
|
||||
|
||||
AudioFrame out_frame1, out_frame2;
|
||||
bool muted;
|
||||
@ -1570,8 +1568,8 @@ TEST_F(NetEqDecodingTestTwoInstances, CompareMutedStateOnOff) {
|
||||
// Insert new data. Timestamp is corrected for the time elapsed since the last
|
||||
// packet.
|
||||
PopulateRtpInfo(0, kSamples * 1000, &rtp_info);
|
||||
EXPECT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload, 0));
|
||||
EXPECT_EQ(0, neteq2_->InsertPacket(rtp_info.header, payload, 0));
|
||||
EXPECT_EQ(0, neteq_->InsertPacket(rtp_info, payload, 0));
|
||||
EXPECT_EQ(0, neteq2_->InsertPacket(rtp_info, payload, 0));
|
||||
|
||||
int counter = 0;
|
||||
while (out_frame1.speech_type_ != AudioFrame::kNormalSpeech) {
|
||||
|
||||
Reference in New Issue
Block a user