Index: webrtc/modules/rtp_rtcp/source/rtp_header_extensions.cc |
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_header_extensions.cc b/webrtc/modules/rtp_rtcp/source/rtp_header_extensions.cc |
index 0d4ce95c6b452fa875091636f624a826b135f56a..1356069ca9c138d6288819ac7f2200563afc7443 100644 |
--- a/webrtc/modules/rtp_rtcp/source/rtp_header_extensions.cc |
+++ b/webrtc/modules/rtp_rtcp/source/rtp_header_extensions.cc |
@@ -31,11 +31,10 @@ namespace webrtc { |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
// | ID | len=2 | absolute send time | |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
-const char* AbsoluteSendTime::kName = |
+constexpr RTPExtensionType AbsoluteSendTime::kId; |
+constexpr uint8_t AbsoluteSendTime::kValueSizeBytes; |
brandtr
2016/10/28 13:26:56
Are the declarations above just for documentation,
danilchap
2016/10/28 13:32:03
presence of these declaration allows to use consta
|
+const char* const AbsoluteSendTime::kUri = |
"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"; |
-bool AbsoluteSendTime::IsSupportedFor(MediaType type) { |
- return true; |
-} |
bool AbsoluteSendTime::Parse(const uint8_t* data, uint32_t* time_24bits) { |
*time_24bits = ByteReader<uint32_t, 3>::ReadBigEndian(data); |
@@ -59,19 +58,10 @@ bool AbsoluteSendTime::Write(uint8_t* data, int64_t time_ms) { |
// | ID | len=0 |V| level | |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
// |
-const char* AudioLevel::kName = "urn:ietf:params:rtp-hdrext:ssrc-audio-level"; |
-bool AudioLevel::IsSupportedFor(MediaType type) { |
- switch (type) { |
- case MediaType::ANY: |
- case MediaType::AUDIO: |
- return true; |
- case MediaType::VIDEO: |
- case MediaType::DATA: |
- return false; |
- } |
- RTC_NOTREACHED(); |
- return false; |
-} |
+constexpr RTPExtensionType AudioLevel::kId; |
+constexpr uint8_t AudioLevel::kValueSizeBytes; |
brandtr
2016/10/28 13:26:56
Same here, and below.
|
+const char* const AudioLevel::kUri = |
+ "urn:ietf:params:rtp-hdrext:ssrc-audio-level"; |
bool AudioLevel::Parse(const uint8_t* data, |
bool* voice_activity, |
@@ -105,19 +95,10 @@ bool AudioLevel::Write(uint8_t* data, |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
// | ID | len=2 | transmission offset | |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
-const char* TransmissionOffset::kName = "urn:ietf:params:rtp-hdrext:toffset"; |
-bool TransmissionOffset::IsSupportedFor(MediaType type) { |
- switch (type) { |
- case MediaType::ANY: |
- case MediaType::VIDEO: |
- return true; |
- case MediaType::AUDIO: |
- case MediaType::DATA: |
- return false; |
- } |
- RTC_NOTREACHED(); |
- return false; |
-} |
+constexpr RTPExtensionType TransmissionOffset::kId; |
+constexpr uint8_t TransmissionOffset::kValueSizeBytes; |
+const char* const TransmissionOffset::kUri = |
+ "urn:ietf:params:rtp-hdrext:toffset"; |
bool TransmissionOffset::Parse(const uint8_t* data, int32_t* rtp_time) { |
*rtp_time = ByteReader<int32_t, 3>::ReadBigEndian(data); |
@@ -135,11 +116,10 @@ bool TransmissionOffset::Write(uint8_t* data, int32_t rtp_time) { |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
// | ID | L=1 |transport wide sequence number | |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
-const char* TransportSequenceNumber::kName = |
+constexpr RTPExtensionType TransportSequenceNumber::kId; |
+constexpr uint8_t TransportSequenceNumber::kValueSizeBytes; |
+const char* const TransportSequenceNumber::kUri = |
"http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions"; |
-bool TransportSequenceNumber::IsSupportedFor(MediaType type) { |
- return true; |
-} |
bool TransportSequenceNumber::Parse(const uint8_t* data, uint16_t* value) { |
*value = ByteReader<uint16_t>::ReadBigEndian(data); |
@@ -162,19 +142,9 @@ bool TransportSequenceNumber::Write(uint8_t* data, uint16_t value) { |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
// | ID | len=0 |0 0 0 0 C F R R| |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
-const char* VideoOrientation::kName = "urn:3gpp:video-orientation"; |
-bool VideoOrientation::IsSupportedFor(MediaType type) { |
- switch (type) { |
- case MediaType::ANY: |
- case MediaType::VIDEO: |
- return true; |
- case MediaType::AUDIO: |
- case MediaType::DATA: |
- return false; |
- } |
- RTC_NOTREACHED(); |
- return false; |
-} |
+constexpr RTPExtensionType VideoOrientation::kId; |
+constexpr uint8_t VideoOrientation::kValueSizeBytes; |
+const char* const VideoOrientation::kUri = "urn:3gpp:video-orientation"; |
bool VideoOrientation::Parse(const uint8_t* data, VideoRotation* rotation) { |
*rotation = ConvertCVOByteToVideoRotation(data[0]); |
@@ -203,20 +173,8 @@ bool VideoOrientation::Write(uint8_t* data, uint8_t value) { |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
constexpr RTPExtensionType PlayoutDelayLimits::kId; |
constexpr uint8_t PlayoutDelayLimits::kValueSizeBytes; |
-const char* PlayoutDelayLimits::kName = |
+const char* const PlayoutDelayLimits::kUri = |
"http://www.webrtc.org/experiments/rtp-hdrext/playout-delay"; |
-bool PlayoutDelayLimits::IsSupportedFor(MediaType type) { |
- switch (type) { |
- case MediaType::ANY: |
- case MediaType::VIDEO: |
- return true; |
- case MediaType::AUDIO: |
- case MediaType::DATA: |
- return false; |
- } |
- RTC_NOTREACHED(); |
- return false; |
-} |
bool PlayoutDelayLimits::Parse(const uint8_t* data, |
PlayoutDelay* playout_delay) { |