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

Side by Side 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: 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 // is zero. 305 // is zero.
306 header.extension.hasTransmissionTimeOffset = false; 306 header.extension.hasTransmissionTimeOffset = false;
307 header.extension.transmissionTimeOffset = 0; 307 header.extension.transmissionTimeOffset = 0;
308 308
309 // May not be present in packet. 309 // May not be present in packet.
310 header.extension.hasAbsoluteSendTime = false; 310 header.extension.hasAbsoluteSendTime = false;
311 header.extension.absoluteSendTime = 0; 311 header.extension.absoluteSendTime = 0;
312 312
313 // May not be present in packet. 313 // May not be present in packet.
314 header.extension.hasAudioLevel = false; 314 header.extension.hasAudioLevel = false;
315 header.extension.voiceActivity = false;
315 header.extension.audioLevel = 0; 316 header.extension.audioLevel = 0;
316 317
317 // May not be present in packet. 318 // May not be present in packet.
318 header.extension.hasVideoRotation = false; 319 header.extension.hasVideoRotation = false;
319 header.extension.videoRotation = 0; 320 header.extension.videoRotation = 0;
320 321
321 if (X) { 322 if (X) {
322 /* RTP header extension, RFC 3550. 323 /* RTP header extension, RFC 3550.
323 0 1 2 3 324 0 1 2 3
324 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 325 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
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 LOG(LS_WARNING) << "Incorrect audio level len: " << len; 418 LOG(LS_WARNING) << "Incorrect audio level len: " << len;
418 return; 419 return;
419 } 420 }
420 // 0 1 421 // 0 1
421 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 422 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
422 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 423 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
423 // | ID | len=0 |V| level | 424 // | ID | len=0 |V| level |
424 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 425 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
425 // 426 //
426 427
427 // Parse out the fields but only use it for debugging for now. 428 // Parse out the fields but only use it for debugging for now.
Andrew MacDonald 2015/08/10 13:00:46 Remove this commented block please. It's redundant
428 // const uint8_t V = (*ptr & 0x80) >> 7; 429 // const uint8_t V = (*ptr & 0x80) >> 7;
429 // const uint8_t level = (*ptr & 0x7f); 430 // const uint8_t level = (*ptr & 0x7f);
430 // DEBUG_PRINT("RTP_AUDIO_LEVEL_UNIQUE_ID: ID=%u, len=%u, V=%u, 431 // DEBUG_PRINT("RTP_AUDIO_LEVEL_UNIQUE_ID: ID=%u, len=%u, V=%u,
431 // level=%u", ID, len, V, level); 432 // level=%u", ID, len, V, level);
432 433
433 header.extension.audioLevel = ptr[0]; 434 header.extension.audioLevel = ptr[0] & 0x7f;
435 header.extension.voiceActivity = (ptr[0] & 0x80) != 0;
434 header.extension.hasAudioLevel = true; 436 header.extension.hasAudioLevel = true;
435 break; 437 break;
436 } 438 }
437 case kRtpExtensionAbsoluteSendTime: { 439 case kRtpExtensionAbsoluteSendTime: {
438 if (len != 2) { 440 if (len != 2) {
439 LOG(LS_WARNING) << "Incorrect absolute send time len: " << len; 441 LOG(LS_WARNING) << "Incorrect absolute send time len: " << len;
440 return; 442 return;
441 } 443 }
442 // 0 1 2 3 444 // 0 1 2 3
443 // 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 445 // 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
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 return num_zero_bytes; 506 return num_zero_bytes;
505 } 507 }
506 ptr++; 508 ptr++;
507 num_zero_bytes++; 509 num_zero_bytes++;
508 } 510 }
509 return num_zero_bytes; 511 return num_zero_bytes;
510 } 512 }
511 } // namespace RtpUtility 513 } // namespace RtpUtility
512 514
513 } // namespace webrtc 515 } // namespace webrtc
OLDNEW
« 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