servo_media_streams/
capture.rs

1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5pub struct ConstrainRange<T> {
6    pub min: Option<T>,
7    pub max: Option<T>,
8    pub ideal: Option<T>,
9}
10
11pub enum ConstrainBool {
12    Ideal(bool),
13    Exact(bool),
14}
15
16#[derive(Default)]
17pub struct MediaTrackConstraintSet {
18    pub width: Option<Constrain<u32>>,
19    pub height: Option<Constrain<u32>>,
20    pub aspect: Option<Constrain<f64>>,
21    pub frame_rate: Option<Constrain<f64>>,
22    pub sample_rate: Option<Constrain<u32>>,
23}
24
25pub enum Constrain<T> {
26    Value(T),
27    Range(ConstrainRange<T>),
28}