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:
@@ -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);
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user