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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_utility.cc

Issue 1535963002: Wire-up BWE feedback for audio receive streams. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix audio receive stream test expectation. Created 5 years 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
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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 // number of bytes - 1. 379 // number of bytes - 1.
380 const uint8_t id = (*ptr & 0xf0) >> 4; 380 const uint8_t id = (*ptr & 0xf0) >> 4;
381 const uint8_t len = (*ptr & 0x0f); 381 const uint8_t len = (*ptr & 0x0f);
382 ptr++; 382 ptr++;
383 383
384 if (id == 15) { 384 if (id == 15) {
385 LOG(LS_WARNING) 385 LOG(LS_WARNING)
386 << "RTP extension header 15 encountered. Terminate parsing."; 386 << "RTP extension header 15 encountered. Terminate parsing.";
387 return; 387 return;
388 } 388 }
389
390 RTPExtensionType type; 389 RTPExtensionType type;
391 if (ptrExtensionMap->GetType(id, &type) != 0) { 390 if (ptrExtensionMap->GetType(id, &type) != 0) {
392 // If we encounter an unknown extension, just skip over it. 391 // If we encounter an unknown extension, just skip over it.
393 LOG(LS_WARNING) << "Failed to find extension id: " 392 LOG(LS_WARNING) << "Failed to find extension id: "
394 << static_cast<int>(id); 393 << static_cast<int>(id);
395 } else { 394 } else {
396 switch (type) { 395 switch (type) {
397 case kRtpExtensionTransmissionTimeOffset: { 396 case kRtpExtensionTransmissionTimeOffset: {
398 if (len != 2) { 397 if (len != 2) {
399 LOG(LS_WARNING) << "Incorrect transmission time offset len: " 398 LOG(LS_WARNING) << "Incorrect transmission time offset len: "
400 << len; 399 << static_cast<int>(len);
the sun 2015/12/20 23:16:15 Would it be easier to store the length in an int?
stefan-webrtc 2015/12/21 08:01:29 Haha, agreed.
401 return; 400 return;
402 } 401 }
403 // 0 1 2 3 402 // 0 1 2 3
404 // 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 403 // 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
405 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 404 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
406 // | ID | len=2 | transmission offset | 405 // | ID | len=2 | transmission offset |
407 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 406 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
408 407
409 header.extension.transmissionTimeOffset = 408 header.extension.transmissionTimeOffset =
410 ByteReader<int32_t, 3>::ReadBigEndian(ptr); 409 ByteReader<int32_t, 3>::ReadBigEndian(ptr);
411 header.extension.hasTransmissionTimeOffset = true; 410 header.extension.hasTransmissionTimeOffset = true;
412 break; 411 break;
413 } 412 }
414 case kRtpExtensionAudioLevel: { 413 case kRtpExtensionAudioLevel: {
415 if (len != 0) { 414 if (len != 0) {
416 LOG(LS_WARNING) << "Incorrect audio level len: " << len; 415 LOG(LS_WARNING) << "Incorrect audio level len: "
416 << static_cast<int>(len);
417 return; 417 return;
418 } 418 }
419 // 0 1 419 // 0 1
420 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 420 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
421 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 421 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
422 // | ID | len=0 |V| level | 422 // | ID | len=0 |V| level |
423 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 423 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
424 // 424 //
425 header.extension.audioLevel = ptr[0] & 0x7f; 425 header.extension.audioLevel = ptr[0] & 0x7f;
426 header.extension.voiceActivity = (ptr[0] & 0x80) != 0; 426 header.extension.voiceActivity = (ptr[0] & 0x80) != 0;
427 header.extension.hasAudioLevel = true; 427 header.extension.hasAudioLevel = true;
428 break; 428 break;
429 } 429 }
430 case kRtpExtensionAbsoluteSendTime: { 430 case kRtpExtensionAbsoluteSendTime: {
431 if (len != 2) { 431 if (len != 2) {
432 LOG(LS_WARNING) << "Incorrect absolute send time len: " << len; 432 LOG(LS_WARNING) << "Incorrect absolute send time len: "
433 << static_cast<int>(len);
433 return; 434 return;
434 } 435 }
435 // 0 1 2 3 436 // 0 1 2 3
436 // 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 437 // 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
437 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 438 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
438 // | ID | len=2 | absolute send time | 439 // | ID | len=2 | absolute send time |
439 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 440 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
440 441
441 header.extension.absoluteSendTime = 442 header.extension.absoluteSendTime =
442 ByteReader<uint32_t, 3>::ReadBigEndian(ptr); 443 ByteReader<uint32_t, 3>::ReadBigEndian(ptr);
443 header.extension.hasAbsoluteSendTime = true; 444 header.extension.hasAbsoluteSendTime = true;
444 break; 445 break;
445 } 446 }
446 case kRtpExtensionVideoRotation: { 447 case kRtpExtensionVideoRotation: {
447 if (len != 0) { 448 if (len != 0) {
448 LOG(LS_WARNING) 449 LOG(LS_WARNING)
449 << "Incorrect coordination of video coordination len: " << len; 450 << "Incorrect coordination of video coordination len: "
451 << static_cast<int>(len);
450 return; 452 return;
451 } 453 }
452 // 0 1 454 // 0 1
453 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 455 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
454 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 456 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
455 // | ID | len=0 |0 0 0 0 C F R R| 457 // | ID | len=0 |0 0 0 0 C F R R|
456 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 458 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
457 header.extension.hasVideoRotation = true; 459 header.extension.hasVideoRotation = true;
458 header.extension.videoRotation = ptr[0]; 460 header.extension.videoRotation = ptr[0];
459 break; 461 break;
460 } 462 }
461 case kRtpExtensionTransportSequenceNumber: { 463 case kRtpExtensionTransportSequenceNumber: {
462 if (len != 1) { 464 if (len != 1) {
463 LOG(LS_WARNING) 465 LOG(LS_WARNING) << "Incorrect transport sequence number len: "
464 << "Incorrect peer connection sequence number len: " << len; 466 << static_cast<int>(len);
465 return; 467 return;
466 } 468 }
467 // 0 1 2 469 // 0 1 2
468 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 470 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
469 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 471 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
470 // | ID | L=1 |transport wide sequence number | 472 // | ID | L=1 |transport wide sequence number |
471 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 473 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
472 474
473 uint16_t sequence_number = ptr[0] << 8; 475 uint16_t sequence_number = ptr[0] << 8;
474 sequence_number += ptr[1]; 476 sequence_number += ptr[1];
(...skipping 22 matching lines...) Expand all
497 return num_zero_bytes; 499 return num_zero_bytes;
498 } 500 }
499 ptr++; 501 ptr++;
500 num_zero_bytes++; 502 num_zero_bytes++;
501 } 503 }
502 return num_zero_bytes; 504 return num_zero_bytes;
503 } 505 }
504 } // namespace RtpUtility 506 } // namespace RtpUtility
505 507
506 } // namespace webrtc 508 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698