Remove INJECT_EVENTS permissions from test APKs.
[chromium-blink-merge.git] / media / cast / sender / congestion_control.h
blob8c3d764e20fc73f19e11936a1722066746446663
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 <deque>
10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/time/tick_clock.h"
13 #include "base/time/time.h"
15 namespace media {
16 namespace cast {
18 class CongestionControl {
19 public:
20 virtual ~CongestionControl();
22 // Called with latest measured rtt value.
23 virtual void UpdateRtt(base::TimeDelta rtt) = 0;
25 // Called with an updated target playout delay value.
26 virtual void UpdateTargetPlayoutDelay(base::TimeDelta delay) = 0;
28 // Called when an encoded frame is sent to the transport.
29 virtual void SendFrameToTransport(uint32 frame_id,
30 size_t frame_size,
31 base::TimeTicks when) = 0;
32 // Called when we receive an ACK for a frame.
33 virtual void AckFrame(uint32 frame_id, base::TimeTicks when) = 0;
35 // Returns the bitrate we should use for the next frame.
36 virtual uint32 GetBitrate(base::TimeTicks playout_time,
37 base::TimeDelta playout_delay) = 0;
40 CongestionControl* NewAdaptiveCongestionControl(
41 base::TickClock* clock,
42 uint32 max_bitrate_configured,
43 uint32 min_bitrate_configured,
44 double max_frame_rate);
46 CongestionControl* NewFixedCongestionControl(uint32 bitrate);
48 } // namespace cast
49 } // namespace media
51 #endif // MEDIA_CAST_CONGESTION_CONTROL_CONGESTION_CONTROL_H_