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 bdae3c4806fc24d0a55814f57747d1f80df6d86c..a0addae4b5229b19aa90f8196457cdd4c58acda5 100644 |
--- a/webrtc/modules/rtp_rtcp/source/rtp_utility.cc |
+++ b/webrtc/modules/rtp_rtcp/source/rtp_utility.cc |
@@ -248,6 +248,10 @@ bool RtpHeaderParser::Parse(RTPHeader* header, |
header->extension.hasVideoRotation = false; |
header->extension.videoRotation = 0; |
+ // May not be present in packet. |
+ header->extension.min_playout_delay_ms = -1; |
+ header->extension.max_playout_delay_ms = -1; |
+ |
if (X) { |
/* RTP header extension, RFC 3550. |
0 1 2 3 |
@@ -407,6 +411,23 @@ void RtpHeaderParser::ParseOneByteExtensionHeader( |
header->extension.hasTransportSequenceNumber = true; |
break; |
} |
+ case kRtpExtensionPlayoutDelay: { |
+ if (len != 2) { |
+ LOG(LS_WARNING) << "Incorrect playout delay len: " << len; |
+ return; |
+ } |
+ // 0 1 2 3 |
+ // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
+ // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
+ // | ID | len=2 | MIN delay | MAX delay | |
+ // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
+ |
+ uint16_t min_playout_delay = (ptr[0] << 4) | ((ptr[1] >> 4) & 0xf); |
+ uint16_t max_playout_delay = ((ptr[1] & 0xf) << 8) | ptr[2]; |
+ header->extension.min_playout_delay_ms = min_playout_delay * 10; |
danilchap
2016/05/24 13:28:24
kPlayoutDelayGranularityMs instead of 10 here and
Irfan
2016/05/25 09:32:53
Done.
|
+ header->extension.max_playout_delay_ms = max_playout_delay * 10; |
+ break; |
+ } |
default: { |
LOG(LS_WARNING) << "Extension type not implemented: " << type; |
return; |