Chromium Code Reviews| Index: webrtc/modules/rtp_rtcp/source/rtp_utility.cc |
| diff --git a/webrtc/modules/rtp_rtcp/source/rtp_utility.cc b/webrtc/modules/rtp_rtcp/source/rtp_utility.cc |
| index def431f1709499993bac608a993aa0c49e33bc1b..7ee9107c4389d94f3b9b016c254d7fbbaa977cd6 100644 |
| --- a/webrtc/modules/rtp_rtcp/source/rtp_utility.cc |
| +++ b/webrtc/modules/rtp_rtcp/source/rtp_utility.cc |
| @@ -254,6 +254,10 @@ bool RtpHeaderParser::Parse(RTPHeader* header, |
| header->extension.playout_delay.min_ms = -1; |
| header->extension.playout_delay.max_ms = -1; |
| + // May not be present in packet. |
| + header->extension.hasVideoContentType = false; |
| + header->extension.videoContentType = VideoContentType::kUnspecified; |
| + |
| if (X) { |
| /* RTP header extension, RFC 3550. |
| 0 1 2 3 |
| @@ -446,6 +450,25 @@ void RtpHeaderParser::ParseOneByteExtensionHeader( |
| max_playout_delay * PlayoutDelayLimits::kGranularityMs; |
| break; |
| } |
| + case kRtpExtensionVideoContentType: { |
| + if (len != 0) { |
| + LOG(LS_WARNING) << "Incorrect video content type len: " << len; |
| + return; |
| + } |
| + // 0 1 |
| + // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 |
| + // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| + // | ID | len=0 | Content type | |
| + // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| + |
| + if (ptr[0] < |
| + static_cast<uint8_t>(VideoContentType::kTotalContentTypes)) { |
|
tommi
2017/04/10 10:59:18
safe cast?
ilnik
2017/04/10 12:47:42
It's safe now. VideoContentType underlying type is
|
| + header->extension.hasVideoContentType = true; |
| + header->extension.videoContentType = |
| + static_cast<VideoContentType>(ptr[0]); |
| + } |
| + break; |
| + } |
| case kRtpExtensionNone: |
| case kRtpExtensionNumberOfExtensions: { |
| RTC_NOTREACHED() << "Invalid extension type: " << type; |