| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  *  Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2  *  Copyright (c) 2014 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  */ | 
| 11 | 11 | 
| 12 #ifndef WEBRTC_TEST_RTCP_PACKET_PARSER_H_ | 12 #ifndef WEBRTC_TEST_RTCP_PACKET_PARSER_H_ | 
| 13 #define WEBRTC_TEST_RTCP_PACKET_PARSER_H_ | 13 #define WEBRTC_TEST_RTCP_PACKET_PARSER_H_ | 
| 14 | 14 | 
|  | 15 #include "webrtc/base/array_view.h" | 
|  | 16 #include "webrtc/base/checks.h" | 
| 15 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/app.h" | 17 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/app.h" | 
| 16 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.h" | 18 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.h" | 
| 17 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/common_header.h" | 19 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/common_header.h" | 
| 18 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_jitter_report.h" | 20 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_jitter_report.h" | 
| 19 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_reports.h" | 21 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_reports.h" | 
| 20 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/fir.h" | 22 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/fir.h" | 
| 21 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/nack.h" | 23 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/nack.h" | 
| 22 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/pli.h" | 24 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/pli.h" | 
| 23 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/rapid_resync_request.h" | 25 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/rapid_resync_request.h" | 
| 24 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/receiver_report.h" | 26 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/receiver_report.h" | 
| 25 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/remb.h" | 27 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/remb.h" | 
| 26 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sdes.h" | 28 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sdes.h" | 
| 27 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sender_report.h" | 29 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sender_report.h" | 
| 28 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbn.h" | 30 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbn.h" | 
| 29 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbr.h" | 31 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbr.h" | 
| 30 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h" | 32 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h" | 
| 31 #include "webrtc/rtc_base/array_view.h" |  | 
| 32 #include "webrtc/rtc_base/checks.h" |  | 
| 33 | 33 | 
| 34 namespace webrtc { | 34 namespace webrtc { | 
| 35 namespace test { | 35 namespace test { | 
| 36 // Parse RTCP packet of given type. Assumes RTCP header is valid and that there | 36 // Parse RTCP packet of given type. Assumes RTCP header is valid and that there | 
| 37 // is excatly one packet of correct type in the buffer. | 37 // is excatly one packet of correct type in the buffer. | 
| 38 template <typename Packet> | 38 template <typename Packet> | 
| 39 bool ParseSinglePacket(const uint8_t* buffer, size_t size, Packet* packet) { | 39 bool ParseSinglePacket(const uint8_t* buffer, size_t size, Packet* packet) { | 
| 40   rtcp::CommonHeader header; | 40   rtcp::CommonHeader header; | 
| 41   RTC_CHECK(header.Parse(buffer, size)); | 41   RTC_CHECK(header.Parse(buffer, size)); | 
| 42   RTC_CHECK_EQ(size, header.NextPacket() - buffer); | 42   RTC_CHECK_EQ(size, header.NextPacket() - buffer); | 
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 112   PacketCounter<rtcp::SenderReport> sender_report_; | 112   PacketCounter<rtcp::SenderReport> sender_report_; | 
| 113   PacketCounter<rtcp::Tmmbn> tmmbn_; | 113   PacketCounter<rtcp::Tmmbn> tmmbn_; | 
| 114   PacketCounter<rtcp::Tmmbr> tmmbr_; | 114   PacketCounter<rtcp::Tmmbr> tmmbr_; | 
| 115   PacketCounter<rtcp::TransportFeedback> transport_feedback_; | 115   PacketCounter<rtcp::TransportFeedback> transport_feedback_; | 
| 116   uint32_t sender_ssrc_ = 0; | 116   uint32_t sender_ssrc_ = 0; | 
| 117 }; | 117 }; | 
| 118 | 118 | 
| 119 }  // namespace test | 119 }  // namespace test | 
| 120 }  // namespace webrtc | 120 }  // namespace webrtc | 
| 121 #endif  // WEBRTC_TEST_RTCP_PACKET_PARSER_H_ | 121 #endif  // WEBRTC_TEST_RTCP_PACKET_PARSER_H_ | 
| OLD | NEW | 
|---|