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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 | 457 |
458 bool | 458 bool |
459 VCMSessionInfo::session_nack() const { | 459 VCMSessionInfo::session_nack() const { |
460 return session_nack_; | 460 return session_nack_; |
461 } | 461 } |
462 | 462 |
463 int VCMSessionInfo::InsertPacket(const VCMPacket& packet, | 463 int VCMSessionInfo::InsertPacket(const VCMPacket& packet, |
464 uint8_t* frame_buffer, | 464 uint8_t* frame_buffer, |
465 VCMDecodeErrorMode decode_error_mode, | 465 VCMDecodeErrorMode decode_error_mode, |
466 const FrameData& frame_data) { | 466 const FrameData& frame_data) { |
467 if (packet.frameType == kFrameEmpty) { | 467 if (packet.frameType == kEmptyFrame) { |
468 // Update sequence number of an empty packet. | 468 // Update sequence number of an empty packet. |
469 // Only media packets are inserted into the packet list. | 469 // Only media packets are inserted into the packet list. |
470 InformOfEmptyPacket(packet.seqNum); | 470 InformOfEmptyPacket(packet.seqNum); |
471 return 0; | 471 return 0; |
472 } | 472 } |
473 | 473 |
474 if (packets_.size() == kMaxPacketsInSession) { | 474 if (packets_.size() == kMaxPacketsInSession) { |
475 LOG(LS_ERROR) << "Max number of packets per frame has been reached."; | 475 LOG(LS_ERROR) << "Max number of packets per frame has been reached."; |
476 return -1; | 476 return -1; |
477 } | 477 } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 if (packet.isFirstPacket && first_packet_seq_num_ == -1) { | 509 if (packet.isFirstPacket && first_packet_seq_num_ == -1) { |
510 // The first packet in a frame signals the frame type. | 510 // The first packet in a frame signals the frame type. |
511 frame_type_ = packet.frameType; | 511 frame_type_ = packet.frameType; |
512 // Store the sequence number for the first packet. | 512 // Store the sequence number for the first packet. |
513 first_packet_seq_num_ = static_cast<int>(packet.seqNum); | 513 first_packet_seq_num_ = static_cast<int>(packet.seqNum); |
514 } else if (first_packet_seq_num_ != -1 && | 514 } else if (first_packet_seq_num_ != -1 && |
515 IsNewerSequenceNumber(first_packet_seq_num_, packet.seqNum)) { | 515 IsNewerSequenceNumber(first_packet_seq_num_, packet.seqNum)) { |
516 LOG(LS_WARNING) << "Received packet with a sequence number which is out " | 516 LOG(LS_WARNING) << "Received packet with a sequence number which is out " |
517 "of frame boundaries"; | 517 "of frame boundaries"; |
518 return -3; | 518 return -3; |
519 } else if (frame_type_ == kFrameEmpty && packet.frameType != kFrameEmpty) { | 519 } else if (frame_type_ == kEmptyFrame && packet.frameType != kEmptyFrame) { |
520 // Update the frame type with the type of the first media packet. | 520 // Update the frame type with the type of the first media packet. |
521 // TODO(mikhal): Can this trigger? | 521 // TODO(mikhal): Can this trigger? |
522 frame_type_ = packet.frameType; | 522 frame_type_ = packet.frameType; |
523 } | 523 } |
524 | 524 |
525 // Track the marker bit, should only be set for one packet per session. | 525 // Track the marker bit, should only be set for one packet per session. |
526 if (packet.markerBit && last_packet_seq_num_ == -1) { | 526 if (packet.markerBit && last_packet_seq_num_ == -1) { |
527 last_packet_seq_num_ = static_cast<int>(packet.seqNum); | 527 last_packet_seq_num_ = static_cast<int>(packet.seqNum); |
528 } else if (last_packet_seq_num_ != -1 && | 528 } else if (last_packet_seq_num_ != -1 && |
529 IsNewerSequenceNumber(packet.seqNum, last_packet_seq_num_)) { | 529 IsNewerSequenceNumber(packet.seqNum, last_packet_seq_num_)) { |
(...skipping 23 matching lines...) Expand all Loading... |
553 if (empty_seq_num_high_ == -1) | 553 if (empty_seq_num_high_ == -1) |
554 empty_seq_num_high_ = seq_num; | 554 empty_seq_num_high_ = seq_num; |
555 else | 555 else |
556 empty_seq_num_high_ = LatestSequenceNumber(seq_num, empty_seq_num_high_); | 556 empty_seq_num_high_ = LatestSequenceNumber(seq_num, empty_seq_num_high_); |
557 if (empty_seq_num_low_ == -1 || IsNewerSequenceNumber(empty_seq_num_low_, | 557 if (empty_seq_num_low_ == -1 || IsNewerSequenceNumber(empty_seq_num_low_, |
558 seq_num)) | 558 seq_num)) |
559 empty_seq_num_low_ = seq_num; | 559 empty_seq_num_low_ = seq_num; |
560 } | 560 } |
561 | 561 |
562 } // namespace webrtc | 562 } // namespace webrtc |
OLD | NEW |