1 // Copyright 2014 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.
5 #ifndef MEDIA_CAST_NET_RTCP_RTCP_BUILDER_H_
6 #define MEDIA_CAST_NET_RTCP_RTCP_BUILDER_H_
12 #include "base/big_endian.h"
13 #include "media/cast/cast_config.h"
14 #include "media/cast/cast_defines.h"
15 #include "media/cast/net/cast_transport_defines.h"
16 #include "media/cast/net/rtcp/receiver_rtcp_event_subscriber.h"
17 #include "media/cast/net/rtcp/rtcp_defines.h"
24 explicit RtcpBuilder(uint32 sending_ssrc
);
27 PacketRef
BuildRtcpFromReceiver(
28 const RtcpReportBlock
* report_block
,
29 const RtcpReceiverReferenceTimeReport
* rrtr
,
30 const RtcpCastMessage
* cast_message
,
31 const ReceiverRtcpEventSubscriber::RtcpEvents
* rtcp_events
,
32 base::TimeDelta target_delay
);
34 PacketRef
BuildRtcpFromSender(const RtcpSenderInfo
& sender_info
);
37 void AddRtcpHeader(RtcpPacketFields payload
, int format_or_count
);
38 void PatchLengthField();
39 void AddRR(const RtcpReportBlock
* report_block
);
40 void AddReportBlocks(const RtcpReportBlock
& report_block
);
41 void AddRrtr(const RtcpReceiverReferenceTimeReport
* rrtr
);
42 void AddCast(const RtcpCastMessage
* cast_message
,
43 base::TimeDelta target_delay
);
44 void AddSR(const RtcpSenderInfo
& sender_info
);
45 void AddDlrrRb(const RtcpDlrrReportBlock
& dlrr
);
47 const ReceiverRtcpEventSubscriber::RtcpEvents
& rtcp_events
);
49 bool GetRtcpReceiverLogMessage(
50 const ReceiverRtcpEventSubscriber::RtcpEvents
& rtcp_events
,
51 RtcpReceiverLogMessage
* receiver_log_message
,
52 size_t* total_number_of_messages_to_send
);
57 base::BigEndianWriter writer_
;
62 DISALLOW_COPY_AND_ASSIGN(RtcpBuilder
);
68 #endif // MEDIA_CAST_NET_RTCP_RTCP_SENDER_H_