| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 std::vector<int> recent_propagation_time_delta_ms; | 60 std::vector<int> recent_propagation_time_delta_ms; |
| 61 // The arrival times for the frames arrived in the last kProcessIntervalMs | 61 // The arrival times for the frames arrived in the last kProcessIntervalMs |
| 62 // using the clock passed to RemoteBitrateEstimatorFactory::Create. | 62 // using the clock passed to RemoteBitrateEstimatorFactory::Create. |
| 63 std::vector<int64_t> recent_arrival_time_ms; | 63 std::vector<int64_t> recent_arrival_time_ms; |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 struct PacketInfo { | 66 struct PacketInfo { |
| 67 PacketInfo(int64_t arrival_time_ms, | 67 PacketInfo(int64_t arrival_time_ms, |
| 68 int64_t send_time_ms, | 68 int64_t send_time_ms, |
| 69 uint16_t sequence_number, | 69 uint16_t sequence_number, |
| 70 size_t payload_size) | 70 size_t payload_size, |
| 71 bool was_paced) |
| 71 : arrival_time_ms(arrival_time_ms), | 72 : arrival_time_ms(arrival_time_ms), |
| 72 send_time_ms(send_time_ms), | 73 send_time_ms(send_time_ms), |
| 73 sequence_number(sequence_number), | 74 sequence_number(sequence_number), |
| 74 payload_size(payload_size) {} | 75 payload_size(payload_size), |
| 76 was_paced(was_paced) {} |
| 75 // Time corresponding to when the packet was received. Timestamped with the | 77 // Time corresponding to when the packet was received. Timestamped with the |
| 76 // receiver's clock. | 78 // receiver's clock. |
| 77 int64_t arrival_time_ms; | 79 int64_t arrival_time_ms; |
| 78 // Time corresponding to when the packet was sent, timestamped with the | 80 // Time corresponding to when the packet was sent, timestamped with the |
| 79 // sender's clock. | 81 // sender's clock. |
| 80 int64_t send_time_ms; | 82 int64_t send_time_ms; |
| 81 // Packet identifier, incremented with 1 for every packet generated by the | 83 // Packet identifier, incremented with 1 for every packet generated by the |
| 82 // sender. | 84 // sender. |
| 83 uint16_t sequence_number; | 85 uint16_t sequence_number; |
| 84 // Size of the packet excluding RTP headers. | 86 // Size of the packet excluding RTP headers. |
| 85 size_t payload_size; | 87 size_t payload_size; |
| 88 // True if the packet was paced out by the pacer. |
| 89 bool was_paced; |
| 86 }; | 90 }; |
| 87 | 91 |
| 88 class RemoteBitrateEstimator : public CallStatsObserver, public Module { | 92 class RemoteBitrateEstimator : public CallStatsObserver, public Module { |
| 89 public: | 93 public: |
| 90 virtual ~RemoteBitrateEstimator() {} | 94 virtual ~RemoteBitrateEstimator() {} |
| 91 | 95 |
| 92 virtual void IncomingPacketFeedbackVector( | 96 virtual void IncomingPacketFeedbackVector( |
| 93 const std::vector<PacketInfo>& packet_feedback_vector) { | 97 const std::vector<PacketInfo>& packet_feedback_vector) { |
| 94 assert(false); | 98 assert(false); |
| 95 } | 99 } |
| 96 | 100 |
| 97 // Called for each incoming packet. Updates the incoming payload bitrate | 101 // Called for each incoming packet. Updates the incoming payload bitrate |
| 98 // estimate and the over-use detector. If an over-use is detected the | 102 // estimate and the over-use detector. If an over-use is detected the |
| 99 // remote bitrate estimate will be updated. Note that |payload_size| is the | 103 // remote bitrate estimate will be updated. Note that |payload_size| is the |
| 100 // packet size excluding headers. | 104 // packet size excluding headers. |
| 101 // Note that |arrival_time_ms| can be of an arbitrary time base. | 105 // Note that |arrival_time_ms| can be of an arbitrary time base. |
| 102 virtual void IncomingPacket(int64_t arrival_time_ms, | 106 virtual void IncomingPacket(int64_t arrival_time_ms, |
| 103 size_t payload_size, | 107 size_t payload_size, |
| 104 const RTPHeader& header) = 0; | 108 const RTPHeader& header, |
| 109 bool was_paced) = 0; |
| 105 | 110 |
| 106 // Removes all data for |ssrc|. | 111 // Removes all data for |ssrc|. |
| 107 virtual void RemoveStream(unsigned int ssrc) = 0; | 112 virtual void RemoveStream(unsigned int ssrc) = 0; |
| 108 | 113 |
| 109 // Returns true if a valid estimate exists and sets |bitrate_bps| to the | 114 // Returns true if a valid estimate exists and sets |bitrate_bps| to the |
| 110 // estimated payload bitrate in bits per second. |ssrcs| is the list of ssrcs | 115 // estimated payload bitrate in bits per second. |ssrcs| is the list of ssrcs |
| 111 // currently being received and of which the bitrate estimate is based upon. | 116 // currently being received and of which the bitrate estimate is based upon. |
| 112 virtual bool LatestEstimate(std::vector<unsigned int>* ssrcs, | 117 virtual bool LatestEstimate(std::vector<unsigned int>* ssrcs, |
| 113 unsigned int* bitrate_bps) const = 0; | 118 unsigned int* bitrate_bps) const = 0; |
| 114 | 119 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 138 | 143 |
| 139 virtual RemoteBitrateEstimator* Create( | 144 virtual RemoteBitrateEstimator* Create( |
| 140 RemoteBitrateObserver* observer, | 145 RemoteBitrateObserver* observer, |
| 141 Clock* clock, | 146 Clock* clock, |
| 142 RateControlType control_type, | 147 RateControlType control_type, |
| 143 uint32_t min_bitrate_bps) const; | 148 uint32_t min_bitrate_bps) const; |
| 144 }; | 149 }; |
| 145 } // namespace webrtc | 150 } // namespace webrtc |
| 146 | 151 |
| 147 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_INCLUDE_REMOTE_BITRATE_ESTIMA
TOR_H_ | 152 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_INCLUDE_REMOTE_BITRATE_ESTIMA
TOR_H_ |
| OLD | NEW |