web_sys/features/
gen_VideoEncoderConfig.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[cfg(web_sys_unstable_apis)]
6#[wasm_bindgen]
7extern "C" {
8    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = VideoEncoderConfig)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `VideoEncoderConfig` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"]
13    #[doc = ""]
14    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
15    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
16    pub type VideoEncoderConfig;
17    #[cfg(web_sys_unstable_apis)]
18    #[cfg(feature = "AlphaOption")]
19    #[doc = "Get the `alpha` field of this object."]
20    #[doc = ""]
21    #[doc = "*This API requires the following crate features to be activated: `AlphaOption`, `VideoEncoderConfig`*"]
22    #[doc = ""]
23    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
24    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
25    #[wasm_bindgen(method, getter = "alpha")]
26    pub fn get_alpha(this: &VideoEncoderConfig) -> Option<AlphaOption>;
27    #[cfg(web_sys_unstable_apis)]
28    #[cfg(feature = "AlphaOption")]
29    #[doc = "Change the `alpha` field of this object."]
30    #[doc = ""]
31    #[doc = "*This API requires the following crate features to be activated: `AlphaOption`, `VideoEncoderConfig`*"]
32    #[doc = ""]
33    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
34    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
35    #[wasm_bindgen(method, setter = "alpha")]
36    pub fn set_alpha(this: &VideoEncoderConfig, val: AlphaOption);
37    #[cfg(web_sys_unstable_apis)]
38    #[doc = "Get the `bitrate` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"]
41    #[doc = ""]
42    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
43    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
44    #[wasm_bindgen(method, getter = "bitrate")]
45    pub fn get_bitrate(this: &VideoEncoderConfig) -> Option<f64>;
46    #[cfg(web_sys_unstable_apis)]
47    #[doc = "Change the `bitrate` field of this object."]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"]
50    #[doc = ""]
51    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
52    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
53    #[wasm_bindgen(method, setter = "bitrate")]
54    pub fn set_bitrate(this: &VideoEncoderConfig, val: f64);
55    #[cfg(web_sys_unstable_apis)]
56    #[doc = "Get the `codec` field of this object."]
57    #[doc = ""]
58    #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"]
59    #[doc = ""]
60    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
61    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
62    #[wasm_bindgen(method, getter = "codec")]
63    pub fn get_codec(this: &VideoEncoderConfig) -> ::alloc::string::String;
64    #[cfg(web_sys_unstable_apis)]
65    #[doc = "Change the `codec` field of this object."]
66    #[doc = ""]
67    #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"]
68    #[doc = ""]
69    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
70    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
71    #[wasm_bindgen(method, setter = "codec")]
72    pub fn set_codec(this: &VideoEncoderConfig, val: &str);
73    #[cfg(web_sys_unstable_apis)]
74    #[doc = "Get the `displayHeight` field of this object."]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"]
77    #[doc = ""]
78    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
79    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
80    #[wasm_bindgen(method, getter = "displayHeight")]
81    pub fn get_display_height(this: &VideoEncoderConfig) -> Option<u32>;
82    #[cfg(web_sys_unstable_apis)]
83    #[doc = "Change the `displayHeight` field of this object."]
84    #[doc = ""]
85    #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"]
86    #[doc = ""]
87    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
88    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
89    #[wasm_bindgen(method, setter = "displayHeight")]
90    pub fn set_display_height(this: &VideoEncoderConfig, val: u32);
91    #[cfg(web_sys_unstable_apis)]
92    #[doc = "Get the `displayWidth` field of this object."]
93    #[doc = ""]
94    #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"]
95    #[doc = ""]
96    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
97    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
98    #[wasm_bindgen(method, getter = "displayWidth")]
99    pub fn get_display_width(this: &VideoEncoderConfig) -> Option<u32>;
100    #[cfg(web_sys_unstable_apis)]
101    #[doc = "Change the `displayWidth` field of this object."]
102    #[doc = ""]
103    #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"]
104    #[doc = ""]
105    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
106    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
107    #[wasm_bindgen(method, setter = "displayWidth")]
108    pub fn set_display_width(this: &VideoEncoderConfig, val: u32);
109    #[cfg(web_sys_unstable_apis)]
110    #[doc = "Get the `framerate` field of this object."]
111    #[doc = ""]
112    #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"]
113    #[doc = ""]
114    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
115    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
116    #[wasm_bindgen(method, getter = "framerate")]
117    pub fn get_framerate(this: &VideoEncoderConfig) -> Option<f64>;
118    #[cfg(web_sys_unstable_apis)]
119    #[doc = "Change the `framerate` field of this object."]
120    #[doc = ""]
121    #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"]
122    #[doc = ""]
123    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
124    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
125    #[wasm_bindgen(method, setter = "framerate")]
126    pub fn set_framerate(this: &VideoEncoderConfig, val: f64);
127    #[cfg(web_sys_unstable_apis)]
128    #[cfg(feature = "HardwareAcceleration")]
129    #[doc = "Get the `hardwareAcceleration` field of this object."]
130    #[doc = ""]
131    #[doc = "*This API requires the following crate features to be activated: `HardwareAcceleration`, `VideoEncoderConfig`*"]
132    #[doc = ""]
133    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
134    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
135    #[wasm_bindgen(method, getter = "hardwareAcceleration")]
136    pub fn get_hardware_acceleration(this: &VideoEncoderConfig) -> Option<HardwareAcceleration>;
137    #[cfg(web_sys_unstable_apis)]
138    #[cfg(feature = "HardwareAcceleration")]
139    #[doc = "Change the `hardwareAcceleration` field of this object."]
140    #[doc = ""]
141    #[doc = "*This API requires the following crate features to be activated: `HardwareAcceleration`, `VideoEncoderConfig`*"]
142    #[doc = ""]
143    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
144    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
145    #[wasm_bindgen(method, setter = "hardwareAcceleration")]
146    pub fn set_hardware_acceleration(this: &VideoEncoderConfig, val: HardwareAcceleration);
147    #[cfg(web_sys_unstable_apis)]
148    #[doc = "Get the `height` field of this object."]
149    #[doc = ""]
150    #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"]
151    #[doc = ""]
152    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
153    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
154    #[wasm_bindgen(method, getter = "height")]
155    pub fn get_height(this: &VideoEncoderConfig) -> u32;
156    #[cfg(web_sys_unstable_apis)]
157    #[doc = "Change the `height` field of this object."]
158    #[doc = ""]
159    #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"]
160    #[doc = ""]
161    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
162    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
163    #[wasm_bindgen(method, setter = "height")]
164    pub fn set_height(this: &VideoEncoderConfig, val: u32);
165    #[cfg(web_sys_unstable_apis)]
166    #[cfg(feature = "LatencyMode")]
167    #[doc = "Get the `latencyMode` field of this object."]
168    #[doc = ""]
169    #[doc = "*This API requires the following crate features to be activated: `LatencyMode`, `VideoEncoderConfig`*"]
170    #[doc = ""]
171    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
172    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
173    #[wasm_bindgen(method, getter = "latencyMode")]
174    pub fn get_latency_mode(this: &VideoEncoderConfig) -> Option<LatencyMode>;
175    #[cfg(web_sys_unstable_apis)]
176    #[cfg(feature = "LatencyMode")]
177    #[doc = "Change the `latencyMode` field of this object."]
178    #[doc = ""]
179    #[doc = "*This API requires the following crate features to be activated: `LatencyMode`, `VideoEncoderConfig`*"]
180    #[doc = ""]
181    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
182    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
183    #[wasm_bindgen(method, setter = "latencyMode")]
184    pub fn set_latency_mode(this: &VideoEncoderConfig, val: LatencyMode);
185    #[cfg(web_sys_unstable_apis)]
186    #[doc = "Get the `scalabilityMode` field of this object."]
187    #[doc = ""]
188    #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"]
189    #[doc = ""]
190    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
191    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
192    #[wasm_bindgen(method, getter = "scalabilityMode")]
193    pub fn get_scalability_mode(this: &VideoEncoderConfig) -> Option<::alloc::string::String>;
194    #[cfg(web_sys_unstable_apis)]
195    #[doc = "Change the `scalabilityMode` field of this object."]
196    #[doc = ""]
197    #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"]
198    #[doc = ""]
199    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
200    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
201    #[wasm_bindgen(method, setter = "scalabilityMode")]
202    pub fn set_scalability_mode(this: &VideoEncoderConfig, val: &str);
203    #[cfg(web_sys_unstable_apis)]
204    #[doc = "Get the `width` field of this object."]
205    #[doc = ""]
206    #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"]
207    #[doc = ""]
208    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
209    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
210    #[wasm_bindgen(method, getter = "width")]
211    pub fn get_width(this: &VideoEncoderConfig) -> u32;
212    #[cfg(web_sys_unstable_apis)]
213    #[doc = "Change the `width` field of this object."]
214    #[doc = ""]
215    #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"]
216    #[doc = ""]
217    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
218    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
219    #[wasm_bindgen(method, setter = "width")]
220    pub fn set_width(this: &VideoEncoderConfig, val: u32);
221}
222#[cfg(web_sys_unstable_apis)]
223impl VideoEncoderConfig {
224    #[doc = "Construct a new `VideoEncoderConfig`."]
225    #[doc = ""]
226    #[doc = "*This API requires the following crate features to be activated: `VideoEncoderConfig`*"]
227    #[doc = ""]
228    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
229    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
230    pub fn new(codec: &str, height: u32, width: u32) -> Self {
231        #[allow(unused_mut)]
232        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
233        ret.set_codec(codec);
234        ret.set_height(height);
235        ret.set_width(width);
236        ret
237    }
238    #[cfg(web_sys_unstable_apis)]
239    #[cfg(feature = "AlphaOption")]
240    #[deprecated = "Use `set_alpha()` instead."]
241    pub fn alpha(&mut self, val: AlphaOption) -> &mut Self {
242        self.set_alpha(val);
243        self
244    }
245    #[cfg(web_sys_unstable_apis)]
246    #[deprecated = "Use `set_bitrate()` instead."]
247    pub fn bitrate(&mut self, val: f64) -> &mut Self {
248        self.set_bitrate(val);
249        self
250    }
251    #[cfg(web_sys_unstable_apis)]
252    #[deprecated = "Use `set_codec()` instead."]
253    pub fn codec(&mut self, val: &str) -> &mut Self {
254        self.set_codec(val);
255        self
256    }
257    #[cfg(web_sys_unstable_apis)]
258    #[deprecated = "Use `set_display_height()` instead."]
259    pub fn display_height(&mut self, val: u32) -> &mut Self {
260        self.set_display_height(val);
261        self
262    }
263    #[cfg(web_sys_unstable_apis)]
264    #[deprecated = "Use `set_display_width()` instead."]
265    pub fn display_width(&mut self, val: u32) -> &mut Self {
266        self.set_display_width(val);
267        self
268    }
269    #[cfg(web_sys_unstable_apis)]
270    #[deprecated = "Use `set_framerate()` instead."]
271    pub fn framerate(&mut self, val: f64) -> &mut Self {
272        self.set_framerate(val);
273        self
274    }
275    #[cfg(web_sys_unstable_apis)]
276    #[cfg(feature = "HardwareAcceleration")]
277    #[deprecated = "Use `set_hardware_acceleration()` instead."]
278    pub fn hardware_acceleration(&mut self, val: HardwareAcceleration) -> &mut Self {
279        self.set_hardware_acceleration(val);
280        self
281    }
282    #[cfg(web_sys_unstable_apis)]
283    #[deprecated = "Use `set_height()` instead."]
284    pub fn height(&mut self, val: u32) -> &mut Self {
285        self.set_height(val);
286        self
287    }
288    #[cfg(web_sys_unstable_apis)]
289    #[cfg(feature = "LatencyMode")]
290    #[deprecated = "Use `set_latency_mode()` instead."]
291    pub fn latency_mode(&mut self, val: LatencyMode) -> &mut Self {
292        self.set_latency_mode(val);
293        self
294    }
295    #[cfg(web_sys_unstable_apis)]
296    #[deprecated = "Use `set_scalability_mode()` instead."]
297    pub fn scalability_mode(&mut self, val: &str) -> &mut Self {
298        self.set_scalability_mode(val);
299        self
300    }
301    #[cfg(web_sys_unstable_apis)]
302    #[deprecated = "Use `set_width()` instead."]
303    pub fn width(&mut self, val: u32) -> &mut Self {
304        self.set_width(val);
305        self
306    }
307}