Agora C++ API Reference for All Platforms
Loading...
Searching...
No Matches
bitrate_constraints.h
1/*
2 * Copyright (c) 2018 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#pragma once
11
12#include <algorithm>
13
14namespace agora {
15namespace rtc {
16
17// TODO(srte): BitrateConstraints and BitrateSettings should be merged.
18// Both represent the same kind data, but are using different default
19// initializer and representation of unset values.
22 int start_bitrate_bps = kDefaultStartBitrateBps;
24
25 private:
26 static constexpr int kDefaultStartBitrateBps = 300000;
27};
28
29// Like std::min, but considers non-positive values to be unset.
30template <typename T>
31static T MinPositive(T a, T b) {
32 if (a <= 0) {
33 return b;
34 }
35 if (b <= 0) {
36 return a;
37 }
38 return std::min(a, b);
39}
40
41} // namespace rtc
42} // namespace agora
Definition AgoraExtensions.h:5
static T MinPositive(T a, T b)
Definition bitrate_constraints.h:31
Definition AgoraAtomicOps.h:21
Definition bitrate_constraints.h:20
int max_bitrate_bps
Definition bitrate_constraints.h:23
int start_bitrate_bps
Definition bitrate_constraints.h:22
int min_bitrate_bps
Definition bitrate_constraints.h:21