| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 private: | 42 private: |
| 43 uint32_t item_; | 43 uint32_t item_; |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 Sli() {} | 46 Sli() {} |
| 47 ~Sli() override {} | 47 ~Sli() override {} |
| 48 | 48 |
| 49 // Parse assumes header is already parsed and validated. | 49 // Parse assumes header is already parsed and validated. |
| 50 bool Parse(const CommonHeader& packet); | 50 bool Parse(const CommonHeader& packet); |
| 51 | 51 |
| 52 void WithPictureId(uint8_t picture_id, | 52 void AddPictureId(uint8_t picture_id) { |
| 53 uint16_t first_macroblock = 0, | 53 items_.emplace_back(picture_id, 0, 0x1fff); |
| 54 uint16_t number_macroblocks = 0x1fff) { | 54 } |
| 55 items_.push_back( | 55 void AddPictureId(uint8_t picture_id, |
| 56 Macroblocks(picture_id, first_macroblock, number_macroblocks)); | 56 uint16_t first_macroblock, |
| 57 uint16_t number_macroblocks) { |
| 58 items_.emplace_back(picture_id, first_macroblock, number_macroblocks); |
| 57 } | 59 } |
| 58 | 60 |
| 59 const std::vector<Macroblocks>& macroblocks() const { return items_; } | 61 const std::vector<Macroblocks>& macroblocks() const { return items_; } |
| 60 | 62 |
| 61 protected: | 63 protected: |
| 62 bool Create(uint8_t* packet, | 64 bool Create(uint8_t* packet, |
| 63 size_t* index, | 65 size_t* index, |
| 64 size_t max_length, | 66 size_t max_length, |
| 65 RtcpPacket::PacketReadyCallback* callback) const override; | 67 RtcpPacket::PacketReadyCallback* callback) const override; |
| 66 | 68 |
| 67 private: | 69 private: |
| 68 size_t BlockLength() const override { | 70 size_t BlockLength() const override { |
| 69 return RtcpPacket::kHeaderLength + Psfb::kCommonFeedbackLength + | 71 return RtcpPacket::kHeaderLength + Psfb::kCommonFeedbackLength + |
| 70 items_.size() * Macroblocks::kLength; | 72 items_.size() * Macroblocks::kLength; |
| 71 } | 73 } |
| 72 | 74 |
| 73 std::vector<Macroblocks> items_; | 75 std::vector<Macroblocks> items_; |
| 74 | 76 |
| 75 RTC_DISALLOW_COPY_AND_ASSIGN(Sli); | 77 RTC_DISALLOW_COPY_AND_ASSIGN(Sli); |
| 76 }; | 78 }; |
| 77 | 79 |
| 78 } // namespace rtcp | 80 } // namespace rtcp |
| 79 } // namespace webrtc | 81 } // namespace webrtc |
| 80 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_SLI_H_ | 82 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_SLI_H_ |
| OLD | NEW |