| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 RtcpTimeData time_data, | 78 RtcpTimeData time_data, |
| 79 const RtcpCastMessage* cast_message, | 79 const RtcpCastMessage* cast_message, |
| 80 base::TimeDelta target_delay, | 80 base::TimeDelta target_delay, |
| 81 const ReceiverRtcpEventSubscriber::RtcpEvents* rtcp_events, | 81 const ReceiverRtcpEventSubscriber::RtcpEvents* rtcp_events, |
| 82 const RtpReceiverStatistics* rtp_receiver_statistics) const; | 82 const RtpReceiverStatistics* rtp_receiver_statistics) const; |
| 83 | 83 |
| 84 // Submit a received packet to this object. The packet will be parsed | 84 // Submit a received packet to this object. The packet will be parsed |
| 85 // and used to maintain a RTCP session. | 85 // and used to maintain a RTCP session. |
| 86 // Returns false if this is not a RTCP packet or it is not directed to | 86 // Returns false if this is not a RTCP packet or it is not directed to |
| 87 // this session, e.g. SSRC doesn't match. | 87 // this session, e.g. SSRC doesn't match. |
| 88 bool IncomingRtcpPacket(const uint8* data, size_t length); | 88 bool IncomingRtcpPacket(const uint8_t* data, size_t length); |
| 89 | 89 |
| 90 // If available, returns true and sets the output arguments to the latest | 90 // If available, returns true and sets the output arguments to the latest |
| 91 // lip-sync timestamps gleaned from the sender reports. While the sender | 91 // lip-sync timestamps gleaned from the sender reports. While the sender |
| 92 // provides reference NTP times relative to its own wall clock, the | 92 // provides reference NTP times relative to its own wall clock, the |
| 93 // |reference_time| returned here has been translated to the local | 93 // |reference_time| returned here has been translated to the local |
| 94 // CastEnvironment clock. | 94 // CastEnvironment clock. |
| 95 bool GetLatestLipSyncTimes(uint32_t* rtp_timestamp, | 95 bool GetLatestLipSyncTimes(uint32_t* rtp_timestamp, |
| 96 base::TimeTicks* reference_time) const; | 96 base::TimeTicks* reference_time) const; |
| 97 | 97 |
| 98 void OnReceivedReceiverLog(const RtcpReceiverLogMessage& receiver_log); | 98 void OnReceivedReceiverLog(const RtcpReceiverLogMessage& receiver_log); |
| 99 | 99 |
| 100 // If greater than zero, this is the last measured network round trip time. | 100 // If greater than zero, this is the last measured network round trip time. |
| 101 base::TimeDelta current_round_trip_time() const { | 101 base::TimeDelta current_round_trip_time() const { |
| 102 return current_round_trip_time_; | 102 return current_round_trip_time_; |
| 103 } | 103 } |
| 104 | 104 |
| 105 static bool IsRtcpPacket(const uint8* packet, size_t length); | 105 static bool IsRtcpPacket(const uint8_t* packet, size_t length); |
| 106 static uint32_t GetSsrcOfSender(const uint8* rtcp_buffer, size_t length); | 106 static uint32_t GetSsrcOfSender(const uint8_t* rtcp_buffer, size_t length); |
| 107 | 107 |
| 108 uint32_t GetLocalSsrc() const { return local_ssrc_; } | 108 uint32_t GetLocalSsrc() const { return local_ssrc_; } |
| 109 uint32_t GetRemoteSsrc() const { return remote_ssrc_; } | 109 uint32_t GetRemoteSsrc() const { return remote_ssrc_; } |
| 110 | 110 |
| 111 protected: | 111 protected: |
| 112 void OnReceivedNtp(uint32_t ntp_seconds, uint32_t ntp_fraction); | 112 void OnReceivedNtp(uint32_t ntp_seconds, uint32_t ntp_fraction); |
| 113 void OnReceivedLipSyncInfo(uint32_t rtp_timestamp, | 113 void OnReceivedLipSyncInfo(uint32_t rtp_timestamp, |
| 114 uint32_t ntp_seconds, | 114 uint32_t ntp_seconds, |
| 115 uint32_t ntp_fraction); | 115 uint32_t ntp_fraction); |
| 116 | 116 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 base::hash_set<ReceiverEventKey> receiver_event_key_set_; | 175 base::hash_set<ReceiverEventKey> receiver_event_key_set_; |
| 176 std::queue<ReceiverEventKey> receiver_event_key_queue_; | 176 std::queue<ReceiverEventKey> receiver_event_key_queue_; |
| 177 | 177 |
| 178 DISALLOW_COPY_AND_ASSIGN(Rtcp); | 178 DISALLOW_COPY_AND_ASSIGN(Rtcp); |
| 179 }; | 179 }; |
| 180 | 180 |
| 181 } // namespace cast | 181 } // namespace cast |
| 182 } // namespace media | 182 } // namespace media |
| 183 | 183 |
| 184 #endif // MEDIA_CAST_RTCP_RTCP_H_ | 184 #endif // MEDIA_CAST_RTCP_RTCP_H_ |
| OLD | NEW |