Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_utility.cc

Issue 2772033002: Add content type information to encoded images and corresponding rtp extension header (Closed)
Patch Set: Fix typo, leading to failed video catpure test Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..1c12c89c9276222334237f0509ef2953efa92513 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::UNSPECIFIED;
+
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::TOTAL_CONTENT_TYPES)) {
+ header->extension.hasVideoContentType = true;
+ header->extension.videoContentType =
+ static_cast<VideoContentType>(ptr[0]);
+ }
+ break;
+ }
case kRtpExtensionNone:
case kRtpExtensionNumberOfExtensions: {
RTC_NOTREACHED() << "Invalid extension type: " << type;
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc ('k') | webrtc/modules/video_capture/video_capture_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698