mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 05:40:42 +01:00

Bug: none Change-Id: Iad6dfdfdae13149bb8abe4b884e288e50aa7b73d Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/135102 Reviewed-by: Stefan Holmer <stefan@webrtc.org> Commit-Queue: Åsa Persson <asapersson@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27892}
49 lines
1.4 KiB
C++
49 lines
1.4 KiB
C++
/*
|
|
* Copyright 2019 The WebRTC project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#ifndef RTC_BASE_EXPERIMENTS_BALANCED_DEGRADATION_SETTINGS_H_
|
|
#define RTC_BASE_EXPERIMENTS_BALANCED_DEGRADATION_SETTINGS_H_
|
|
|
|
#include <vector>
|
|
|
|
namespace webrtc {
|
|
|
|
class BalancedDegradationSettings {
|
|
public:
|
|
BalancedDegradationSettings();
|
|
~BalancedDegradationSettings();
|
|
|
|
struct Config {
|
|
Config();
|
|
Config(int pixels, int fps);
|
|
|
|
bool operator==(const Config& o) const {
|
|
return pixels == o.pixels && fps == o.fps;
|
|
}
|
|
|
|
int pixels = 0; // The video frame size.
|
|
int fps = 0; // The framerate to be used if the frame size is less than
|
|
// or equal to |pixels|.
|
|
};
|
|
|
|
// Returns configurations from field trial on success (default on failure).
|
|
std::vector<Config> GetConfigs() const;
|
|
|
|
// Gets the min/max framerate from |configs_| based on |pixels|.
|
|
int MinFps(int pixels) const;
|
|
int MaxFps(int pixels) const;
|
|
|
|
private:
|
|
std::vector<Config> configs_;
|
|
};
|
|
|
|
} // namespace webrtc
|
|
|
|
#endif // RTC_BASE_EXPERIMENTS_BALANCED_DEGRADATION_SETTINGS_H_
|