Line data Source code
1 : /*
2 : * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 : *
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
6 : * tree. An additional intellectual property rights grant can be found
7 : * in the file PATENTS. All contributing project authors may
8 : * be found in the AUTHORS file in the root of the source tree.
9 : */
10 :
11 : #ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_INCLUDE_BWE_DEFINES_H_
12 : #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_INCLUDE_BWE_DEFINES_H_
13 :
14 : #include "webrtc/base/optional.h"
15 : #include "webrtc/typedefs.h"
16 :
17 : #define BWE_MAX(a, b) ((a) > (b) ? (a) : (b))
18 : #define BWE_MIN(a, b) ((a) < (b) ? (a) : (b))
19 :
20 : namespace webrtc {
21 :
22 : namespace congestion_controller {
23 : int GetMinBitrateBps();
24 : } // namespace congestion_controller
25 :
26 : static const int64_t kBitrateWindowMs = 1000;
27 :
28 : extern const char* kBweTypeHistogram;
29 :
30 : enum BweNames {
31 : kReceiverNoExtension = 0,
32 : kReceiverTOffset = 1,
33 : kReceiverAbsSendTime = 2,
34 : kSendSideTransportSeqNum = 3,
35 : kBweNamesMax = 4
36 : };
37 :
38 : enum BandwidthUsage {
39 : kBwNormal = 0,
40 : kBwUnderusing = 1,
41 : kBwOverusing = 2,
42 : };
43 :
44 : enum RateControlState { kRcHold, kRcIncrease, kRcDecrease };
45 :
46 : enum RateControlRegion { kRcNearMax, kRcAboveMax, kRcMaxUnknown };
47 :
48 0 : struct RateControlInput {
49 0 : RateControlInput(BandwidthUsage bw_state,
50 : const rtc::Optional<uint32_t>& incoming_bitrate,
51 : double noise_var)
52 0 : : bw_state(bw_state),
53 : incoming_bitrate(incoming_bitrate),
54 0 : noise_var(noise_var) {}
55 :
56 : BandwidthUsage bw_state;
57 : rtc::Optional<uint32_t> incoming_bitrate;
58 : double noise_var;
59 : };
60 : } // namespace webrtc
61 :
62 : #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_INCLUDE_BWE_DEFINES_H_
|