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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 | 307 |
308 while (ptrRTPDataExtensionEnd - ptr > 0) { | 308 while (ptrRTPDataExtensionEnd - ptr > 0) { |
309 // 0 | 309 // 0 |
310 // 0 1 2 3 4 5 6 7 | 310 // 0 1 2 3 4 5 6 7 |
311 // +-+-+-+-+-+-+-+-+ | 311 // +-+-+-+-+-+-+-+-+ |
312 // | ID | len | | 312 // | ID | len | |
313 // +-+-+-+-+-+-+-+-+ | 313 // +-+-+-+-+-+-+-+-+ |
314 | 314 |
315 // Note that 'len' is the header extension element length, which is the | 315 // Note that 'len' is the header extension element length, which is the |
316 // number of bytes - 1. | 316 // number of bytes - 1. |
317 const uint8_t id = (*ptr & 0xf0) >> 4; | 317 const int id = (*ptr & 0xf0) >> 4; |
318 const uint8_t len = (*ptr & 0x0f); | 318 const int len = (*ptr & 0x0f); |
319 ptr++; | 319 ptr++; |
320 | 320 |
321 if (id == 15) { | 321 if (id == 15) { |
322 LOG(LS_WARNING) | 322 LOG(LS_WARNING) |
323 << "RTP extension header 15 encountered. Terminate parsing."; | 323 << "RTP extension header 15 encountered. Terminate parsing."; |
324 return; | 324 return; |
325 } | 325 } |
326 | 326 |
327 RTPExtensionType type; | 327 RTPExtensionType type; |
328 if (ptrExtensionMap->GetType(id, &type) != 0) { | 328 if (ptrExtensionMap->GetType(id, &type) != 0) { |
329 // If we encounter an unknown extension, just skip over it. | 329 // If we encounter an unknown extension, just skip over it. |
330 LOG(LS_WARNING) << "Failed to find extension id: " | 330 LOG(LS_WARNING) << "Failed to find extension id: " << id; |
331 << static_cast<int>(id); | |
332 } else { | 331 } else { |
333 switch (type) { | 332 switch (type) { |
334 case kRtpExtensionTransmissionTimeOffset: { | 333 case kRtpExtensionTransmissionTimeOffset: { |
335 if (len != 2) { | 334 if (len != 2) { |
336 LOG(LS_WARNING) << "Incorrect transmission time offset len: " | 335 LOG(LS_WARNING) << "Incorrect transmission time offset len: " |
337 << len; | 336 << len; |
338 return; | 337 return; |
339 } | 338 } |
340 // 0 1 2 3 | 339 // 0 1 2 3 |
341 // 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 | 340 // 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... |
390 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 | 389 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 |
391 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 390 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
392 // | ID | len=0 |0 0 0 0 C F R R| | 391 // | ID | len=0 |0 0 0 0 C F R R| |
393 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 392 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
394 header->extension.hasVideoRotation = true; | 393 header->extension.hasVideoRotation = true; |
395 header->extension.videoRotation = ptr[0]; | 394 header->extension.videoRotation = ptr[0]; |
396 break; | 395 break; |
397 } | 396 } |
398 case kRtpExtensionTransportSequenceNumber: { | 397 case kRtpExtensionTransportSequenceNumber: { |
399 if (len != 1) { | 398 if (len != 1) { |
400 LOG(LS_WARNING) | 399 LOG(LS_WARNING) << "Incorrect transport sequence number len: " |
401 << "Incorrect peer connection sequence number len: " << len; | 400 << len; |
402 return; | 401 return; |
403 } | 402 } |
404 // 0 1 2 | 403 // 0 1 2 |
405 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 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 |
406 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 405 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
407 // | ID | L=1 |transport wide sequence number | | 406 // | ID | L=1 |transport wide sequence number | |
408 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 407 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
409 | 408 |
410 uint16_t sequence_number = ptr[0] << 8; | 409 uint16_t sequence_number = ptr[0] << 8; |
411 sequence_number += ptr[1]; | 410 sequence_number += ptr[1]; |
(...skipping 21 matching lines...) Expand all Loading... |
433 if (*ptr != 0) { | 432 if (*ptr != 0) { |
434 return num_zero_bytes; | 433 return num_zero_bytes; |
435 } | 434 } |
436 ptr++; | 435 ptr++; |
437 num_zero_bytes++; | 436 num_zero_bytes++; |
438 } | 437 } |
439 return num_zero_bytes; | 438 return num_zero_bytes; |
440 } | 439 } |
441 } // namespace RtpUtility | 440 } // namespace RtpUtility |
442 } // namespace webrtc | 441 } // namespace webrtc |
OLD | NEW |