Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Side by Side Diff: media/cast/rtcp/rtcp_sender.cc

Issue 189423002: Cast: Cap max receiver log size per rtcp packet to 200 bytes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reland patch Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/cast/rtcp/rtcp_sender.h ('k') | media/cast/rtcp/rtcp_sender_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/cast/rtcp/rtcp_sender.h" 5 #include "media/cast/rtcp/rtcp_sender.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/big_endian.h" 10 #include "base/big_endian.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 return lhs.event_timestamp < rhs.event_timestamp; 75 return lhs.event_timestamp < rhs.event_timestamp;
76 } 76 }
77 77
78 bool BuildRtcpReceiverLogMessage( 78 bool BuildRtcpReceiverLogMessage(
79 const ReceiverRtcpEventSubscriber::RtcpEventMultiMap& rtcp_events, 79 const ReceiverRtcpEventSubscriber::RtcpEventMultiMap& rtcp_events,
80 size_t start_size, 80 size_t start_size,
81 RtcpReceiverLogMessage* receiver_log_message, 81 RtcpReceiverLogMessage* receiver_log_message,
82 size_t* number_of_frames, 82 size_t* number_of_frames,
83 size_t* total_number_of_messages_to_send, 83 size_t* total_number_of_messages_to_send,
84 size_t* rtcp_log_size) { 84 size_t* rtcp_log_size) {
85 size_t remaining_space = kMaxIpPacketSize - start_size; 85 size_t remaining_space =
86 std::min(kMaxReceiverLogBytes, kMaxIpPacketSize - start_size);
86 if (remaining_space < kRtcpCastLogHeaderSize + kRtcpReceiverFrameLogSize + 87 if (remaining_space < kRtcpCastLogHeaderSize + kRtcpReceiverFrameLogSize +
87 kRtcpReceiverEventLogSize) { 88 kRtcpReceiverEventLogSize) {
88 return false; 89 return false;
89 } 90 }
90 91
91 // We use this to do event timestamp sorting and truncating for events of 92 // We use this to do event timestamp sorting and truncating for events of
92 // a single frame. 93 // a single frame.
93 std::vector<RtcpReceiverEventLogMessage> sorted_log_messages; 94 std::vector<RtcpReceiverEventLogMessage> sorted_log_messages;
94 95
95 // Account for the RTCP header for an application-defined packet. 96 // Account for the RTCP header for an application-defined packet.
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 if (frame_log_messages.event_log_messages_.empty()) { 702 if (frame_log_messages.event_log_messages_.empty()) {
702 // We sent all messages on this frame; pop the frame header. 703 // We sent all messages on this frame; pop the frame header.
703 receiver_log_message.pop_front(); 704 receiver_log_message.pop_front();
704 } 705 }
705 } 706 }
706 DCHECK_EQ(total_number_of_messages_to_send, 0); 707 DCHECK_EQ(total_number_of_messages_to_send, 0);
707 } 708 }
708 709
709 } // namespace cast 710 } // namespace cast
710 } // namespace media 711 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/rtcp/rtcp_sender.h ('k') | media/cast/rtcp/rtcp_sender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698