Rename too long variable name to extmap_allow_mixed

Bug: webrtc:7990
Change-Id: I990111e473553163cecb9c73fec90d07c24aca02
Reviewed-on: https://webrtc-review.googlesource.com/c/107362
Commit-Queue: Johannes Kron <kron@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25307}
This commit is contained in:
Johannes Kron
2018-10-23 10:17:39 +02:00
committed by Commit Bot
parent 2edab4c026
commit 9581bc4c52
11 changed files with 106 additions and 120 deletions

View File

@ -56,15 +56,17 @@ static_assert(arraysize(kExtensions) ==
constexpr RTPExtensionType RtpHeaderExtensionMap::kInvalidType;
constexpr int RtpHeaderExtensionMap::kInvalidId;
RtpHeaderExtensionMap::RtpHeaderExtensionMap()
: mixed_one_two_byte_header_supported_(false) {
RtpHeaderExtensionMap::RtpHeaderExtensionMap() : RtpHeaderExtensionMap(false) {}
RtpHeaderExtensionMap::RtpHeaderExtensionMap(bool extmap_allow_mixed)
: extmap_allow_mixed_(extmap_allow_mixed) {
for (auto& id : ids_)
id = kInvalidId;
}
RtpHeaderExtensionMap::RtpHeaderExtensionMap(
rtc::ArrayView<const RtpExtension> extensions)
: RtpHeaderExtensionMap() {
: RtpHeaderExtensionMap(false) {
for (const RtpExtension& extension : extensions)
RegisterByUri(extension.id, extension.uri);
}

View File

@ -211,8 +211,7 @@ rtc::ArrayView<uint8_t> RtpPacket::AllocateRawExtension(int id, size_t length) {
const bool two_byte_header_required =
id > RtpExtension::kOneByteHeaderExtensionMaxId ||
length > RtpExtension::kOneByteHeaderExtensionMaxValueSize || length == 0;
RTC_CHECK(!two_byte_header_required ||
extensions_.IsMixedOneTwoByteHeaderSupported());
RTC_CHECK(!two_byte_header_required || extensions_.ExtmapAllowMixed());
uint16_t profile_id;
if (extensions_size_ > 0) {
@ -553,7 +552,7 @@ rtc::ArrayView<uint8_t> RtpPacket::AllocateExtension(ExtensionType type,
size_t length) {
// TODO(webrtc:7990): Add support for empty extensions (length==0).
if (length == 0 || length > RtpExtension::kMaxValueSize ||
(!extensions_.IsMixedOneTwoByteHeaderSupported() &&
(!extensions_.ExtmapAllowMixed() &&
length > RtpExtension::kOneByteHeaderExtensionMaxValueSize)) {
return nullptr;
}
@ -563,7 +562,7 @@ rtc::ArrayView<uint8_t> RtpPacket::AllocateExtension(ExtensionType type,
// Extension not registered.
return nullptr;
}
if (!extensions_.IsMixedOneTwoByteHeaderSupported() &&
if (!extensions_.ExtmapAllowMixed() &&
id > RtpExtension::kOneByteHeaderExtensionMaxId) {
return nullptr;
}

View File

@ -226,8 +226,7 @@ TEST(RtpPacketTest, CreateWith2Extensions) {
}
TEST(RtpPacketTest, CreateWithTwoByteHeaderExtensionFirst) {
RtpPacketToSend::ExtensionManager extensions;
extensions.SetMixedOneTwoByteHeaderSupported(true);
RtpPacketToSend::ExtensionManager extensions(true);
extensions.Register(kRtpExtensionTransmissionTimeOffset,
kTransmissionOffsetExtensionId);
extensions.Register(kRtpExtensionAudioLevel, kAudioLevelExtensionId);
@ -248,8 +247,7 @@ TEST(RtpPacketTest, CreateWithTwoByteHeaderExtensionFirst) {
TEST(RtpPacketTest, CreateWithTwoByteHeaderExtensionLast) {
// This test will trigger RtpPacket::PromoteToTwoByteHeaderExtension().
RtpPacketToSend::ExtensionManager extensions;
extensions.SetMixedOneTwoByteHeaderSupported(true);
RtpPacketToSend::ExtensionManager extensions(true);
extensions.Register(kRtpExtensionTransmissionTimeOffset,
kTransmissionOffsetExtensionId);
extensions.Register(kRtpExtensionAudioLevel, kAudioLevelExtensionId);