| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 LOG(LS_WARNING) << "Payload length " << header.payload_size_bytes | 56 LOG(LS_WARNING) << "Payload length " << header.payload_size_bytes |
| 57 << " is not valid for TMMBN."; | 57 << " is not valid for TMMBN."; |
| 58 return false; | 58 return false; |
| 59 } | 59 } |
| 60 ParseCommonFeedback(payload); | 60 ParseCommonFeedback(payload); |
| 61 const uint8_t* next_item = payload + kCommonFeedbackLength; | 61 const uint8_t* next_item = payload + kCommonFeedbackLength; |
| 62 | 62 |
| 63 size_t number_of_items = items_size_bytes / TmmbItem::kLength; | 63 size_t number_of_items = items_size_bytes / TmmbItem::kLength; |
| 64 items_.resize(number_of_items); | 64 items_.resize(number_of_items); |
| 65 for (TmmbItem& item : items_) { | 65 for (TmmbItem& item : items_) { |
| 66 item.Parse(next_item); | 66 if (!item.Parse(next_item)) |
| 67 return false; |
| 67 next_item += TmmbItem::kLength; | 68 next_item += TmmbItem::kLength; |
| 68 } | 69 } |
| 69 return true; | 70 return true; |
| 70 } | 71 } |
| 71 | 72 |
| 72 void Tmmbn::WithTmmbr(const TmmbItem& item) { | 73 void Tmmbn::WithTmmbr(const TmmbItem& item) { |
| 73 items_.push_back(item); | 74 items_.push_back(item); |
| 74 } | 75 } |
| 75 | 76 |
| 76 bool Tmmbn::Create(uint8_t* packet, | 77 bool Tmmbn::Create(uint8_t* packet, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 90 *index += kCommonFeedbackLength; | 91 *index += kCommonFeedbackLength; |
| 91 for (const TmmbItem& item : items_) { | 92 for (const TmmbItem& item : items_) { |
| 92 item.Create(packet + *index); | 93 item.Create(packet + *index); |
| 93 *index += TmmbItem::kLength; | 94 *index += TmmbItem::kLength; |
| 94 } | 95 } |
| 95 RTC_CHECK_EQ(index_end, *index); | 96 RTC_CHECK_EQ(index_end, *index); |
| 96 return true; | 97 return true; |
| 97 } | 98 } |
| 98 } // namespace rtcp | 99 } // namespace rtcp |
| 99 } // namespace webrtc | 100 } // namespace webrtc |
| OLD | NEW |