| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 size_t last_packet_reduction_len) | 465 size_t last_packet_reduction_len) |
| 466 : hdr_(hdr), | 466 : hdr_(hdr), |
| 467 max_payload_length_(max_payload_length), | 467 max_payload_length_(max_payload_length), |
| 468 payload_(nullptr), | 468 payload_(nullptr), |
| 469 payload_size_(0), | 469 payload_size_(0), |
| 470 last_packet_reduction_len_(last_packet_reduction_len) {} | 470 last_packet_reduction_len_(last_packet_reduction_len) {} |
| 471 | 471 |
| 472 RtpPacketizerVp9::~RtpPacketizerVp9() { | 472 RtpPacketizerVp9::~RtpPacketizerVp9() { |
| 473 } | 473 } |
| 474 | 474 |
| 475 ProtectionType RtpPacketizerVp9::GetProtectionType() { | |
| 476 bool protect = | |
| 477 hdr_.temporal_idx == 0 || hdr_.temporal_idx == kNoTemporalIdx; | |
| 478 return protect ? kProtectedPacket : kUnprotectedPacket; | |
| 479 } | |
| 480 | |
| 481 StorageType RtpPacketizerVp9::GetStorageType(uint32_t retransmission_settings) { | |
| 482 StorageType storage = kAllowRetransmission; | |
| 483 if (hdr_.temporal_idx == 0 && | |
| 484 !(retransmission_settings & kRetransmitBaseLayer)) { | |
| 485 storage = kDontRetransmit; | |
| 486 } else if (hdr_.temporal_idx != kNoTemporalIdx && hdr_.temporal_idx > 0 && | |
| 487 !(retransmission_settings & kRetransmitHigherLayers)) { | |
| 488 storage = kDontRetransmit; | |
| 489 } | |
| 490 return storage; | |
| 491 } | |
| 492 | |
| 493 std::string RtpPacketizerVp9::ToString() { | 475 std::string RtpPacketizerVp9::ToString() { |
| 494 return "RtpPacketizerVp9"; | 476 return "RtpPacketizerVp9"; |
| 495 } | 477 } |
| 496 | 478 |
| 497 size_t RtpPacketizerVp9::SetPayloadData( | 479 size_t RtpPacketizerVp9::SetPayloadData( |
| 498 const uint8_t* payload, | 480 const uint8_t* payload, |
| 499 size_t payload_size, | 481 size_t payload_size, |
| 500 const RTPFragmentationHeader* fragmentation) { | 482 const RTPFragmentationHeader* fragmentation) { |
| 501 payload_ = payload; | 483 payload_ = payload; |
| 502 payload_size_ = payload_size; | 484 payload_size_ = payload_size; |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 if (parsed_payload->payload_length == 0) { | 756 if (parsed_payload->payload_length == 0) { |
| 775 LOG(LS_ERROR) << "Failed parsing VP9 payload data."; | 757 LOG(LS_ERROR) << "Failed parsing VP9 payload data."; |
| 776 return false; | 758 return false; |
| 777 } | 759 } |
| 778 parsed_payload->payload = | 760 parsed_payload->payload = |
| 779 payload + payload_length - parsed_payload->payload_length; | 761 payload + payload_length - parsed_payload->payload_length; |
| 780 | 762 |
| 781 return true; | 763 return true; |
| 782 } | 764 } |
| 783 } // namespace webrtc | 765 } // namespace webrtc |
| OLD | NEW |