Update param computation (#87)

* import sorter config

* organize video types

* ignore import sort for proto files

* equality for video types

* impl

* adjust defaults

* max
This commit is contained in:
Hiroshi Horie
2022-03-01 10:45:24 +09:00
committed by GitHub
parent 7843e87254
commit 7c16d2f3ec
5 changed files with 112 additions and 27 deletions
+6
View File
@@ -40,6 +40,12 @@ class VideoDimensions {
}
extension VideoDimensionsHelpers on VideoDimensions {
// aspect ratios
static const aspect169 = 16.0 / 9.0;
static const aspect43 = 4.0 / 3.0;
double aspect() => width > height ? width / height : height / width;
/// Returns the larger value
int max() => math.max(width, height);
+12
View File
@@ -56,6 +56,18 @@ class VideoParameters implements Comparable<VideoParameters> {
}
extension VideoParametersPresets on VideoParameters {
// 16:9 default
static final List<VideoParameters> defaultSimulcast169 = [
h180_169,
h360_169,
];
// 4:3 default
static final List<VideoParameters> defaultSimulcast43 = [
h180_43,
h360_43,
];
// all 16:9 presets
static final List<VideoParameters> all169 = [
h90_169,