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 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
730 | 730 |
731 uint32_t rtt_ntp = now - delay_rr - send_time; | 731 uint32_t rtt_ntp = now - delay_rr - send_time; |
732 xr_rr_rtt_ms_ = CompactNtpRttToMs(rtt_ntp); | 732 xr_rr_rtt_ms_ = CompactNtpRttToMs(rtt_ntp); |
733 } | 733 } |
734 | 734 |
735 void RTCPReceiver::HandleXrTargetBitrate( | 735 void RTCPReceiver::HandleXrTargetBitrate( |
736 const rtcp::TargetBitrate& target_bitrate, | 736 const rtcp::TargetBitrate& target_bitrate, |
737 PacketInformation* packet_information) { | 737 PacketInformation* packet_information) { |
738 BitrateAllocation bitrate_allocation; | 738 BitrateAllocation bitrate_allocation; |
739 for (const auto& item : target_bitrate.GetTargetBitrates()) { | 739 for (const auto& item : target_bitrate.GetTargetBitrates()) { |
740 bitrate_allocation.SetBitrate(item.spatial_layer, item.temporal_layer, | 740 if (item.spatial_layer >= kMaxSpatialLayers || |
danilchap
2016/12/06 13:12:56
may be #include "webrtc/common_types.h" directly f
sprang_webrtc
2016/12/06 13:22:41
Done.
| |
741 item.target_bitrate_kbps * 1000); | 741 item.temporal_layer >= kMaxTemporalStreams) { |
742 LOG(LS_WARNING) | |
743 << "Invalid layer in XR target bitrate pack: spatial index " | |
744 << item.spatial_layer << ", temporal index " << item.temporal_layer | |
745 << ", dropping."; | |
746 } else { | |
747 bitrate_allocation.SetBitrate(item.spatial_layer, item.temporal_layer, | |
748 item.target_bitrate_kbps * 1000); | |
749 } | |
742 } | 750 } |
743 packet_information->target_bitrate_allocation.emplace(bitrate_allocation); | 751 packet_information->target_bitrate_allocation.emplace(bitrate_allocation); |
744 } | 752 } |
745 | 753 |
746 void RTCPReceiver::HandlePLI(const CommonHeader& rtcp_block, | 754 void RTCPReceiver::HandlePLI(const CommonHeader& rtcp_block, |
747 PacketInformation* packet_information) { | 755 PacketInformation* packet_information) { |
748 rtcp::Pli pli; | 756 rtcp::Pli pli; |
749 if (!pli.Parse(rtcp_block)) { | 757 if (!pli.Parse(rtcp_block)) { |
750 ++num_skipped_packets_; | 758 ++num_skipped_packets_; |
751 return; | 759 return; |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1075 } else { | 1083 } else { |
1076 candidates.push_back(it->second.tmmbr_item); | 1084 candidates.push_back(it->second.tmmbr_item); |
1077 ++it; | 1085 ++it; |
1078 } | 1086 } |
1079 } | 1087 } |
1080 } | 1088 } |
1081 return candidates; | 1089 return candidates; |
1082 } | 1090 } |
1083 | 1091 |
1084 } // namespace webrtc | 1092 } // namespace webrtc |
OLD | NEW |