Chromium Code Reviews| Index: media/cast/net/rtcp/rtcp_sender.cc |
| diff --git a/media/cast/net/rtcp/rtcp_sender.cc b/media/cast/net/rtcp/rtcp_sender.cc |
| index 244c4d3983aee3cb7dd611e2d8e0e35b99ed9c64..0960c7e58ef39f60c4f1a0f4d084b7fe2405c382 100644 |
| --- a/media/cast/net/rtcp/rtcp_sender.cc |
| +++ b/media/cast/net/rtcp/rtcp_sender.cc |
| @@ -154,32 +154,21 @@ RtcpSender::RtcpSender(PacedPacketSender* outgoing_transport, |
| RtcpSender::~RtcpSender() {} |
| void RtcpSender::SendRtcpFromRtpReceiver( |
| - uint32 packet_type_flags, |
| const RtcpReportBlock* report_block, |
| const RtcpReceiverReferenceTimeReport* rrtr, |
| const RtcpCastMessage* cast_message, |
| const ReceiverRtcpEventSubscriber::RtcpEventMultiMap* rtcp_events, |
| base::TimeDelta target_delay) { |
| - if (packet_type_flags & kRtcpDlrr) { |
| - NOTREACHED() << "Invalid argument"; |
| - } |
| PacketRef packet(new base::RefCountedData<Packet>); |
| packet->data.reserve(kMaxIpPacketSize); |
| - if (packet_type_flags & kRtcpRr) { |
| + if (report_block) |
| BuildRR(report_block, &packet->data); |
| - } |
| - if (packet_type_flags & kRtcpRrtr) { |
| - DCHECK(rrtr) << "Invalid argument"; |
| + if (rrtr) |
| BuildRrtr(rrtr, &packet->data); |
| - } |
| - if (packet_type_flags & kRtcpCast) { |
| - DCHECK(cast_message) << "Invalid argument"; |
| + if (cast_message) |
| BuildCast(cast_message, target_delay, &packet->data); |
| - } |
| - if (packet_type_flags & kRtcpReceiverLog) { |
| - DCHECK(rtcp_events) << "Invalid argument"; |
| + if (rtcp_events) |
| BuildReceiverLog(*rtcp_events, &packet->data); |
| - } |
| if (packet->data.empty()) { |
| NOTREACHED() << "Empty packet."; |
| @@ -190,23 +179,15 @@ void RtcpSender::SendRtcpFromRtpReceiver( |
| } |
| void RtcpSender::SendRtcpFromRtpSender( |
| - uint32 packet_type_flags, |
| - const RtcpSenderInfo& sender_info, |
| - const RtcpDlrrReportBlock& dlrr) { |
| - if (packet_type_flags & kRtcpRr || |
| - packet_type_flags & kRtcpRrtr || |
| - packet_type_flags & kRtcpCast || |
| - packet_type_flags & kRtcpReceiverLog) { |
| - NOTREACHED() << "Invalid argument"; |
| - } |
| + const RtcpSenderInfo* sender_info, |
| + const RtcpDlrrReportBlock* dlrr) { |
| PacketRef packet(new base::RefCountedData<Packet>); |
| packet->data.reserve(kMaxIpPacketSize); |
| - if (packet_type_flags & kRtcpSr) { |
| - BuildSR(sender_info, &packet->data); |
| - } |
| - if (packet_type_flags & kRtcpDlrr) { |
| - BuildDlrrRb(dlrr, &packet->data); |
| - } |
| + if (sender_info) |
| + BuildSR(*sender_info, &packet->data); |
| + if (dlrr) |
|
Alpha Left Google
2014/08/21 20:18:23
DLRR can be removed.
hubbe
2014/08/21 21:34:14
Done.
|
| + BuildDlrrRb(*dlrr, &packet->data); |
| + |
| if (packet->data.empty()) { |
| NOTREACHED() << "Empty packet."; |
| return; // Sanity - don't send empty packets. |