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

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

Issue 2348623003: Unify rtcp packet setters (Closed)
Patch Set: Comments Created 4 years, 3 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) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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
23 class ExtendedJitterReport : public RtcpPacket { 23 class ExtendedJitterReport : public RtcpPacket {
24 public: 24 public:
25 static constexpr uint8_t kPacketType = 195; 25 static constexpr uint8_t kPacketType = 195;
26 26
27 ExtendedJitterReport() {} 27 ExtendedJitterReport() {}
28 ~ExtendedJitterReport() override {} 28 ~ExtendedJitterReport() override {}
29 29
30 // Parse assumes header is already parsed and validated. 30 // Parse assumes header is already parsed and validated.
31 bool Parse(const CommonHeader& packet); 31 bool Parse(const CommonHeader& packet);
32 32
33 bool WithJitter(uint32_t jitter); 33 bool SetJitters(std::vector<uint32_t> jitters);
sprang_webrtc 2016/09/16 15:37:33 nit: "jitters" is a somewhat overloaded word. Coul
danilchap 2016/09/16 16:27:49 how about jitter_value? (item feels too big for si
sprang_webrtc 2016/09/18 19:13:58 Sure!
34 34
35 const std::vector<uint32_t>& jitters() { return inter_arrival_jitters_; } 35 const std::vector<uint32_t>& jitters() { return inter_arrival_jitters_; }
36 36
37 protected: 37 protected:
38 bool Create(uint8_t* packet, 38 bool Create(uint8_t* packet,
39 size_t* index, 39 size_t* index,
40 size_t max_length, 40 size_t max_length,
41 RtcpPacket::PacketReadyCallback* callback) const override; 41 RtcpPacket::PacketReadyCallback* callback) const override;
42 42
43 private: 43 private:
44 static constexpr size_t kMaxNumberOfJitters = 0x1f; 44 static constexpr size_t kMaxNumberOfJitters = 0x1f;
45 static constexpr size_t kJitterSizeBytes = 4; 45 static constexpr size_t kJitterSizeBytes = 4;
46 46
47 size_t BlockLength() const override { 47 size_t BlockLength() const override {
48 return kHeaderLength + kJitterSizeBytes * inter_arrival_jitters_.size(); 48 return kHeaderLength + kJitterSizeBytes * inter_arrival_jitters_.size();
49 } 49 }
50 50
51 std::vector<uint32_t> inter_arrival_jitters_; 51 std::vector<uint32_t> inter_arrival_jitters_;
52 52
53 RTC_DISALLOW_COPY_AND_ASSIGN(ExtendedJitterReport); 53 RTC_DISALLOW_COPY_AND_ASSIGN(ExtendedJitterReport);
54 }; 54 };
55 55
56 } // namespace rtcp 56 } // namespace rtcp
57 } // namespace webrtc 57 } // namespace webrtc
58 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_EXTENDED_JITTER_REPORT_H_ 58 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_EXTENDED_JITTER_REPORT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698