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 |
11 #include <map> | 11 #include <map> |
12 #include <queue> | 12 #include <queue> |
13 #include <string> | 13 #include <string> |
14 | 14 |
15 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
18 #include "base/time/tick_clock.h" | 18 #include "base/time/tick_clock.h" |
19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
20 #include "media/cast/cast_config.h" | 20 #include "media/cast/cast_config.h" |
21 #include "media/cast/cast_defines.h" | 21 #include "media/cast/cast_defines.h" |
22 #include "media/cast/common/clock_drift_smoother.h" | 22 #include "media/cast/common/clock_drift_smoother.h" |
23 #include "media/cast/net/cast_transport_defines.h" | 23 #include "media/cast/net/cast_transport_defines.h" |
24 #include "media/cast/net/cast_transport_sender.h" | 24 #include "media/cast/net/cast_transport_sender.h" |
25 #include "media/cast/net/rtcp/receiver_rtcp_event_subscriber.h" | 25 #include "media/cast/net/rtcp/receiver_rtcp_event_subscriber.h" |
26 #include "media/cast/net/rtcp/rtcp_builder.h" | |
27 #include "media/cast/net/rtcp/rtcp_defines.h" | 26 #include "media/cast/net/rtcp/rtcp_defines.h" |
28 | 27 |
29 namespace media { | 28 namespace media { |
30 namespace cast { | 29 namespace cast { |
31 | 30 |
32 class LocalRtcpReceiverFeedback; | 31 class LocalRtcpReceiverFeedback; |
33 class PacedPacketSender; | 32 class PacedPacketSender; |
34 class RtcpReceiver; | 33 class RtcpReceiver; |
35 class RtcpBuilder; | 34 class RtcpSender; |
36 | 35 |
37 typedef std::pair<uint32, base::TimeTicks> RtcpSendTimePair; | 36 typedef std::pair<uint32, base::TimeTicks> RtcpSendTimePair; |
38 typedef std::map<uint32, base::TimeTicks> RtcpSendTimeMap; | 37 typedef std::map<uint32, base::TimeTicks> RtcpSendTimeMap; |
39 typedef std::queue<RtcpSendTimePair> RtcpSendTimeQueue; | 38 typedef std::queue<RtcpSendTimePair> RtcpSendTimeQueue; |
40 | 39 |
41 class RtpReceiverStatistics { | 40 class RtpReceiverStatistics { |
42 public: | 41 public: |
43 virtual void GetStatistics(uint8* fraction_lost, | 42 virtual void GetStatistics(uint8* fraction_lost, |
44 uint32* cumulative_lost, // 24 bits valid. | 43 uint32* cumulative_lost, // 24 bits valid. |
45 uint32* extended_high_sequence_number, | 44 uint32* extended_high_sequence_number, |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 uint32 last_ntp_fraction); | 131 uint32 last_ntp_fraction); |
133 | 132 |
134 // Remove duplicate events in |receiver_log|. | 133 // Remove duplicate events in |receiver_log|. |
135 // Returns true if any events remain. | 134 // Returns true if any events remain. |
136 bool DedupeReceiverLog(RtcpReceiverLogMessage* receiver_log); | 135 bool DedupeReceiverLog(RtcpReceiverLogMessage* receiver_log); |
137 | 136 |
138 const RtcpCastMessageCallback cast_callback_; | 137 const RtcpCastMessageCallback cast_callback_; |
139 const RtcpRttCallback rtt_callback_; | 138 const RtcpRttCallback rtt_callback_; |
140 const RtcpLogMessageCallback log_callback_; | 139 const RtcpLogMessageCallback log_callback_; |
141 base::TickClock* const clock_; // Not owned by this class. | 140 base::TickClock* const clock_; // Not owned by this class. |
142 RtcpBuilder rtcp_builder_; | 141 const scoped_ptr<RtcpSender> rtcp_sender_; |
143 PacedPacketSender* packet_sender_; // Not owned. | |
144 const uint32 local_ssrc_; | 142 const uint32 local_ssrc_; |
145 const uint32 remote_ssrc_; | 143 const uint32 remote_ssrc_; |
146 | 144 |
147 RtcpSendTimeMap last_reports_sent_map_; | 145 RtcpSendTimeMap last_reports_sent_map_; |
148 RtcpSendTimeQueue last_reports_sent_queue_; | 146 RtcpSendTimeQueue last_reports_sent_queue_; |
149 | 147 |
150 // The truncated (i.e., 64-->32-bit) NTP timestamp provided in the last report | 148 // The truncated (i.e., 64-->32-bit) NTP timestamp provided in the last report |
151 // from the remote peer, along with the local time at which the report was | 149 // from the remote peer, along with the local time at which the report was |
152 // received. These values are used for ping-pong'ing NTP timestamps between | 150 // received. These values are used for ping-pong'ing NTP timestamps between |
153 // the peers so that they can estimate the network's round-trip time. | 151 // the peers so that they can estimate the network's round-trip time. |
(...skipping 29 matching lines...) Expand all Loading... |
183 base::hash_set<ReceiverEventKey> receiver_event_key_set_; | 181 base::hash_set<ReceiverEventKey> receiver_event_key_set_; |
184 std::queue<ReceiverEventKey> receiver_event_key_queue_; | 182 std::queue<ReceiverEventKey> receiver_event_key_queue_; |
185 | 183 |
186 DISALLOW_COPY_AND_ASSIGN(Rtcp); | 184 DISALLOW_COPY_AND_ASSIGN(Rtcp); |
187 }; | 185 }; |
188 | 186 |
189 } // namespace cast | 187 } // namespace cast |
190 } // namespace media | 188 } // namespace media |
191 | 189 |
192 #endif // MEDIA_CAST_RTCP_RTCP_H_ | 190 #endif // MEDIA_CAST_RTCP_RTCP_H_ |
OLD | NEW |