Chromium Code Reviews| 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 1b311e64190cd80eb146ddba3628ac67a503d30d..98e6ae79b8e38543eea9afb2dba9e0ece30ca03f 100644 |
| --- a/webrtc/modules/rtp_rtcp/source/rtp_header_extensions.cc |
| +++ b/webrtc/modules/rtp_rtcp/source/rtp_header_extensions.cc |
| @@ -215,4 +215,34 @@ bool PlayoutDelayLimits::Write(uint8_t* data, |
| return true; |
| } |
| +// Video Content Type. |
| +// |
| +// E.g. default video or screenshare. |
| +// |
| +// 0 1 |
| +// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 |
| +// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| +// | ID | len=0 | Content type | |
| +// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| +constexpr RTPExtensionType VideoContentTypeExtension::kId; |
| +constexpr uint8_t VideoContentTypeExtension::kValueSizeBytes; |
| +constexpr const char* VideoContentTypeExtension::kUri; |
| + |
| +bool VideoContentTypeExtension::Parse(rtc::ArrayView<const uint8_t> data, |
| + VideoContentType* content_type) { |
| + if (data.size() == 1 && |
| + data[0] < static_cast<uint8_t>(VideoContentType::kTotalContentTypes)) { |
| + *content_type = static_cast<VideoContentType>(data[0]); |
| + return true; |
| + } else { |
|
tommi
2017/04/10 10:59:18
no need for |else|
ilnik
2017/04/10 12:47:42
Done.
|
| + return false; |
| + } |
| +} |
| + |
| +bool VideoContentTypeExtension::Write(uint8_t* data, |
| + VideoContentType content_type) { |
| + data[0] = static_cast<uint8_t>(content_type); |
|
tommi
2017/04/10 10:59:18
is there a safe cast method that we can use instea
ilnik
2017/04/10 12:47:42
I don't want to write one, as it will introduce a
|
| + return true; |
| +} |
| + |
| } // namespace webrtc |