OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // A very simple packet builder class for building RTCP packets. | 5 // A very simple packet builder class for building RTCP packets. |
6 // Used for testing only. | 6 // Used for testing only. |
7 #ifndef MEDIA_CAST_RTCP_TEST_RTCP_PACKET_BUILDER_H_ | 7 #ifndef MEDIA_CAST_RTCP_TEST_RTCP_PACKET_BUILDER_H_ |
8 #define MEDIA_CAST_RTCP_TEST_RTCP_PACKET_BUILDER_H_ | 8 #define MEDIA_CAST_RTCP_TEST_RTCP_PACKET_BUILDER_H_ |
9 | 9 |
10 #include "media/cast/rtcp/rtcp_defines.h" | 10 #include "media/cast/rtcp/rtcp_defines.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 void AddXrRrtrBlock(); | 68 void AddXrRrtrBlock(); |
69 void AddXrUnknownBlock(); | 69 void AddXrUnknownBlock(); |
70 | 70 |
71 void AddNack(uint32 sender_ssrc, uint32 media_ssrc); | 71 void AddNack(uint32 sender_ssrc, uint32 media_ssrc); |
72 void AddSendReportRequest(uint32 sender_ssrc, uint32 media_ssrc); | 72 void AddSendReportRequest(uint32 sender_ssrc, uint32 media_ssrc); |
73 | 73 |
74 void AddPli(uint32 sender_ssrc, uint32 media_ssrc); | 74 void AddPli(uint32 sender_ssrc, uint32 media_ssrc); |
75 void AddRpsi(uint32 sender_ssrc, uint32 media_ssrc); | 75 void AddRpsi(uint32 sender_ssrc, uint32 media_ssrc); |
76 void AddRemb(uint32 sender_ssrc, uint32 media_ssrc); | 76 void AddRemb(uint32 sender_ssrc, uint32 media_ssrc); |
77 void AddCast(uint32 sender_ssrc, uint32 media_ssrc); | 77 void AddCast(uint32 sender_ssrc, uint32 media_ssrc); |
| 78 void AddSenderLog(uint32 sender_ssrc); |
| 79 void AddSenderFrameLog(uint8 event_id, uint32 rtp_timestamp); |
| 80 void AddReceiverLog(uint32 sender_ssrc); |
| 81 void AddReceiverFrameLog(uint32 rtp_timestamp, int num_events, |
| 82 uint32 event_timesamp_base); |
| 83 void AddReceiverEventLog(uint16 event_data, uint8 event_id, |
| 84 uint16 event_timesamp_delta); |
78 | 85 |
79 const uint8* Packet(); | 86 const uint8* Packet(); |
80 int Length() { return kIpPacketSize - big_endian_writer_.remaining(); } | 87 int Length() { return kIpPacketSize - big_endian_writer_.remaining(); } |
81 | 88 |
82 private: | 89 private: |
83 void AddRtcpHeader(int payload, int format_or_count); | 90 void AddRtcpHeader(int payload, int format_or_count); |
84 void PatchLengthField(); | 91 void PatchLengthField(); |
85 | 92 |
86 // Where the length field of the current packet is. | 93 // Where the length field of the current packet is. |
87 // Note: 0 is not a legal value, it is used for "uninitialized". | 94 // Note: 0 is not a legal value, it is used for "uninitialized". |
88 uint8 buffer_[kIpPacketSize]; | 95 uint8 buffer_[kIpPacketSize]; |
89 char* ptr_of_length_; | 96 char* ptr_of_length_; |
90 net::BigEndianWriter big_endian_writer_; | 97 net::BigEndianWriter big_endian_writer_; |
91 }; | 98 }; |
92 | 99 |
93 } // namespace cast | 100 } // namespace cast |
94 } // namespace media | 101 } // namespace media |
95 | 102 |
96 #endif // MEDIA_CAST_RTCP_TEST_RTCP_PACKET_BUILDER_H_ | 103 #endif // MEDIA_CAST_RTCP_TEST_RTCP_PACKET_BUILDER_H_ |
OLD | NEW |