Introduce new enum name for the dependency descriptor extension

Dependency descriptor has finalized spec and thus deserve a dedicated name.

Bug: webrtc:10342
Change-Id: I2c2f1d52c82cfff8372cd4092dfcc47a083a6009
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290402
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38973}
This commit is contained in:
Danil Chapovalov 2023-01-02 13:51:15 +01:00 committed by WebRTC LUCI CQ
parent 4f74385b4f
commit ef90964b83
7 changed files with 18 additions and 15 deletions

View File

@ -72,9 +72,12 @@ enum RTPExtensionType : int {
kRtpExtensionRtpStreamId,
kRtpExtensionRepairedRtpStreamId,
kRtpExtensionMid,
kRtpExtensionGenericFrameDescriptor00,
kRtpExtensionGenericFrameDescriptor = kRtpExtensionGenericFrameDescriptor00,
kRtpExtensionGenericFrameDescriptor02,
kRtpExtensionGenericFrameDescriptor,
kRtpExtensionGenericFrameDescriptor00 [[deprecated]] =
kRtpExtensionGenericFrameDescriptor,
kRtpExtensionDependencyDescriptor,
kRtpExtensionGenericFrameDescriptor02 [[deprecated]] =
kRtpExtensionDependencyDescriptor,
kRtpExtensionColorSpace,
kRtpExtensionVideoFrameTrackingId,
kRtpExtensionNumberOfExtensions // Must be the last entity in the enum.

View File

@ -22,11 +22,9 @@
namespace webrtc {
// Trait to read/write the dependency descriptor extension as described in
// https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension
// While the format is still in design, the code might change without backward
// compatibility.
class RtpDependencyDescriptorExtension {
public:
static constexpr RTPExtensionType kId = kRtpExtensionGenericFrameDescriptor02;
static constexpr RTPExtensionType kId = kRtpExtensionDependencyDescriptor;
static constexpr absl::string_view Uri() {
return RtpExtension::kDependencyDescriptorUri;
}

View File

@ -21,10 +21,13 @@
namespace webrtc {
// Trait to read/write the generic frame descriptor, the early version of the
// dependency descriptor extension. Usage of this rtp header extension is
// discouraged in favor of the dependency descriptor.
class RtpGenericFrameDescriptorExtension00 {
public:
using value_type = RtpGenericFrameDescriptor;
static constexpr RTPExtensionType kId = kRtpExtensionGenericFrameDescriptor00;
static constexpr RTPExtensionType kId = kRtpExtensionGenericFrameDescriptor;
static constexpr absl::string_view Uri() {
return RtpExtension::kGenericFrameDescriptorUri00;
}

View File

@ -188,8 +188,8 @@ void RtpPacket::ZeroMutableExtensions() {
case RTPExtensionType::kRtpExtensionCsrcAudioLevel:
case RTPExtensionType::kRtpExtensionAbsoluteCaptureTime:
case RTPExtensionType::kRtpExtensionColorSpace:
case RTPExtensionType::kRtpExtensionGenericFrameDescriptor00:
case RTPExtensionType::kRtpExtensionGenericFrameDescriptor02:
case RTPExtensionType::kRtpExtensionGenericFrameDescriptor:
case RTPExtensionType::kRtpExtensionDependencyDescriptor:
case RTPExtensionType::kRtpExtensionMid:
case RTPExtensionType::kRtpExtensionNumberOfExtensions:
case RTPExtensionType::kRtpExtensionPlayoutDelay:

View File

@ -855,7 +855,7 @@ struct UncopyableValue {
UncopyableValue& operator=(const UncopyableValue&) = delete;
};
struct UncopyableExtension {
static constexpr RTPExtensionType kId = kRtpExtensionGenericFrameDescriptor02;
static constexpr RTPExtensionType kId = kRtpExtensionDependencyDescriptor;
static constexpr absl::string_view Uri() { return "uri"; }
static size_t ValueSize(const UncopyableValue& value) { return 1; }
@ -868,7 +868,6 @@ struct UncopyableExtension {
return true;
}
};
constexpr RTPExtensionType UncopyableExtension::kId;
TEST(RtpPacketTest, SetUncopyableExtension) {
RtpPacket::ExtensionManager extensions;

View File

@ -115,8 +115,8 @@ bool IsNonVolatile(RTPExtensionType type) {
case kRtpExtensionRtpStreamId:
case kRtpExtensionRepairedRtpStreamId:
case kRtpExtensionMid:
case kRtpExtensionGenericFrameDescriptor00:
case kRtpExtensionGenericFrameDescriptor02:
case kRtpExtensionGenericFrameDescriptor:
case kRtpExtensionDependencyDescriptor:
return true;
case kRtpExtensionInbandComfortNoise:
case kRtpExtensionAbsoluteCaptureTime:

View File

@ -135,7 +135,7 @@ void FuzzOneInput(const uint8_t* data, size_t size) {
packet.GetExtension<RtpMid>(&mid);
break;
}
case kRtpExtensionGenericFrameDescriptor00: {
case kRtpExtensionGenericFrameDescriptor: {
RtpGenericFrameDescriptor descriptor;
packet.GetExtension<RtpGenericFrameDescriptorExtension00>(&descriptor);
break;
@ -160,7 +160,7 @@ void FuzzOneInput(const uint8_t* data, size_t size) {
packet.GetExtension<VideoFrameTrackingIdExtension>(&tracking_id);
break;
}
case kRtpExtensionGenericFrameDescriptor02:
case kRtpExtensionDependencyDescriptor:
// This extension requires state to read and so complicated that
// deserves own fuzzer.
break;