Reland "Refactor NetEq delay manager logic."

This is a reland of f8e62fcb14e37a5be4f1e4f599d34c8483fea8e9

Original change's description:
> Refactor NetEq delay manager logic.
>
> - Removes dependence on sequence number for calculating target delay.
> - Changes target delay unit to milliseconds instead of number of
>   packets.
> - Moves acceleration/preemptive expand thresholds to decision logic.
>   Tests for this will be added in a follow up cl.
>
> Bug: webrtc:10333
> Change-Id: If690aae4abf41ef1d9353f0ff01fb7d121cf8a26
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186265
> Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
> Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32326}

Bug: webrtc:10333
Change-Id: Iad5e7063f63b84762959ee5b412f5f14a7b2cd06
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186943
Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32332}
This commit is contained in:
Jakob Ivarsson
2020-10-06 18:12:07 +02:00
committed by Commit Bot
parent 16e7b515ee
commit 2a7c57c34f
12 changed files with 252 additions and 626 deletions

View File

@ -804,8 +804,10 @@ TEST_P(NetEqImplTestSampleRateParameter,
EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output, &muted));
}
// Insert one more packet.
insert_packet();
// Insert a few packets to avoid postpone decoding after expand.
for (size_t i = 0; i < 5; ++i) {
insert_packet();
}
// Pull audio until the newly inserted packet is decoded and the PLC ends.
while (output.speech_type_ != AudioFrame::kNormalSpeech) {
@ -881,8 +883,10 @@ TEST_P(NetEqImplTestSampleRateParameter, AudioInterruptionLogged) {
EXPECT_NE(AudioFrame::kNormalSpeech, output.speech_type_);
}
// Insert one more packet.
insert_packet();
// Insert a few packets to avoid postpone decoding after expand.
for (size_t i = 0; i < 5; ++i) {
insert_packet();
}
// Pull audio until the newly inserted packet is decoded and the PLC ends.
while (output.speech_type_ != AudioFrame::kNormalSpeech) {
@ -1299,7 +1303,7 @@ TEST_F(NetEqImplTest, DecodingError) {
SdpAudioFormat("L16", 8000, 1)));
// Insert packets.
for (int i = 0; i < 6; ++i) {
for (int i = 0; i < 20; ++i) {
rtp_header.sequenceNumber += 1;
rtp_header.timestamp += kFrameLengthSamples;
EXPECT_EQ(NetEq::kOK, neteq_->InsertPacket(rtp_header, payload));