Removes RepairedRtpStreamId from overhead calculation.

In https://webrtc-review.googlesource.com/c/src/+/173704 the overhead
calculations were made more static, so that "volatile" extensions
(those that are not set on every packet) are ignored. The intent, as
the comments specify, was to ignore RepairedRtpStreamId since that is
only used on RTX packets.
This CL makes us actually count that extension as volatile.

Bug: webrtc:10809
Change-Id: If42ae84e4c09ff9112e93f8d872ee890c6253a23
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175010
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31246}
This commit is contained in:
Erik Språng
2020-05-13 15:04:35 +02:00
committed by Commit Bot
parent da76ad3c49
commit adaec45f36
2 changed files with 25 additions and 1 deletions

View File

@ -2032,6 +2032,30 @@ TEST_P(RtpSenderTest, CountMidOnlyUntilAcked) {
EXPECT_EQ(rtp_sender()->ExpectedPerPacketOverhead(), 12u);
}
TEST_P(RtpSenderTest, DontCountVolatileExtensionsIntoOverhead) {
RtpRtcp::Configuration config;
config.clock = &fake_clock_;
config.outgoing_transport = &transport_;
config.local_media_ssrc = kSsrc;
config.retransmission_rate_limiter = &retransmission_rate_limiter_;
rtp_sender_context_ = std::make_unique<RtpSenderContext>(config);
// Base RTP overhead is 12B.
EXPECT_EQ(rtp_sender()->ExpectedPerPacketOverhead(), 12u);
rtp_sender()->RegisterRtpHeaderExtension(kRtpExtensionInbandComfortNoise, 1);
rtp_sender()->RegisterRtpHeaderExtension(kRtpExtensionAbsoluteCaptureTime, 2);
rtp_sender()->RegisterRtpHeaderExtension(kRtpExtensionVideoRotation, 3);
rtp_sender()->RegisterRtpHeaderExtension(kRtpExtensionPlayoutDelay, 4);
rtp_sender()->RegisterRtpHeaderExtension(kRtpExtensionVideoContentType, 5);
rtp_sender()->RegisterRtpHeaderExtension(kRtpExtensionVideoTiming, 6);
rtp_sender()->RegisterRtpHeaderExtension(kRtpExtensionRepairedRtpStreamId, 7);
rtp_sender()->RegisterRtpHeaderExtension(kRtpExtensionColorSpace, 8);
// Still only 12B counted since can't count on above being sent.
EXPECT_EQ(rtp_sender()->ExpectedPerPacketOverhead(), 12u);
}
TEST_P(RtpSenderTest, SendPacketMatchesVideo) {
std::unique_ptr<RtpPacketToSend> packet =
BuildRtpPacket(kPayload, true, 0, fake_clock_.TimeInMilliseconds());