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_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_H_ | 12 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_H_ |
13 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_H_ | 13 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_H_ |
14 | 14 |
15 #include "webrtc/base/buffer.h" | 15 #include "webrtc/base/buffer.h" |
16 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" | 16 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" |
17 | 17 |
18 namespace webrtc { | 18 namespace webrtc { |
19 namespace rtcp { | 19 namespace rtcp { |
20 // Class for building RTCP packets. | 20 // Class for building RTCP packets. |
21 // | 21 // |
22 // Example: | 22 // Example: |
23 // ReportBlock report_block; | 23 // ReportBlock report_block; |
24 // report_block.To(234); | 24 // report_block.SetMediaSsrc(234); |
25 // report_block.WithFractionLost(10); | 25 // report_block.SetFractionLost(10); |
26 // | 26 // |
27 // ReceiverReport rr; | 27 // ReceiverReport rr; |
28 // rr.From(123); | 28 // rr.SetSenderSsrc(123); |
29 // rr.WithReportBlock(report_block); | 29 // rr.AddReportBlock(report_block); |
30 // | 30 // |
31 // Fir fir; | 31 // Fir fir; |
32 // fir.From(123); | 32 // fir.SetSenderSsrc(123); |
33 // fir.WithRequestTo(234, 56); | 33 // fir.AddRequestTo(234, 56); |
34 // | 34 // |
35 // size_t length = 0; // Builds an intra frame request | 35 // size_t length = 0; // Builds an intra frame request |
36 // uint8_t packet[kPacketSize]; // with sequence number 56. | 36 // uint8_t packet[kPacketSize]; // with sequence number 56. |
37 // fir.Build(packet, &length, kPacketSize); | 37 // fir.Build(packet, &length, kPacketSize); |
38 // | 38 // |
39 // rtc::Buffer packet = fir.Build(); // Returns a RawPacket holding | 39 // rtc::Buffer packet = fir.Build(); // Returns a RawPacket holding |
40 // // the built rtcp packet. | 40 // // the built rtcp packet. |
41 // | 41 // |
42 // CompoundPacket compound; // Builds a compound RTCP packet with | 42 // CompoundPacket compound; // Builds a compound RTCP packet with |
43 // compound.Append(&rr); // a receiver report, report block | 43 // compound.Append(&rr); // a receiver report, report block |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 size_t* index, | 98 size_t* index, |
99 RtcpPacket::PacketReadyCallback* callback) const; | 99 RtcpPacket::PacketReadyCallback* callback) const; |
100 | 100 |
101 size_t HeaderLength() const; | 101 size_t HeaderLength() const; |
102 | 102 |
103 static const size_t kHeaderLength = 4; | 103 static const size_t kHeaderLength = 4; |
104 }; | 104 }; |
105 } // namespace rtcp | 105 } // namespace rtcp |
106 } // namespace webrtc | 106 } // namespace webrtc |
107 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_H_ | 107 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_H_ |
OLD | NEW |