Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef MEDIA_CAST_RTCP_RTCP_H_ | 5 #ifndef MEDIA_CAST_RTCP_RTCP_H_ |
| 6 #define MEDIA_CAST_RTCP_RTCP_H_ | 6 #define MEDIA_CAST_RTCP_RTCP_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 class RtcpReceiver; | 27 class RtcpReceiver; |
| 28 class RtcpSender; | 28 class RtcpSender; |
| 29 | 29 |
| 30 class RtcpSenderFeedback { | 30 class RtcpSenderFeedback { |
| 31 public: | 31 public: |
| 32 virtual void OnReceivedCastFeedback(const RtcpCastMessage& cast_feedback) = 0; | 32 virtual void OnReceivedCastFeedback(const RtcpCastMessage& cast_feedback) = 0; |
| 33 | 33 |
| 34 virtual ~RtcpSenderFeedback() {} | 34 virtual ~RtcpSenderFeedback() {} |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 class RtcpReceivedLog { | |
| 38 public: | |
| 39 virtual void OnReceivedReceiverLog( | |
| 40 const RtcpReceiverLogMessage& receiver_log) = 0; | |
| 41 | |
| 42 virtual void OnReceivedSenderLog( | |
| 43 const RtcpSenderLogMessage& sender_log) = 0; | |
| 44 | |
| 45 virtual ~RtcpReceivedLog() {} | |
| 46 }; | |
| 47 | |
| 37 class RtpSenderStatistics { | 48 class RtpSenderStatistics { |
| 38 public: | 49 public: |
| 39 virtual void GetStatistics(const base::TimeTicks& now, | 50 virtual void GetStatistics(const base::TimeTicks& now, |
| 40 RtcpSenderInfo* sender_info) = 0; | 51 RtcpSenderInfo* sender_info) = 0; |
| 41 | 52 |
| 42 virtual ~RtpSenderStatistics() {} | 53 virtual ~RtpSenderStatistics() {} |
| 43 }; | 54 }; |
| 44 | 55 |
| 45 class RtpReceiverStatistics { | 56 class RtpReceiverStatistics { |
| 46 public: | 57 public: |
| 47 virtual void GetStatistics(uint8* fraction_lost, | 58 virtual void GetStatistics(uint8* fraction_lost, |
| 48 uint32* cumulative_lost, // 24 bits valid. | 59 uint32* cumulative_lost, // 24 bits valid. |
| 49 uint32* extended_high_sequence_number, | 60 uint32* extended_high_sequence_number, |
| 50 uint32* jitter) = 0; | 61 uint32* jitter) = 0; |
| 51 | 62 |
| 52 virtual ~RtpReceiverStatistics() {} | 63 virtual ~RtpReceiverStatistics() {} |
| 53 }; | 64 }; |
| 54 | 65 |
| 55 class Rtcp { | 66 class Rtcp { |
| 56 public: | 67 public: |
| 57 Rtcp(base::TickClock* clock, | 68 Rtcp(base::TickClock* clock, |
| 58 RtcpSenderFeedback* sender_feedback, | 69 RtcpSenderFeedback* sender_feedback, |
| 59 PacedPacketSender* paced_packet_sender, | 70 PacedPacketSender* paced_packet_sender, |
| 60 RtpSenderStatistics* rtp_sender_statistics, | 71 RtpSenderStatistics* rtp_sender_statistics, |
| 61 RtpReceiverStatistics* rtp_receiver_statistics, | 72 RtpReceiverStatistics* rtp_receiver_statistics, |
| 62 RtcpMode rtcp_mode, | 73 RtcpMode rtcp_mode, |
| 63 const base::TimeDelta& rtcp_interval, | 74 const base::TimeDelta& rtcp_interval, |
| 64 bool sending_media, | |
| 65 uint32 local_ssrc, | 75 uint32 local_ssrc, |
| 76 uint32 remote_ssrc, | |
| 66 const std::string& c_name); | 77 const std::string& c_name); |
| 67 | 78 |
| 68 virtual ~Rtcp(); | 79 virtual ~Rtcp(); |
| 69 | 80 |
| 70 static bool IsRtcpPacket(const uint8* rtcp_buffer, size_t length); | 81 static bool IsRtcpPacket(const uint8* rtcp_buffer, size_t length); |
| 71 | 82 |
| 72 static uint32 GetSsrcOfSender(const uint8* rtcp_buffer, size_t length); | 83 static uint32 GetSsrcOfSender(const uint8* rtcp_buffer, size_t length); |
| 73 | 84 |
| 74 base::TimeTicks TimeToSendNextRtcpReport(); | 85 base::TimeTicks TimeToSendNextRtcpReport(); |
| 75 void SendRtcpReport(uint32 media_ssrc); | 86 void SendRtcpFromRtpSender(const RtcpSenderLogMessage* sender_log_message); |
|
Alpha Left Google
2013/11/13 23:58:40
What does it mean if the parameter is NULL? Looks
pwestin
2013/11/15 00:20:32
Done.
| |
| 76 void SendRtcpPli(uint32 media_ssrc); | 87 |
| 77 void SendRtcpCast(const RtcpCastMessage& cast_message); | 88 void SendRtcpFromRtpReceiver(const RtcpCastMessage* cast_message, |
|
Alpha Left Google
2013/11/13 23:58:40
This method looks funny that it takes two const po
pwestin
2013/11/15 00:20:32
Done.
| |
| 78 void SetRemoteSSRC(uint32 ssrc); | 89 const RtcpReceiverLogMessage* receiver_log); |
| 79 | 90 |
| 80 void IncomingRtcpPacket(const uint8* rtcp_buffer, size_t length); | 91 void IncomingRtcpPacket(const uint8* rtcp_buffer, size_t length); |
| 81 bool Rtt(base::TimeDelta* rtt, base::TimeDelta* avg_rtt, | 92 bool Rtt(base::TimeDelta* rtt, base::TimeDelta* avg_rtt, |
| 82 base::TimeDelta* min_rtt, base::TimeDelta* max_rtt) const; | 93 base::TimeDelta* min_rtt, base::TimeDelta* max_rtt) const; |
| 83 bool RtpTimestampInSenderTime(int frequency, | 94 bool RtpTimestampInSenderTime(int frequency, |
| 84 uint32 rtp_timestamp, | 95 uint32 rtp_timestamp, |
| 85 base::TimeTicks* rtp_timestamp_in_ticks) const; | 96 base::TimeTicks* rtp_timestamp_in_ticks) const; |
| 86 | 97 |
| 87 protected: | 98 protected: |
| 88 int CheckForWrapAround(uint32 new_timestamp, | 99 int CheckForWrapAround(uint32 new_timestamp, |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 110 void OnReceivedSendReportRequest(); | 121 void OnReceivedSendReportRequest(); |
| 111 | 122 |
| 112 void UpdateRtt(const base::TimeDelta& sender_delay, | 123 void UpdateRtt(const base::TimeDelta& sender_delay, |
| 113 const base::TimeDelta& receiver_delay); | 124 const base::TimeDelta& receiver_delay); |
| 114 | 125 |
| 115 void UpdateNextTimeToSendRtcp(); | 126 void UpdateNextTimeToSendRtcp(); |
| 116 | 127 |
| 117 base::TickClock* const clock_; // Not owned by this class. | 128 base::TickClock* const clock_; // Not owned by this class. |
| 118 const base::TimeDelta rtcp_interval_; | 129 const base::TimeDelta rtcp_interval_; |
| 119 const RtcpMode rtcp_mode_; | 130 const RtcpMode rtcp_mode_; |
| 120 const bool sending_media_; | |
| 121 const uint32 local_ssrc_; | 131 const uint32 local_ssrc_; |
| 132 const uint32 remote_ssrc_; | |
| 122 | 133 |
| 123 // Not owned by this class. | 134 // Not owned by this class. |
| 124 RtpSenderStatistics* const rtp_sender_statistics_; | 135 RtpSenderStatistics* const rtp_sender_statistics_; |
| 125 RtpReceiverStatistics* const rtp_receiver_statistics_; | 136 RtpReceiverStatistics* const rtp_receiver_statistics_; |
| 126 | 137 |
| 127 scoped_ptr<LocalRtcpRttFeedback> rtt_feedback_; | 138 scoped_ptr<LocalRtcpRttFeedback> rtt_feedback_; |
| 128 scoped_ptr<LocalRtcpReceiverFeedback> receiver_feedback_; | 139 scoped_ptr<LocalRtcpReceiverFeedback> receiver_feedback_; |
| 129 scoped_ptr<RtcpSender> rtcp_sender_; | 140 scoped_ptr<RtcpSender> rtcp_sender_; |
| 130 scoped_ptr<RtcpReceiver> rtcp_receiver_; | 141 scoped_ptr<RtcpReceiver> rtcp_receiver_; |
| 131 | 142 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 147 int number_of_rtt_in_avg_; | 158 int number_of_rtt_in_avg_; |
| 148 float avg_rtt_ms_; | 159 float avg_rtt_ms_; |
| 149 | 160 |
| 150 DISALLOW_COPY_AND_ASSIGN(Rtcp); | 161 DISALLOW_COPY_AND_ASSIGN(Rtcp); |
| 151 }; | 162 }; |
| 152 | 163 |
| 153 } // namespace cast | 164 } // namespace cast |
| 154 } // namespace media | 165 } // namespace media |
| 155 | 166 |
| 156 #endif // MEDIA_CAST_RTCP_RTCP_H_ | 167 #endif // MEDIA_CAST_RTCP_RTCP_H_ |
| OLD | NEW |