Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtcp_packet/fir.h

Issue 2370313002: Reland of Unify rtcp packet setters (Closed)
Patch Set: Fix breaking mistype Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 18 matching lines...) Expand all
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 WithRequestTo(uint32_t ssrc, uint8_t seq_num) { 39 void AddRequestTo(uint32_t ssrc, uint8_t seq_num) {
40 items_.push_back(Request(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 protected:
45 bool Create(uint8_t* packet, 45 bool Create(uint8_t* packet,
46 size_t* index, 46 size_t* index,
47 size_t max_length, 47 size_t max_length,
48 RtcpPacket::PacketReadyCallback* callback) const override; 48 RtcpPacket::PacketReadyCallback* callback) const override;
49 49
50 private: 50 private:
51 static constexpr size_t kFciLength = 8; 51 static constexpr size_t kFciLength = 8;
52 size_t BlockLength() const override { 52 size_t BlockLength() const override {
53 return kHeaderLength + kCommonFeedbackLength + kFciLength * items_.size(); 53 return kHeaderLength + kCommonFeedbackLength + kFciLength * items_.size();
54 } 54 }
55 // SSRC of media source is not used in FIR packet. Shadow base functions. 55 // SSRC of media source is not used in FIR packet. Shadow base functions.
56 void To(uint32_t ssrc); 56 void SetMediaSsrc(uint32_t ssrc);
57 uint32_t media_ssrc() const; 57 uint32_t media_ssrc() const;
58 58
59 std::vector<Request> items_; 59 std::vector<Request> items_;
60 }; 60 };
61 } // namespace rtcp 61 } // namespace rtcp
62 } // namespace webrtc 62 } // namespace webrtc
63 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_FIR_H_ 63 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_FIR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698