| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 LOG(LS_WARNING) << "Payload length " << header.payload_size_bytes | 57 LOG(LS_WARNING) << "Payload length " << header.payload_size_bytes |
| 58 << " is not valid for a TMMBR."; | 58 << " is not valid for a TMMBR."; |
| 59 return false; | 59 return false; |
| 60 } | 60 } |
| 61 ParseCommonFeedback(payload); | 61 ParseCommonFeedback(payload); |
| 62 | 62 |
| 63 const uint8_t* next_item = payload + kCommonFeedbackLength; | 63 const uint8_t* next_item = payload + kCommonFeedbackLength; |
| 64 size_t number_of_items = items_size_bytes / TmmbItem::kLength; | 64 size_t number_of_items = items_size_bytes / TmmbItem::kLength; |
| 65 items_.resize(number_of_items); | 65 items_.resize(number_of_items); |
| 66 for (TmmbItem& item : items_) { | 66 for (TmmbItem& item : items_) { |
| 67 item.Parse(next_item); | 67 if (!item.Parse(next_item)) |
| 68 return false; |
| 68 next_item += TmmbItem::kLength; | 69 next_item += TmmbItem::kLength; |
| 69 } | 70 } |
| 70 return true; | 71 return true; |
| 71 } | 72 } |
| 72 | 73 |
| 73 void Tmmbr::WithTmmbr(const TmmbItem& item) { | 74 void Tmmbr::WithTmmbr(const TmmbItem& item) { |
| 74 items_.push_back(item); | 75 items_.push_back(item); |
| 75 } | 76 } |
| 76 | 77 |
| 77 bool Tmmbr::Create(uint8_t* packet, | 78 bool Tmmbr::Create(uint8_t* packet, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 92 *index += kCommonFeedbackLength; | 93 *index += kCommonFeedbackLength; |
| 93 for (const TmmbItem& item : items_) { | 94 for (const TmmbItem& item : items_) { |
| 94 item.Create(packet + *index); | 95 item.Create(packet + *index); |
| 95 *index += TmmbItem::kLength; | 96 *index += TmmbItem::kLength; |
| 96 } | 97 } |
| 97 RTC_CHECK_EQ(index_end, *index); | 98 RTC_CHECK_EQ(index_end, *index); |
| 98 return true; | 99 return true; |
| 99 } | 100 } |
| 100 } // namespace rtcp | 101 } // namespace rtcp |
| 101 } // namespace webrtc | 102 } // namespace webrtc |
| OLD | NEW |