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 12 matching lines...) Expand all Loading... |
23 class Fir : public Psfb { | 23 class Fir : public Psfb { |
24 public: | 24 public: |
25 static constexpr uint8_t kFeedbackMessageType = 4; | 25 static constexpr uint8_t kFeedbackMessageType = 4; |
26 struct Request { | 26 struct Request { |
27 Request() : ssrc(0), seq_nr(0) {} | 27 Request() : ssrc(0), seq_nr(0) {} |
28 Request(uint32_t ssrc, uint8_t seq_nr) : ssrc(ssrc), seq_nr(seq_nr) {} | 28 Request(uint32_t ssrc, uint8_t seq_nr) : ssrc(ssrc), seq_nr(seq_nr) {} |
29 uint32_t ssrc; | 29 uint32_t ssrc; |
30 uint8_t seq_nr; | 30 uint8_t seq_nr; |
31 }; | 31 }; |
32 | 32 |
33 Fir() {} | 33 Fir(); |
34 ~Fir() override {} | 34 ~Fir() override; |
35 | 35 |
36 // Parse assumes header is already parsed and validated. | 36 // Parse assumes header is already parsed and validated. |
37 bool Parse(const CommonHeader& packet); | 37 bool Parse(const CommonHeader& packet); |
38 | 38 |
39 void AddRequestTo(uint32_t ssrc, uint8_t seq_num) { | 39 void AddRequestTo(uint32_t ssrc, uint8_t seq_num) { |
40 items_.emplace_back(ssrc, seq_num); | 40 items_.emplace_back(ssrc, seq_num); |
41 } | 41 } |
42 const std::vector<Request>& requests() const { return items_; } | 42 const std::vector<Request>& requests() const { return items_; } |
43 | 43 |
44 protected: | 44 size_t BlockLength() const override; |
| 45 |
45 bool Create(uint8_t* packet, | 46 bool Create(uint8_t* packet, |
46 size_t* index, | 47 size_t* index, |
47 size_t max_length, | 48 size_t max_length, |
48 RtcpPacket::PacketReadyCallback* callback) const override; | 49 RtcpPacket::PacketReadyCallback* callback) const override; |
49 | 50 |
50 private: | 51 private: |
51 static constexpr size_t kFciLength = 8; | 52 static constexpr size_t kFciLength = 8; |
52 size_t BlockLength() const override { | 53 |
53 return kHeaderLength + kCommonFeedbackLength + kFciLength * items_.size(); | |
54 } | |
55 // SSRC of media source is not used in FIR packet. Shadow base functions. | 54 // SSRC of media source is not used in FIR packet. Shadow base functions. |
56 void SetMediaSsrc(uint32_t ssrc); | 55 void SetMediaSsrc(uint32_t ssrc); |
57 uint32_t media_ssrc() const; | 56 uint32_t media_ssrc() const; |
58 | 57 |
59 std::vector<Request> items_; | 58 std::vector<Request> items_; |
60 }; | 59 }; |
61 } // namespace rtcp | 60 } // namespace rtcp |
62 } // namespace webrtc | 61 } // namespace webrtc |
63 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_FIR_H_ | 62 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_FIR_H_ |
OLD | NEW |