OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef MEDIA_CAST_NET_RTCP_SENDER_RTCP_SESSION_H_ | 5 #ifndef MEDIA_CAST_NET_RTCP_SENDER_RTCP_SESSION_H_ |
6 #define MEDIA_CAST_NET_RTCP_SENDER_RTCP_SESSION_H_ | 6 #define MEDIA_CAST_NET_RTCP_SENDER_RTCP_SESSION_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <utility> | 10 #include <utility> |
(...skipping 21 matching lines...) Expand all Loading... |
32 // - Receiver reference time report: Helps with tracking largest timestamp | 32 // - Receiver reference time report: Helps with tracking largest timestamp |
33 // seen and as a result rejecting old RTCP reports. | 33 // seen and as a result rejecting old RTCP reports. |
34 // - Receiver logs: The sender receives log events from the receiver and | 34 // - Receiver logs: The sender receives log events from the receiver and |
35 // invokes a callback passed. | 35 // invokes a callback passed. |
36 // - cast message: Receives feedback from receiver on missing packets/frames | 36 // - cast message: Receives feedback from receiver on missing packets/frames |
37 // and last frame id received and invokes a callback passed. | 37 // and last frame id received and invokes a callback passed. |
38 // - Last report: The receiver provides feedback on delay since last report | 38 // - Last report: The receiver provides feedback on delay since last report |
39 // received which helps it compute round trip time and invoke a callback. | 39 // received which helps it compute round trip time and invoke a callback. |
40 class SenderRtcpSession : public RtcpSession { | 40 class SenderRtcpSession : public RtcpSession { |
41 public: | 41 public: |
| 42 // TODO(xjz): Simplify the interface. http://crbug.com/588275. |
42 SenderRtcpSession(const RtcpCastMessageCallback& cast_callback, | 43 SenderRtcpSession(const RtcpCastMessageCallback& cast_callback, |
43 const RtcpRttCallback& rtt_callback, | 44 const RtcpRttCallback& rtt_callback, |
44 const RtcpLogMessageCallback& log_callback, | 45 const RtcpLogMessageCallback& log_callback, |
| 46 const RtcpPliCallback pli_callback, |
45 base::TickClock* clock, // Not owned. | 47 base::TickClock* clock, // Not owned. |
46 PacedPacketSender* packet_sender, // Not owned. | 48 PacedPacketSender* packet_sender, // Not owned. |
47 uint32_t local_ssrc, | 49 uint32_t local_ssrc, |
48 uint32_t remote_ssrc); | 50 uint32_t remote_ssrc); |
49 | 51 |
50 ~SenderRtcpSession() override; | 52 ~SenderRtcpSession() override; |
51 | 53 |
52 // If greater than zero, this is the last measured network round trip time. | 54 // If greater than zero, this is the last measured network round trip time. |
53 base::TimeDelta current_round_trip_time() const { | 55 base::TimeDelta current_round_trip_time() const { |
54 return current_round_trip_time_; | 56 return current_round_trip_time_; |
(...skipping 30 matching lines...) Expand all Loading... |
85 // Remove duplicate events in |receiver_log|. | 87 // Remove duplicate events in |receiver_log|. |
86 // Returns true if any events remain. | 88 // Returns true if any events remain. |
87 bool DedupeReceiverLog(RtcpReceiverLogMessage* receiver_log); | 89 bool DedupeReceiverLog(RtcpReceiverLogMessage* receiver_log); |
88 | 90 |
89 // Save last sent NTP time on RTPC SR. This helps map the sent time when a | 91 // Save last sent NTP time on RTPC SR. This helps map the sent time when a |
90 // last report is received from RTP receiver to compute RTT. | 92 // last report is received from RTP receiver to compute RTT. |
91 void SaveLastSentNtpTime(const base::TimeTicks& now, | 93 void SaveLastSentNtpTime(const base::TimeTicks& now, |
92 uint32_t last_ntp_seconds, | 94 uint32_t last_ntp_seconds, |
93 uint32_t last_ntp_fraction); | 95 uint32_t last_ntp_fraction); |
94 | 96 |
| 97 void OnReceivedPli(); |
| 98 |
95 base::TickClock* const clock_; // Not owned. | 99 base::TickClock* const clock_; // Not owned. |
96 PacedPacketSender* packet_sender_; // Not owned. | 100 PacedPacketSender* packet_sender_; // Not owned. |
97 const uint32_t local_ssrc_; | 101 const uint32_t local_ssrc_; |
98 const uint32_t remote_ssrc_; | 102 const uint32_t remote_ssrc_; |
99 | 103 |
100 const RtcpCastMessageCallback cast_callback_; | 104 const RtcpCastMessageCallback cast_callback_; |
101 const RtcpRttCallback rtt_callback_; | 105 const RtcpRttCallback rtt_callback_; |
102 const RtcpLogMessageCallback log_callback_; | 106 const RtcpLogMessageCallback log_callback_; |
| 107 const RtcpPliCallback pli_callback_; |
103 | 108 |
104 // Computed from RTCP RRTR report. | 109 // Computed from RTCP RRTR report. |
105 base::TimeTicks largest_seen_timestamp_; | 110 base::TimeTicks largest_seen_timestamp_; |
106 | 111 |
107 // The RTCP packet parser is re-used when parsing each RTCP packet. It | 112 // The RTCP packet parser is re-used when parsing each RTCP packet. It |
108 // remembers state about prior RTP timestamps and other sequence values to | 113 // remembers state about prior RTP timestamps and other sequence values to |
109 // re-construct "expanded" values. | 114 // re-construct "expanded" values. |
110 RtcpParser parser_; | 115 RtcpParser parser_; |
111 | 116 |
112 // For extending received ACK frame IDs from 8-bit to 32-bit. | 117 // For extending received ACK frame IDs from 8-bit to 32-bit. |
(...skipping 14 matching lines...) Expand all Loading... |
127 RtcpSendTimeMap last_reports_sent_map_; | 132 RtcpSendTimeMap last_reports_sent_map_; |
128 RtcpSendTimeQueue last_reports_sent_queue_; | 133 RtcpSendTimeQueue last_reports_sent_queue_; |
129 | 134 |
130 DISALLOW_COPY_AND_ASSIGN(SenderRtcpSession); | 135 DISALLOW_COPY_AND_ASSIGN(SenderRtcpSession); |
131 }; | 136 }; |
132 | 137 |
133 } // namespace cast | 138 } // namespace cast |
134 } // namespace media | 139 } // namespace media |
135 | 140 |
136 #endif // MEDIA_CAST_NET_RTCP_SENDER_RTCP_SESSION_H_ | 141 #endif // MEDIA_CAST_NET_RTCP_SENDER_RTCP_SESSION_H_ |
OLD | NEW |