OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 // This class maintains a bi-directional RTCP connection with a remote | 5 // This class maintains a bi-directional RTCP connection with a remote |
6 // peer. | 6 // peer. |
7 | 7 |
8 #ifndef MEDIA_CAST_RTCP_RTCP_H_ | 8 #ifndef MEDIA_CAST_RTCP_RTCP_H_ |
9 #define MEDIA_CAST_RTCP_RTCP_H_ | 9 #define MEDIA_CAST_RTCP_RTCP_H_ |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 // TODO(hclam): This should be renamed to RtcpSession. | 50 // TODO(hclam): This should be renamed to RtcpSession. |
51 class Rtcp { | 51 class Rtcp { |
52 public: | 52 public: |
53 Rtcp(const RtcpCastMessageCallback& cast_callback, | 53 Rtcp(const RtcpCastMessageCallback& cast_callback, |
54 const RtcpRttCallback& rtt_callback, | 54 const RtcpRttCallback& rtt_callback, |
55 const RtcpLogMessageCallback& log_callback, | 55 const RtcpLogMessageCallback& log_callback, |
56 base::TickClock* clock, // Not owned. | 56 base::TickClock* clock, // Not owned. |
57 PacedPacketSender* packet_sender, // Not owned. | 57 PacedPacketSender* packet_sender, // Not owned. |
58 uint32 local_ssrc, | 58 uint32 local_ssrc, |
59 uint32 remote_ssrc, | 59 uint32 remote_ssrc); |
60 const std::string& c_name); | |
61 | 60 |
62 virtual ~Rtcp(); | 61 virtual ~Rtcp(); |
63 | 62 |
64 // Send a RTCP sender report. | 63 // Send a RTCP sender report. |
65 // |current_time| is the current time reported by a tick clock. | 64 // |current_time| is the current time reported by a tick clock. |
66 // |current_time_as_rtp_timestamp| is the corresponding RTP timestamp. | 65 // |current_time_as_rtp_timestamp| is the corresponding RTP timestamp. |
67 // |send_packet_count| is the number of packets sent. | 66 // |send_packet_count| is the number of packets sent. |
68 // |send_octet_count| is the number of octets sent. | 67 // |send_octet_count| is the number of octets sent. |
69 void SendRtcpFromRtpSender( | 68 void SendRtcpFromRtpSender( |
70 base::TimeTicks current_time, | 69 base::TimeTicks current_time, |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 uint32 last_ntp_seconds, | 128 uint32 last_ntp_seconds, |
130 uint32 last_ntp_fraction); | 129 uint32 last_ntp_fraction); |
131 | 130 |
132 const RtcpCastMessageCallback cast_callback_; | 131 const RtcpCastMessageCallback cast_callback_; |
133 const RtcpRttCallback rtt_callback_; | 132 const RtcpRttCallback rtt_callback_; |
134 const RtcpLogMessageCallback log_callback_; | 133 const RtcpLogMessageCallback log_callback_; |
135 base::TickClock* const clock_; // Not owned by this class. | 134 base::TickClock* const clock_; // Not owned by this class. |
136 const scoped_ptr<RtcpSender> rtcp_sender_; | 135 const scoped_ptr<RtcpSender> rtcp_sender_; |
137 const uint32 local_ssrc_; | 136 const uint32 local_ssrc_; |
138 const uint32 remote_ssrc_; | 137 const uint32 remote_ssrc_; |
139 const std::string c_name_; | |
140 const scoped_ptr<RtcpMessageHandlerImpl> handler_; | 138 const scoped_ptr<RtcpMessageHandlerImpl> handler_; |
141 const scoped_ptr<RtcpReceiver> rtcp_receiver_; | 139 const scoped_ptr<RtcpReceiver> rtcp_receiver_; |
142 | 140 |
143 RtcpSendTimeMap last_reports_sent_map_; | 141 RtcpSendTimeMap last_reports_sent_map_; |
144 RtcpSendTimeQueue last_reports_sent_queue_; | 142 RtcpSendTimeQueue last_reports_sent_queue_; |
145 | 143 |
146 // The truncated (i.e., 64-->32-bit) NTP timestamp provided in the last report | 144 // The truncated (i.e., 64-->32-bit) NTP timestamp provided in the last report |
147 // from the remote peer, along with the local time at which the report was | 145 // from the remote peer, along with the local time at which the report was |
148 // received. These values are used for ping-pong'ing NTP timestamps between | 146 // received. These values are used for ping-pong'ing NTP timestamps between |
149 // the peers so that they can estimate the network's round-trip time. | 147 // the peers so that they can estimate the network's round-trip time. |
(...skipping 19 matching lines...) Expand all Loading... |
169 int number_of_rtt_in_avg_; | 167 int number_of_rtt_in_avg_; |
170 base::TimeDelta avg_rtt_; | 168 base::TimeDelta avg_rtt_; |
171 | 169 |
172 DISALLOW_COPY_AND_ASSIGN(Rtcp); | 170 DISALLOW_COPY_AND_ASSIGN(Rtcp); |
173 }; | 171 }; |
174 | 172 |
175 } // namespace cast | 173 } // namespace cast |
176 } // namespace media | 174 } // namespace media |
177 | 175 |
178 #endif // MEDIA_CAST_RTCP_RTCP_H_ | 176 #endif // MEDIA_CAST_RTCP_RTCP_H_ |
OLD | NEW |