Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | |
| 3 * | |
| 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 | |
| 6 * tree. An additional intellectual property rights grant can be found | |
| 7 * in the file PATENTS. All contributing project authors may | |
| 8 * be found in the AUTHORS file in the root of the source tree. | |
| 9 */ | |
| 10 | |
| 11 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_EXTENDED_JITTER_REPORT_H_ | |
| 12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_EXTENDED_JITTER_REPORT_H_ | |
| 13 | |
| 14 #include <vector> | |
| 15 | |
| 16 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet.h" | |
| 17 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" | |
| 18 | |
| 19 namespace webrtc { | |
| 20 namespace rtcp { | |
| 21 | |
| 22 class ExtendedJitterReport : public RtcpPacket { | |
| 23 public: | |
| 24 static const uint8_t kPacketType = 195; | |
| 25 | |
| 26 ExtendedJitterReport() : RtcpPacket() {} | |
| 27 | |
| 28 virtual ~ExtendedJitterReport() {} | |
| 29 | |
| 30 // Parse assumes header is already parsed and validated. | |
| 31 bool Parse(const RTCPUtility::RtcpCommonHeader& header, | |
| 32 const uint8_t* payload); // Size of the payload is in the header. | |
| 33 | |
| 34 bool WithJitter(uint32_t jitter); | |
| 35 | |
| 36 size_t jitters_count() const { return inter_arrival_jitters_.size(); } | |
| 37 uint32_t jitter(size_t index) const { return inter_arrival_jitters_[index]; } | |
|
åsapersson
2015/11/12 15:44:31
add validation/check of index
danilchap
2015/11/13 09:52:48
Done.
| |
| 38 | |
| 39 protected: | |
| 40 bool Create(uint8_t* packet, | |
| 41 size_t* index, | |
| 42 size_t max_length, | |
| 43 RtcpPacket::PacketReadyCallback* callback) const override; | |
| 44 | |
| 45 private: | |
| 46 static const int kMaxNumberOfJitters = 0x1f; | |
| 47 | |
| 48 size_t BlockLength() const override { | |
| 49 return kHeaderLength + 4 * inter_arrival_jitters_.size(); | |
| 50 } | |
| 51 | |
| 52 std::vector<uint32_t> inter_arrival_jitters_; | |
| 53 | |
| 54 RTC_DISALLOW_COPY_AND_ASSIGN(ExtendedJitterReport); | |
| 55 }; | |
| 56 | |
| 57 } // namespace rtcp | |
| 58 } // namespace webrtc | |
| 59 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_EXTENDED_JITTER_REPORT_H_ | |
| OLD | NEW |