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 MODULES_REMOTE_BITRATE_ESTIMATOR_INCLUDE_BWE_DEFINES_H_ 12 #define MODULES_REMOTE_BITRATE_ESTIMATOR_INCLUDE_BWE_DEFINES_H_ 13 14 #include <stdint.h> 15 16 #include "absl/types/optional.h" 17 #include "api/network_state_predictor.h" 18 #include "api/units/data_rate.h" 19 20 #define BWE_MAX(a, b) ((a) > (b) ? (a) : (b)) 21 #define BWE_MIN(a, b) ((a) < (b) ? (a) : (b)) 22 23 namespace webrtc { 24 25 namespace congestion_controller { 26 int GetMinBitrateBps(); 27 DataRate GetMinBitrate(); 28 } // namespace congestion_controller 29 30 static const int64_t kBitrateWindowMs = 1000; 31 32 extern const char kBweTypeHistogram[]; 33 34 enum BweNames { 35 kReceiverNoExtension = 0, 36 kReceiverTOffset = 1, 37 kReceiverAbsSendTime = 2, 38 kSendSideTransportSeqNum = 3, 39 kBweNamesMax = 4 40 }; 41 42 enum RateControlState { kRcHold, kRcIncrease, kRcDecrease }; 43 44 struct RateControlInput { 45 RateControlInput(BandwidthUsage bw_state, 46 const absl::optional<DataRate>& estimated_throughput); 47 ~RateControlInput(); 48 49 BandwidthUsage bw_state; 50 absl::optional<DataRate> estimated_throughput; 51 }; 52 } // namespace webrtc 53 54 #endif // MODULES_REMOTE_BITRATE_ESTIMATOR_INCLUDE_BWE_DEFINES_H_ 55