Help to land 7969005 on behalf of solenberg. The review and try is done in 7969005.
- Add ability to VoE to send Absolute Sender Time header extension.
- Refactor handling of RTP header extensions in VoE to work the same as in ViE.
- Add API to enable receiving Absolute Sender Time in VoE.
This is part of the work to include audio packets in bandwidth estimation, for
better accuracy in estimates.
BUG=
TBR=solenberg@webrtc.org,henrikg@webrtc.org,stefan@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/9509004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@5654 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_utility.cc b/webrtc/modules/rtp_rtcp/source/rtp_utility.cc
index 102ebec..be51f73 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_utility.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_utility.cc
@@ -398,6 +398,10 @@
header.extension.hasAbsoluteSendTime = false;
header.extension.absoluteSendTime = 0;
+ // May not be present in packet.
+ header.extension.hasAudioLevel = false;
+ header.extension.audioLevel = 0;
+
if (X) {
/* RTP header extension, RFC 3550.
0 1 2 3
@@ -496,7 +500,11 @@
break;
}
case kRtpExtensionAudioLevel: {
- // --- Only used for debugging ---
+ if (len != 0) {
+ WEBRTC_TRACE(kTraceWarning, kTraceRtpRtcp, -1,
+ "Incorrect audio level len: %d", 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
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -509,6 +517,9 @@
// const uint8_t level = (*ptr & 0x7f);
// DEBUG_PRINT("RTP_AUDIO_LEVEL_UNIQUE_ID: ID=%u, len=%u, V=%u,
// level=%u", ID, len, V, level);
+
+ header.extension.audioLevel = *ptr++;
+ header.extension.hasAudioLevel = true;
break;
}
case kRtpExtensionAbsoluteSendTime: {