OLD | NEW |
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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 | 370 |
371 while (ptrRTPDataExtensionEnd - ptr > 0) { | 371 while (ptrRTPDataExtensionEnd - ptr > 0) { |
372 // 0 | 372 // 0 |
373 // 0 1 2 3 4 5 6 7 | 373 // 0 1 2 3 4 5 6 7 |
374 // +-+-+-+-+-+-+-+-+ | 374 // +-+-+-+-+-+-+-+-+ |
375 // | ID | len | | 375 // | ID | len | |
376 // +-+-+-+-+-+-+-+-+ | 376 // +-+-+-+-+-+-+-+-+ |
377 | 377 |
378 // Note that 'len' is the header extension element length, which is the | 378 // Note that 'len' is the header extension element length, which is the |
379 // number of bytes - 1. | 379 // number of bytes - 1. |
380 const uint8_t id = (*ptr & 0xf0) >> 4; | 380 const int id = (*ptr & 0xf0) >> 4; |
381 const uint8_t len = (*ptr & 0x0f); | 381 const int 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 | 389 |
390 RTPExtensionType type; | 390 RTPExtensionType type; |
391 if (ptrExtensionMap->GetType(id, &type) != 0) { | 391 if (ptrExtensionMap->GetType(id, &type) != 0) { |
392 // If we encounter an unknown extension, just skip over it. | 392 // If we encounter an unknown extension, just skip over it. |
393 LOG(LS_WARNING) << "Failed to find extension id: " | 393 LOG(LS_WARNING) << "Failed to find extension id: " << id; |
394 << 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 << len; |
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 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 | 452 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 |
454 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 453 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
455 // | ID | len=0 |0 0 0 0 C F R R| | 454 // | ID | len=0 |0 0 0 0 C F R R| |
456 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 455 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
457 header.extension.hasVideoRotation = true; | 456 header.extension.hasVideoRotation = true; |
458 header.extension.videoRotation = ptr[0]; | 457 header.extension.videoRotation = ptr[0]; |
459 break; | 458 break; |
460 } | 459 } |
461 case kRtpExtensionTransportSequenceNumber: { | 460 case kRtpExtensionTransportSequenceNumber: { |
462 if (len != 1) { | 461 if (len != 1) { |
463 LOG(LS_WARNING) | 462 LOG(LS_WARNING) << "Incorrect transport sequence number len: " |
464 << "Incorrect peer connection sequence number len: " << len; | 463 << len; |
465 return; | 464 return; |
466 } | 465 } |
467 // 0 1 2 | 466 // 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 | 467 // 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 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 468 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
470 // | ID | L=1 |transport wide sequence number | | 469 // | ID | L=1 |transport wide sequence number | |
471 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 470 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
472 | 471 |
473 uint16_t sequence_number = ptr[0] << 8; | 472 uint16_t sequence_number = ptr[0] << 8; |
474 sequence_number += ptr[1]; | 473 sequence_number += ptr[1]; |
(...skipping 22 matching lines...) Expand all Loading... |
497 return num_zero_bytes; | 496 return num_zero_bytes; |
498 } | 497 } |
499 ptr++; | 498 ptr++; |
500 num_zero_bytes++; | 499 num_zero_bytes++; |
501 } | 500 } |
502 return num_zero_bytes; | 501 return num_zero_bytes; |
503 } | 502 } |
504 } // namespace RtpUtility | 503 } // namespace RtpUtility |
505 | 504 |
506 } // namespace webrtc | 505 } // namespace webrtc |
OLD | NEW |