| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MEDIA_CAST_NET_RTCP_NET_RTCP_SENDER_H_ | |
| 6 #define MEDIA_CAST_NET_RTCP_NET_RTCP_SENDER_H_ | |
| 7 | |
| 8 #include <list> | |
| 9 #include <string> | |
| 10 | |
| 11 #include "media/cast/cast_config.h" | |
| 12 #include "media/cast/cast_defines.h" | |
| 13 #include "media/cast/rtcp/rtcp.h" | |
| 14 #include "media/cast/rtcp/rtcp_defines.h" | |
| 15 | |
| 16 namespace media { | |
| 17 namespace cast { | |
| 18 | |
| 19 class RtcpBuilder { | |
| 20 public: | |
| 21 RtcpBuilder(PacedPacketSender* const paced_packet_sender, | |
| 22 uint32 sending_ssrc, | |
| 23 const std::string& c_name); | |
| 24 | |
| 25 virtual ~RtcpBuilder(); | |
| 26 | |
| 27 void SendRtcpFromRtpSender(uint32 packet_type_flags, | |
| 28 const RtcpSenderInfo* sender_info, | |
| 29 const RtcpDlrrReportBlock* dlrr, | |
| 30 RtcpSenderLogMessage* sender_log); | |
| 31 | |
| 32 enum RtcpPacketType { | |
| 33 kRtcpSr = 0x0002, | |
| 34 kRtcpRr = 0x0004, | |
| 35 kRtcpBye = 0x0008, | |
| 36 kRtcpPli = 0x0010, | |
| 37 kRtcpNack = 0x0020, | |
| 38 kRtcpFir = 0x0040, | |
| 39 kRtcpSrReq = 0x0200, | |
| 40 kRtcpDlrr = 0x0400, | |
| 41 kRtcpRrtr = 0x0800, | |
| 42 kRtcpRpsi = 0x8000, | |
| 43 kRtcpRemb = 0x10000, | |
| 44 kRtcpCast = 0x20000, | |
| 45 kRtcpSenderLog = 0x40000, | |
| 46 kRtcpReceiverLog = 0x80000, | |
| 47 }; | |
| 48 | |
| 49 private: | |
| 50 void BuildSR(const RtcpSenderInfo& sender_info, | |
| 51 const RtcpReportBlock* report_block, | |
| 52 std::vector<uint8>* packet) const; | |
| 53 | |
| 54 void AddReportBlocks(const RtcpReportBlock& report_block, | |
| 55 std::vector<uint8>* packet) const; | |
| 56 | |
| 57 void BuildSdec(std::vector<uint8>* packet) const; | |
| 58 | |
| 59 void BuildBye(std::vector<uint8>* packet) const; | |
| 60 | |
| 61 void BuildDlrrRb(const RtcpDlrrReportBlock* dlrr, | |
| 62 std::vector<uint8>* packet) const; | |
| 63 void BuildSenderLog(RtcpSenderLogMessage* sender_log_message, | |
| 64 std::vector<uint8>* packet) const; | |
| 65 | |
| 66 const uint32 ssrc_; | |
| 67 const std::string c_name_; | |
| 68 | |
| 69 // Not owned by this class. | |
| 70 PacedPacketSender* transport_; | |
| 71 | |
| 72 DISALLOW_COPY_AND_ASSIGN(RtcpBuilder); | |
| 73 }; | |
| 74 | |
| 75 } // namespace cast | |
| 76 } // namespace media | |
| 77 | |
| 78 #endif // MEDIA_CAST_NET_RTCP_NET_RTCP_SENDER_H_ | |
| OLD | NEW |