web_sys/features/
gen_RtcRtpEncodingParameters.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCRtpEncodingParameters)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `RtcRtpEncodingParameters` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"]
12    pub type RtcRtpEncodingParameters;
13    #[doc = "Get the `active` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"]
16    #[wasm_bindgen(method, getter = "active")]
17    pub fn get_active(this: &RtcRtpEncodingParameters) -> Option<bool>;
18    #[doc = "Change the `active` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"]
21    #[wasm_bindgen(method, setter = "active")]
22    pub fn set_active(this: &RtcRtpEncodingParameters, val: bool);
23    #[cfg(feature = "RtcDegradationPreference")]
24    #[doc = "Get the `degradationPreference` field of this object."]
25    #[doc = ""]
26    #[doc = "*This API requires the following crate features to be activated: `RtcDegradationPreference`, `RtcRtpEncodingParameters`*"]
27    #[wasm_bindgen(method, getter = "degradationPreference")]
28    pub fn get_degradation_preference(
29        this: &RtcRtpEncodingParameters,
30    ) -> Option<RtcDegradationPreference>;
31    #[cfg(feature = "RtcDegradationPreference")]
32    #[doc = "Change the `degradationPreference` field of this object."]
33    #[doc = ""]
34    #[doc = "*This API requires the following crate features to be activated: `RtcDegradationPreference`, `RtcRtpEncodingParameters`*"]
35    #[wasm_bindgen(method, setter = "degradationPreference")]
36    pub fn set_degradation_preference(
37        this: &RtcRtpEncodingParameters,
38        val: RtcDegradationPreference,
39    );
40    #[cfg(feature = "RtcFecParameters")]
41    #[doc = "Get the `fec` field of this object."]
42    #[doc = ""]
43    #[doc = "*This API requires the following crate features to be activated: `RtcFecParameters`, `RtcRtpEncodingParameters`*"]
44    #[wasm_bindgen(method, getter = "fec")]
45    pub fn get_fec(this: &RtcRtpEncodingParameters) -> Option<RtcFecParameters>;
46    #[cfg(feature = "RtcFecParameters")]
47    #[doc = "Change the `fec` field of this object."]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `RtcFecParameters`, `RtcRtpEncodingParameters`*"]
50    #[wasm_bindgen(method, setter = "fec")]
51    pub fn set_fec(this: &RtcRtpEncodingParameters, val: &RtcFecParameters);
52    #[doc = "Get the `maxBitrate` field of this object."]
53    #[doc = ""]
54    #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"]
55    #[wasm_bindgen(method, getter = "maxBitrate")]
56    pub fn get_max_bitrate(this: &RtcRtpEncodingParameters) -> Option<u32>;
57    #[doc = "Change the `maxBitrate` field of this object."]
58    #[doc = ""]
59    #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"]
60    #[wasm_bindgen(method, setter = "maxBitrate")]
61    pub fn set_max_bitrate(this: &RtcRtpEncodingParameters, val: u32);
62    #[cfg(feature = "RtcPriorityType")]
63    #[doc = "Get the `priority` field of this object."]
64    #[doc = ""]
65    #[doc = "*This API requires the following crate features to be activated: `RtcPriorityType`, `RtcRtpEncodingParameters`*"]
66    #[wasm_bindgen(method, getter = "priority")]
67    pub fn get_priority(this: &RtcRtpEncodingParameters) -> Option<RtcPriorityType>;
68    #[cfg(feature = "RtcPriorityType")]
69    #[doc = "Change the `priority` field of this object."]
70    #[doc = ""]
71    #[doc = "*This API requires the following crate features to be activated: `RtcPriorityType`, `RtcRtpEncodingParameters`*"]
72    #[wasm_bindgen(method, setter = "priority")]
73    pub fn set_priority(this: &RtcRtpEncodingParameters, val: RtcPriorityType);
74    #[doc = "Get the `rid` field of this object."]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"]
77    #[wasm_bindgen(method, getter = "rid")]
78    pub fn get_rid(this: &RtcRtpEncodingParameters) -> Option<::alloc::string::String>;
79    #[doc = "Change the `rid` field of this object."]
80    #[doc = ""]
81    #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"]
82    #[wasm_bindgen(method, setter = "rid")]
83    pub fn set_rid(this: &RtcRtpEncodingParameters, val: &str);
84    #[cfg(feature = "RtcRtxParameters")]
85    #[doc = "Get the `rtx` field of this object."]
86    #[doc = ""]
87    #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`, `RtcRtxParameters`*"]
88    #[wasm_bindgen(method, getter = "rtx")]
89    pub fn get_rtx(this: &RtcRtpEncodingParameters) -> Option<RtcRtxParameters>;
90    #[cfg(feature = "RtcRtxParameters")]
91    #[doc = "Change the `rtx` field of this object."]
92    #[doc = ""]
93    #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`, `RtcRtxParameters`*"]
94    #[wasm_bindgen(method, setter = "rtx")]
95    pub fn set_rtx(this: &RtcRtpEncodingParameters, val: &RtcRtxParameters);
96    #[cfg(web_sys_unstable_apis)]
97    #[doc = "Get the `scalabilityMode` field of this object."]
98    #[doc = ""]
99    #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"]
100    #[doc = ""]
101    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
102    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
103    #[wasm_bindgen(method, getter = "scalabilityMode")]
104    pub fn get_scalability_mode(this: &RtcRtpEncodingParameters)
105        -> Option<::alloc::string::String>;
106    #[cfg(web_sys_unstable_apis)]
107    #[doc = "Change the `scalabilityMode` field of this object."]
108    #[doc = ""]
109    #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"]
110    #[doc = ""]
111    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
112    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
113    #[wasm_bindgen(method, setter = "scalabilityMode")]
114    pub fn set_scalability_mode(this: &RtcRtpEncodingParameters, val: &str);
115    #[doc = "Get the `scaleResolutionDownBy` field of this object."]
116    #[doc = ""]
117    #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"]
118    #[wasm_bindgen(method, getter = "scaleResolutionDownBy")]
119    pub fn get_scale_resolution_down_by(this: &RtcRtpEncodingParameters) -> Option<f32>;
120    #[doc = "Change the `scaleResolutionDownBy` field of this object."]
121    #[doc = ""]
122    #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"]
123    #[wasm_bindgen(method, setter = "scaleResolutionDownBy")]
124    pub fn set_scale_resolution_down_by(this: &RtcRtpEncodingParameters, val: f32);
125    #[doc = "Get the `ssrc` field of this object."]
126    #[doc = ""]
127    #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"]
128    #[wasm_bindgen(method, getter = "ssrc")]
129    pub fn get_ssrc(this: &RtcRtpEncodingParameters) -> Option<u32>;
130    #[doc = "Change the `ssrc` field of this object."]
131    #[doc = ""]
132    #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"]
133    #[wasm_bindgen(method, setter = "ssrc")]
134    pub fn set_ssrc(this: &RtcRtpEncodingParameters, val: u32);
135}
136impl RtcRtpEncodingParameters {
137    #[doc = "Construct a new `RtcRtpEncodingParameters`."]
138    #[doc = ""]
139    #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"]
140    pub fn new() -> Self {
141        #[allow(unused_mut)]
142        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
143        ret
144    }
145    #[deprecated = "Use `set_active()` instead."]
146    pub fn active(&mut self, val: bool) -> &mut Self {
147        self.set_active(val);
148        self
149    }
150    #[cfg(feature = "RtcDegradationPreference")]
151    #[deprecated = "Use `set_degradation_preference()` instead."]
152    pub fn degradation_preference(&mut self, val: RtcDegradationPreference) -> &mut Self {
153        self.set_degradation_preference(val);
154        self
155    }
156    #[cfg(feature = "RtcFecParameters")]
157    #[deprecated = "Use `set_fec()` instead."]
158    pub fn fec(&mut self, val: &RtcFecParameters) -> &mut Self {
159        self.set_fec(val);
160        self
161    }
162    #[deprecated = "Use `set_max_bitrate()` instead."]
163    pub fn max_bitrate(&mut self, val: u32) -> &mut Self {
164        self.set_max_bitrate(val);
165        self
166    }
167    #[cfg(feature = "RtcPriorityType")]
168    #[deprecated = "Use `set_priority()` instead."]
169    pub fn priority(&mut self, val: RtcPriorityType) -> &mut Self {
170        self.set_priority(val);
171        self
172    }
173    #[deprecated = "Use `set_rid()` instead."]
174    pub fn rid(&mut self, val: &str) -> &mut Self {
175        self.set_rid(val);
176        self
177    }
178    #[cfg(feature = "RtcRtxParameters")]
179    #[deprecated = "Use `set_rtx()` instead."]
180    pub fn rtx(&mut self, val: &RtcRtxParameters) -> &mut Self {
181        self.set_rtx(val);
182        self
183    }
184    #[cfg(web_sys_unstable_apis)]
185    #[deprecated = "Use `set_scalability_mode()` instead."]
186    pub fn scalability_mode(&mut self, val: &str) -> &mut Self {
187        self.set_scalability_mode(val);
188        self
189    }
190    #[deprecated = "Use `set_scale_resolution_down_by()` instead."]
191    pub fn scale_resolution_down_by(&mut self, val: f32) -> &mut Self {
192        self.set_scale_resolution_down_by(val);
193        self
194    }
195    #[deprecated = "Use `set_ssrc()` instead."]
196    pub fn ssrc(&mut self, val: u32) -> &mut Self {
197        self.set_ssrc(val);
198        self
199    }
200}
201impl Default for RtcRtpEncodingParameters {
202    fn default() -> Self {
203        Self::new()
204    }
205}