Update TransportSequenceNumberV2 extension to support fixed size

The initial implementation forced the sender to use different sizes
of the RTP header extension depending on if a feedback request is
included or not. This can be a problem if the RTP header is pre-
allocated.
This CL changes this so that a static size of 4 bytes can be used
for the TransportSequenceNumberV2 RTP header extension. The change
in the protocol to get this to work is that
FeedbackRequest::sequence_count == 0 means that no feedback is
requested, and FeedbackRequest::sequence_count == 1 means that
feedback is requested for the current packet only.

Bug: webrtc:10262
Change-Id: Ia5134b3daf49f8a5b89f6c717894f6e055f39c8e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125420
Commit-Queue: Johannes Kron <kron@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26985}
This commit is contained in:
Johannes Kron
2019-03-06 09:34:13 +01:00
committed by Commit Bot
parent f441ea9429
commit 0da25a1c8e
6 changed files with 96 additions and 18 deletions

View File

@ -94,7 +94,8 @@ class TransportSequenceNumberV2 {
public:
static constexpr RTPExtensionType kId =
kRtpExtensionTransportSequenceNumber02;
static constexpr uint8_t kValueSizeBytesWithFeedbackRequest = 4;
static constexpr uint8_t kValueSizeBytes = 4;
static constexpr uint8_t kValueSizeBytesWithoutFeedbackRequest = 2;
static constexpr const char kUri[] =
"http://www.ietf.org/id/"
"draft-holmer-rmcat-transport-wide-cc-extensions-02";
@ -104,8 +105,8 @@ class TransportSequenceNumberV2 {
static size_t ValueSize(
uint16_t /*transport_sequence_number*/,
const absl::optional<FeedbackRequest>& feedback_request) {
return feedback_request ? kValueSizeBytesWithFeedbackRequest
: TransportSequenceNumber::kValueSizeBytes;
return feedback_request ? kValueSizeBytes
: kValueSizeBytesWithoutFeedbackRequest;
}
static bool Write(rtc::ArrayView<uint8_t> data,
uint16_t transport_sequence_number,