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

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

Issue 1272343003: Separating voice activity flag from audio level in RtpHeaderExtension. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: removing redundant comments Created 5 years, 4 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
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0d083bd92a5289f5c4e940c40a0eea096c01190e..2727e7b8bc168ead1d67b213e580a98c37b747b9 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_utility.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_utility.cc
@@ -312,6 +312,7 @@ bool RtpHeaderParser::Parse(RTPHeader& header,
// May not be present in packet.
header.extension.hasAudioLevel = false;
+ header.extension.voiceActivity = false;
header.extension.audioLevel = 0;
// May not be present in packet.
@@ -423,14 +424,8 @@ void RtpHeaderParser::ParseOneByteExtensionHeader(
// | ID | len=0 |V| level |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//
-
- // Parse out the fields but only use it for debugging for now.
- // const uint8_t V = (*ptr & 0x80) >> 7;
- // 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[0];
+ header.extension.audioLevel = ptr[0] & 0x7f;
+ header.extension.voiceActivity = (ptr[0] & 0x80) != 0;
header.extension.hasAudioLevel = true;
break;
}
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698