| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 uint32_t last_ntp_fraction); | 95 uint32_t last_ntp_fraction); |
| 94 | 96 |
| 95 base::TickClock* const clock_; // Not owned. | 97 base::TickClock* const clock_; // Not owned. |
| 96 PacedPacketSender* packet_sender_; // Not owned. | 98 PacedPacketSender* packet_sender_; // Not owned. |
| 97 const uint32_t local_ssrc_; | 99 const uint32_t local_ssrc_; |
| 98 const uint32_t remote_ssrc_; | 100 const uint32_t remote_ssrc_; |
| 99 | 101 |
| 100 const RtcpCastMessageCallback cast_callback_; | 102 const RtcpCastMessageCallback cast_callback_; |
| 101 const RtcpRttCallback rtt_callback_; | 103 const RtcpRttCallback rtt_callback_; |
| 102 const RtcpLogMessageCallback log_callback_; | 104 const RtcpLogMessageCallback log_callback_; |
| 105 const RtcpPliCallback pli_callback_; |
| 103 | 106 |
| 104 // Computed from RTCP RRTR report. | 107 // Computed from RTCP RRTR report. |
| 105 base::TimeTicks largest_seen_timestamp_; | 108 base::TimeTicks largest_seen_timestamp_; |
| 106 | 109 |
| 107 // The RTCP packet parser is re-used when parsing each RTCP packet. It | 110 // 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 | 111 // remembers state about prior RTP timestamps and other sequence values to |
| 109 // re-construct "expanded" values. | 112 // re-construct "expanded" values. |
| 110 RtcpParser parser_; | 113 RtcpParser parser_; |
| 111 | 114 |
| 112 // For extending received ACK frame IDs from 8-bit to 32-bit. | 115 // 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_; | 130 RtcpSendTimeMap last_reports_sent_map_; |
| 128 RtcpSendTimeQueue last_reports_sent_queue_; | 131 RtcpSendTimeQueue last_reports_sent_queue_; |
| 129 | 132 |
| 130 DISALLOW_COPY_AND_ASSIGN(SenderRtcpSession); | 133 DISALLOW_COPY_AND_ASSIGN(SenderRtcpSession); |
| 131 }; | 134 }; |
| 132 | 135 |
| 133 } // namespace cast | 136 } // namespace cast |
| 134 } // namespace media | 137 } // namespace media |
| 135 | 138 |
| 136 #endif // MEDIA_CAST_NET_RTCP_SENDER_RTCP_SESSION_H_ | 139 #endif // MEDIA_CAST_NET_RTCP_SENDER_RTCP_SESSION_H_ |
| OLD | NEW |