Chromium Code Reviews| Index: media/cast/net/rtcp/rtcp_builder.h |
| diff --git a/media/cast/net/rtcp/rtcp_sender.h b/media/cast/net/rtcp/rtcp_builder.h |
| similarity index 58% |
| rename from media/cast/net/rtcp/rtcp_sender.h |
| rename to media/cast/net/rtcp/rtcp_builder.h |
| index 06b11d4844518188fa65a7ed21a27d3543a79683..92d742adbc889d8e874723ea1d88672e860ae9f2 100644 |
| --- a/media/cast/net/rtcp/rtcp_sender.h |
| +++ b/media/cast/net/rtcp/rtcp_builder.h |
| @@ -2,13 +2,14 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef MEDIA_CAST_NET_RTCP_RTCP_SENDER_H_ |
| -#define MEDIA_CAST_NET_RTCP_RTCP_SENDER_H_ |
| +#ifndef MEDIA_CAST_NET_RTCP_RTCP_BUILDER_H_ |
| +#define MEDIA_CAST_NET_RTCP_RTCP_BUILDER_H_ |
| #include <deque> |
| #include <list> |
| #include <string> |
| +#include "base/big_endian.h" |
| #include "media/cast/cast_config.h" |
| #include "media/cast/cast_defines.h" |
| #include "media/cast/net/cast_transport_defines.h" |
| @@ -38,67 +39,51 @@ COMPILE_ASSERT(kSecondRedundancyOffset > |
| kReceiveLogMessageHistorySize, |
| redundancy_offset_out_of_range); |
| -class PacedPacketSender; |
| -// TODO(hclam): This should be renamed to RtcpPacketBuilder. The function |
| -// of this class is to only to build a RTCP packet but not to send it. |
| -class RtcpSender { |
| +class RtcpBuilder { |
| public: |
| - RtcpSender(PacedPacketSender* outgoing_transport, |
| - uint32 sending_ssrc); |
| - ~RtcpSender(); |
| + RtcpBuilder(uint32 sending_ssrc); |
|
miu
2014/09/03 22:28:07
Need explicit keyword.
hubbe
2014/09/04 22:21:19
Done.
|
| + ~RtcpBuilder(); |
| - // TODO(hclam): This method should be to build a packet instead of |
| - // sending it. |
| - void SendRtcpFromRtpReceiver( |
| + PacketRef BuildRtcpFromReceiver( |
| const RtcpReportBlock* report_block, |
| const RtcpReceiverReferenceTimeReport* rrtr, |
| const RtcpCastMessage* cast_message, |
| const ReceiverRtcpEventSubscriber::RtcpEventMultiMap* rtcp_events, |
| base::TimeDelta target_delay); |
| - // TODO(hclam): This method should be to build a packet instead of |
| - // sending it. |
| - void SendRtcpFromRtpSender(const RtcpSenderInfo& sender_info); |
| + PacketRef BuildRtcpFromSender(const RtcpSenderInfo& sender_info); |
| - private: |
| - void BuildRR(const RtcpReportBlock* report_block, |
| - Packet* packet) const; |
| - |
| - void AddReportBlocks(const RtcpReportBlock& report_block, |
| - Packet* packet) const; |
| - |
| - void BuildRrtr(const RtcpReceiverReferenceTimeReport* rrtr, |
| - Packet* packet) const; |
| + protected: |
|
miu
2014/09/03 22:28:07
Is there a subclass that needs access to these?
hubbe
2014/09/04 22:21:19
The idea was for the rtcp_test_builder to use it,
miu
2014/09/05 18:22:37
I think you meant to s/protected:/private:/ here.
hubbe
2014/09/05 20:53:39
Done.
|
| + void AddRtcpHeader(RtcpPacketFields payload, int format_or_count); |
| + void PatchLengthField(); |
| + base::BigEndianWriter writer_; |
| + private: |
| + void BuildRR(const RtcpReportBlock* report_block); |
| + void AddReportBlocks(const RtcpReportBlock& report_block); |
|
miu
2014/09/03 22:28:07
nit: Some of these methods are called BuildBLAH()
hubbe
2014/09/04 22:21:19
Build->Add (plus some other minor renamings)
|
| + void BuildRrtr(const RtcpReceiverReferenceTimeReport* rrtr); |
| void BuildCast(const RtcpCastMessage* cast_message, |
| - base::TimeDelta target_delay, |
| - Packet* packet) const; |
| - |
| - void BuildSR(const RtcpSenderInfo& sender_info, Packet* packet) const; |
| - |
| - void BuildDlrrRb(const RtcpDlrrReportBlock& dlrr, Packet* packet) const; |
| - |
| + base::TimeDelta target_delay); |
| + void BuildSR(const RtcpSenderInfo& sender_info); |
| + void BuildDlrrRb(const RtcpDlrrReportBlock& dlrr); |
| void BuildReceiverLog( |
| - const ReceiverRtcpEventSubscriber::RtcpEventMultiMap& rtcp_events, |
| - Packet* packet); |
| + const ReceiverRtcpEventSubscriber::RtcpEventMultiMap& rtcp_events); |
| bool BuildRtcpReceiverLogMessage( |
| const ReceiverRtcpEventSubscriber::RtcpEventMultiMap& rtcp_events, |
| - size_t start_size, |
| RtcpReceiverLogMessage* receiver_log_message, |
| - size_t* number_of_frames, |
| - size_t* total_number_of_messages_to_send, |
| - size_t* rtcp_log_size); |
| + size_t* total_number_of_messages_to_send); |
| - const uint32 ssrc_; |
| - |
| - // Not owned by this class. |
| - PacedPacketSender* const transport_; |
| + void Start(); |
| + PacketRef Finish(); |
| + const uint32 ssrc_; |
| + char* ptr_of_length_; |
| + PacketRef packet_; |
| std::deque<RtcpReceiverLogMessage> rtcp_events_history_; |
| - DISALLOW_COPY_AND_ASSIGN(RtcpSender); |
| + DISALLOW_COPY_AND_ASSIGN(RtcpBuilder); |
| }; |
| } // namespace cast |