Revert "Omit calls to set composing region when pasting image."
[chromium-blink-merge.git] / media / cast / sender / congestion_control.h
blob8e1713409435754b8020c1c24bd0166b9d891122
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
3 // found in the LICENSE file.
5 #ifndef MEDIA_CAST_CONGESTION_CONTROL_CONGESTION_CONTROL_H_
6 #define MEDIA_CAST_CONGESTION_CONTROL_CONGESTION_CONTROL_H_
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/time/tick_clock.h"
11 #include "base/time/time.h"
13 namespace media {
14 namespace cast {
16 class CongestionControl {
17 public:
18 virtual ~CongestionControl();
20 // Called with latest measured rtt value.
21 virtual void UpdateRtt(base::TimeDelta rtt) = 0;
23 // Called with an updated target playout delay value.
24 virtual void UpdateTargetPlayoutDelay(base::TimeDelta delay) = 0;
26 // Called when an encoded frame is enqueued for transport.
27 virtual void SendFrameToTransport(uint32 frame_id,
28 size_t frame_size_in_bits,
29 base::TimeTicks when) = 0;
31 // Called when we receive an ACK for a frame.
32 virtual void AckFrame(uint32 frame_id, base::TimeTicks when) = 0;
34 // Returns the bitrate we should use for the next frame. |soft_max_bitrate|
35 // is a soft upper-bound applied to the computed target bitrate before the
36 // hard upper- and lower-bounds are applied.
37 virtual int GetBitrate(base::TimeTicks playout_time,
38 base::TimeDelta playout_delay,
39 int soft_max_bitrate) = 0;
42 CongestionControl* NewAdaptiveCongestionControl(
43 base::TickClock* clock,
44 int max_bitrate_configured,
45 int min_bitrate_configured,
46 double max_frame_rate);
48 CongestionControl* NewFixedCongestionControl(int bitrate);
50 } // namespace cast
51 } // namespace media
53 #endif // MEDIA_CAST_CONGESTION_CONTROL_CONGESTION_CONTROL_H_