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 20 matching lines...) Expand all Loading... |
31 class RemoteBitrateObserver { | 31 class RemoteBitrateObserver { |
32 public: | 32 public: |
33 // Called when a receive channel group has a new bitrate estimate for the | 33 // Called when a receive channel group has a new bitrate estimate for the |
34 // incoming streams. | 34 // incoming streams. |
35 virtual void OnReceiveBitrateChanged(const std::vector<uint32_t>& ssrcs, | 35 virtual void OnReceiveBitrateChanged(const std::vector<uint32_t>& ssrcs, |
36 uint32_t bitrate) = 0; | 36 uint32_t bitrate) = 0; |
37 | 37 |
38 virtual ~RemoteBitrateObserver() {} | 38 virtual ~RemoteBitrateObserver() {} |
39 }; | 39 }; |
40 | 40 |
| 41 // TODO(holmer): Remove when all implementations have been updated. |
| 42 struct ReceiveBandwidthEstimatorStats {}; |
| 43 |
41 class RemoteBitrateEstimator : public CallStatsObserver, public Module { | 44 class RemoteBitrateEstimator : public CallStatsObserver, public Module { |
42 public: | 45 public: |
43 static const int kDefaultMinBitrateBps = 30000; | 46 static const int kDefaultMinBitrateBps = 30000; |
44 virtual ~RemoteBitrateEstimator() {} | 47 virtual ~RemoteBitrateEstimator() {} |
45 | 48 |
46 virtual void IncomingPacketFeedbackVector( | 49 virtual void IncomingPacketFeedbackVector( |
47 const std::vector<PacketInfo>& packet_feedback_vector) { | 50 const std::vector<PacketInfo>& packet_feedback_vector) { |
48 assert(false); | 51 assert(false); |
49 } | 52 } |
50 | 53 |
51 // Called for each incoming packet. Updates the incoming payload bitrate | 54 // Called for each incoming packet. Updates the incoming payload bitrate |
52 // estimate and the over-use detector. If an over-use is detected the | 55 // estimate and the over-use detector. If an over-use is detected the |
53 // remote bitrate estimate will be updated. Note that |payload_size| is the | 56 // remote bitrate estimate will be updated. Note that |payload_size| is the |
54 // packet size excluding headers. | 57 // packet size excluding headers. |
55 // Note that |arrival_time_ms| can be of an arbitrary time base. | 58 // Note that |arrival_time_ms| can be of an arbitrary time base. |
56 virtual void IncomingPacket(int64_t arrival_time_ms, | 59 virtual void IncomingPacket(int64_t arrival_time_ms, |
57 size_t payload_size, | 60 size_t payload_size, |
58 const RTPHeader& header, | 61 const RTPHeader& header, |
59 bool was_paced) = 0; | 62 bool was_paced) = 0; |
60 | 63 |
61 // Removes all data for |ssrc|. | 64 // Removes all data for |ssrc|. |
62 virtual void RemoveStream(uint32_t ssrc) = 0; | 65 virtual void RemoveStream(uint32_t ssrc) = 0; |
63 | 66 |
64 // Returns true if a valid estimate exists and sets |bitrate_bps| to the | 67 // Returns true if a valid estimate exists and sets |bitrate_bps| to the |
65 // estimated payload bitrate in bits per second. |ssrcs| is the list of ssrcs | 68 // estimated payload bitrate in bits per second. |ssrcs| is the list of ssrcs |
66 // currently being received and of which the bitrate estimate is based upon. | 69 // currently being received and of which the bitrate estimate is based upon. |
67 virtual bool LatestEstimate(std::vector<uint32_t>* ssrcs, | 70 virtual bool LatestEstimate(std::vector<uint32_t>* ssrcs, |
68 uint32_t* bitrate_bps) const = 0; | 71 uint32_t* bitrate_bps) const = 0; |
69 | 72 |
| 73 // TODO(holmer): Remove when all implementations have been updated. |
| 74 bool GetStats(ReceiveBandwidthEstimatorStats* output) const { |
| 75 return false; |
| 76 } |
| 77 |
70 virtual void SetMinBitrate(int min_bitrate_bps) = 0; | 78 virtual void SetMinBitrate(int min_bitrate_bps) = 0; |
71 | 79 |
72 protected: | 80 protected: |
73 static const int64_t kProcessIntervalMs = 500; | 81 static const int64_t kProcessIntervalMs = 500; |
74 static const int64_t kStreamTimeOutMs = 2000; | 82 static const int64_t kStreamTimeOutMs = 2000; |
75 }; | 83 }; |
76 | 84 |
77 } // namespace webrtc | 85 } // namespace webrtc |
78 | 86 |
79 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_INCLUDE_REMOTE_BITRATE_ESTIMA
TOR_H_ | 87 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_INCLUDE_REMOTE_BITRATE_ESTIMA
TOR_H_ |
OLD | NEW |