| 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 #ifndef MEDIA_CAST_CONGESTION_CONTROL_CONGESTION_CONTROL_H_ | 5 #ifndef MEDIA_CAST_CONGESTION_CONTROL_CONGESTION_CONTROL_H_ |
| 6 #define MEDIA_CAST_CONGESTION_CONTROL_CONGESTION_CONTROL_H_ | 6 #define MEDIA_CAST_CONGESTION_CONTROL_CONGESTION_CONTROL_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/time/tick_clock.h" | 12 #include "base/time/tick_clock.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 | 14 |
| 15 namespace media { | 15 namespace media { |
| 16 namespace cast { | 16 namespace cast { |
| 17 | 17 |
| 18 class CongestionControl { | 18 class CongestionControl { |
| 19 public: | 19 public: |
| 20 virtual ~CongestionControl(); | 20 virtual ~CongestionControl(); |
| 21 | 21 |
| 22 // Called with latest measured rtt value. | 22 // Called with latest measured rtt value. |
| 23 virtual void UpdateRtt(base::TimeDelta rtt) = 0; | 23 virtual void UpdateRtt(base::TimeDelta rtt) = 0; |
| 24 | 24 |
| 25 // Called with an updated target playout delay value. |
| 26 virtual void UpdateTargetPlayoutDelay(base::TimeDelta delay) = 0; |
| 27 |
| 25 // Called when an encoded frame is sent to the transport. | 28 // Called when an encoded frame is sent to the transport. |
| 26 virtual void SendFrameToTransport(uint32 frame_id, | 29 virtual void SendFrameToTransport(uint32 frame_id, |
| 27 size_t frame_size, | 30 size_t frame_size, |
| 28 base::TimeTicks when) = 0; | 31 base::TimeTicks when) = 0; |
| 29 // Called when we receive an ACK for a frame. | 32 // Called when we receive an ACK for a frame. |
| 30 virtual void AckFrame(uint32 frame_id, base::TimeTicks when) = 0; | 33 virtual void AckFrame(uint32 frame_id, base::TimeTicks when) = 0; |
| 31 | 34 |
| 32 // Returns the bitrate we should use for the next frame. | 35 // Returns the bitrate we should use for the next frame. |
| 33 virtual uint32 GetBitrate(base::TimeTicks playout_time, | 36 virtual uint32 GetBitrate(base::TimeTicks playout_time, |
| 34 base::TimeDelta playout_delay) = 0; | 37 base::TimeDelta playout_delay) = 0; |
| 35 }; | 38 }; |
| 36 | 39 |
| 37 CongestionControl* NewAdaptiveCongestionControl( | 40 CongestionControl* NewAdaptiveCongestionControl( |
| 38 base::TickClock* clock, | 41 base::TickClock* clock, |
| 39 uint32 max_bitrate_configured, | 42 uint32 max_bitrate_configured, |
| 40 uint32 min_bitrate_configured, | 43 uint32 min_bitrate_configured, |
| 41 size_t max_unacked_frames); | 44 double max_frame_rate); |
| 42 | 45 |
| 43 CongestionControl* NewFixedCongestionControl(uint32 bitrate); | 46 CongestionControl* NewFixedCongestionControl(uint32 bitrate); |
| 44 | 47 |
| 45 } // namespace cast | 48 } // namespace cast |
| 46 } // namespace media | 49 } // namespace media |
| 47 | 50 |
| 48 #endif // MEDIA_CAST_CONGESTION_CONTROL_CONGESTION_CONTROL_H_ | 51 #endif // MEDIA_CAST_CONGESTION_CONTROL_CONGESTION_CONTROL_H_ |
| OLD | NEW |