web_sys/features/
gen_VideoDecoderConfig.rs1#![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 = VideoDecoderConfig)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `VideoDecoderConfig` dictionary."]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
16 pub type VideoDecoderConfig;
17 #[cfg(web_sys_unstable_apis)]
18 #[doc = "Get the `codec` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
21 #[doc = ""]
22 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
23 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
24 #[wasm_bindgen(method, getter = "codec")]
25 pub fn get_codec(this: &VideoDecoderConfig) -> ::alloc::string::String;
26 #[cfg(web_sys_unstable_apis)]
27 #[doc = "Change the `codec` field of this object."]
28 #[doc = ""]
29 #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
30 #[doc = ""]
31 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
32 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
33 #[wasm_bindgen(method, setter = "codec")]
34 pub fn set_codec(this: &VideoDecoderConfig, val: &str);
35 #[cfg(web_sys_unstable_apis)]
36 #[doc = "Get the `codedHeight` field of this object."]
37 #[doc = ""]
38 #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
39 #[doc = ""]
40 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
41 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
42 #[wasm_bindgen(method, getter = "codedHeight")]
43 pub fn get_coded_height(this: &VideoDecoderConfig) -> Option<u32>;
44 #[cfg(web_sys_unstable_apis)]
45 #[doc = "Change the `codedHeight` field of this object."]
46 #[doc = ""]
47 #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
48 #[doc = ""]
49 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
50 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
51 #[wasm_bindgen(method, setter = "codedHeight")]
52 pub fn set_coded_height(this: &VideoDecoderConfig, val: u32);
53 #[cfg(web_sys_unstable_apis)]
54 #[doc = "Get the `codedWidth` field of this object."]
55 #[doc = ""]
56 #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
57 #[doc = ""]
58 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
59 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
60 #[wasm_bindgen(method, getter = "codedWidth")]
61 pub fn get_coded_width(this: &VideoDecoderConfig) -> Option<u32>;
62 #[cfg(web_sys_unstable_apis)]
63 #[doc = "Change the `codedWidth` field of this object."]
64 #[doc = ""]
65 #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
66 #[doc = ""]
67 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
68 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
69 #[wasm_bindgen(method, setter = "codedWidth")]
70 pub fn set_coded_width(this: &VideoDecoderConfig, val: u32);
71 #[cfg(web_sys_unstable_apis)]
72 #[cfg(feature = "VideoColorSpaceInit")]
73 #[doc = "Get the `colorSpace` field of this object."]
74 #[doc = ""]
75 #[doc = "*This API requires the following crate features to be activated: `VideoColorSpaceInit`, `VideoDecoderConfig`*"]
76 #[doc = ""]
77 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
78 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
79 #[wasm_bindgen(method, getter = "colorSpace")]
80 pub fn get_color_space(this: &VideoDecoderConfig) -> Option<VideoColorSpaceInit>;
81 #[cfg(web_sys_unstable_apis)]
82 #[cfg(feature = "VideoColorSpaceInit")]
83 #[doc = "Change the `colorSpace` field of this object."]
84 #[doc = ""]
85 #[doc = "*This API requires the following crate features to be activated: `VideoColorSpaceInit`, `VideoDecoderConfig`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
89 #[wasm_bindgen(method, setter = "colorSpace")]
90 pub fn set_color_space(this: &VideoDecoderConfig, val: &VideoColorSpaceInit);
91 #[cfg(web_sys_unstable_apis)]
92 #[doc = "Get the `description` field of this object."]
93 #[doc = ""]
94 #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
98 #[wasm_bindgen(method, getter = "description")]
99 pub fn get_description(this: &VideoDecoderConfig) -> Option<::js_sys::Object>;
100 #[cfg(web_sys_unstable_apis)]
101 #[doc = "Change the `description` field of this object."]
102 #[doc = ""]
103 #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
107 #[wasm_bindgen(method, setter = "description")]
108 pub fn set_description(this: &VideoDecoderConfig, val: &::js_sys::Object);
109 #[cfg(web_sys_unstable_apis)]
110 #[doc = "Change the `description` field of this object."]
111 #[doc = ""]
112 #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
116 #[doc = "# Safety"]
117 #[doc = ""]
118 #[doc = "The `val` slice must outlive any use of the dictionary on the JavaScript side. wasm-bindgen passes a raw view into wasm linear memory — if the underlying data is freed or moved before JS is done reading the field, the behaviour is undefined. Prefer the `_array` variant (takes `&Uint8Array`) for a safe alternative that copies the data."]
119 #[wasm_bindgen(method, setter = "description")]
120 pub unsafe fn set_description_u8_slice(this: &VideoDecoderConfig, val: &mut [u8]);
121 #[cfg(web_sys_unstable_apis)]
122 #[doc = "Change the `description` field of this object."]
123 #[doc = ""]
124 #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
125 #[doc = ""]
126 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
127 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
128 #[wasm_bindgen(method, setter = "description")]
129 pub fn set_description_u8_array(this: &VideoDecoderConfig, val: &::js_sys::Uint8Array);
130 #[cfg(web_sys_unstable_apis)]
131 #[doc = "Get the `displayAspectHeight` field of this object."]
132 #[doc = ""]
133 #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
134 #[doc = ""]
135 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
136 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
137 #[wasm_bindgen(method, getter = "displayAspectHeight")]
138 pub fn get_display_aspect_height(this: &VideoDecoderConfig) -> Option<u32>;
139 #[cfg(web_sys_unstable_apis)]
140 #[doc = "Change the `displayAspectHeight` field of this object."]
141 #[doc = ""]
142 #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
143 #[doc = ""]
144 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
145 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
146 #[wasm_bindgen(method, setter = "displayAspectHeight")]
147 pub fn set_display_aspect_height(this: &VideoDecoderConfig, val: u32);
148 #[cfg(web_sys_unstable_apis)]
149 #[doc = "Get the `displayAspectWidth` field of this object."]
150 #[doc = ""]
151 #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
152 #[doc = ""]
153 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
154 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
155 #[wasm_bindgen(method, getter = "displayAspectWidth")]
156 pub fn get_display_aspect_width(this: &VideoDecoderConfig) -> Option<u32>;
157 #[cfg(web_sys_unstable_apis)]
158 #[doc = "Change the `displayAspectWidth` field of this object."]
159 #[doc = ""]
160 #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
161 #[doc = ""]
162 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
163 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
164 #[wasm_bindgen(method, setter = "displayAspectWidth")]
165 pub fn set_display_aspect_width(this: &VideoDecoderConfig, val: u32);
166 #[cfg(web_sys_unstable_apis)]
167 #[doc = "Get the `flip` field of this object."]
168 #[doc = ""]
169 #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
173 #[wasm_bindgen(method, getter = "flip")]
174 pub fn get_flip(this: &VideoDecoderConfig) -> Option<bool>;
175 #[cfg(web_sys_unstable_apis)]
176 #[doc = "Change the `flip` field of this object."]
177 #[doc = ""]
178 #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
179 #[doc = ""]
180 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
181 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
182 #[wasm_bindgen(method, setter = "flip")]
183 pub fn set_flip(this: &VideoDecoderConfig, val: bool);
184 #[cfg(web_sys_unstable_apis)]
185 #[cfg(feature = "HardwareAcceleration")]
186 #[doc = "Get the `hardwareAcceleration` field of this object."]
187 #[doc = ""]
188 #[doc = "*This API requires the following crate features to be activated: `HardwareAcceleration`, `VideoDecoderConfig`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
192 #[wasm_bindgen(method, getter = "hardwareAcceleration")]
193 pub fn get_hardware_acceleration(this: &VideoDecoderConfig) -> Option<HardwareAcceleration>;
194 #[cfg(web_sys_unstable_apis)]
195 #[cfg(feature = "HardwareAcceleration")]
196 #[doc = "Change the `hardwareAcceleration` field of this object."]
197 #[doc = ""]
198 #[doc = "*This API requires the following crate features to be activated: `HardwareAcceleration`, `VideoDecoderConfig`*"]
199 #[doc = ""]
200 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
201 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
202 #[wasm_bindgen(method, setter = "hardwareAcceleration")]
203 pub fn set_hardware_acceleration(this: &VideoDecoderConfig, val: HardwareAcceleration);
204 #[cfg(web_sys_unstable_apis)]
205 #[doc = "Get the `optimizeForLatency` field of this object."]
206 #[doc = ""]
207 #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
208 #[doc = ""]
209 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
210 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
211 #[wasm_bindgen(method, getter = "optimizeForLatency")]
212 pub fn get_optimize_for_latency(this: &VideoDecoderConfig) -> Option<bool>;
213 #[cfg(web_sys_unstable_apis)]
214 #[doc = "Change the `optimizeForLatency` field of this object."]
215 #[doc = ""]
216 #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
217 #[doc = ""]
218 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
219 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
220 #[wasm_bindgen(method, setter = "optimizeForLatency")]
221 pub fn set_optimize_for_latency(this: &VideoDecoderConfig, val: bool);
222 #[cfg(web_sys_unstable_apis)]
223 #[doc = "Get the `rotation` field of this object."]
224 #[doc = ""]
225 #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
226 #[doc = ""]
227 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
228 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
229 #[wasm_bindgen(method, getter = "rotation")]
230 pub fn get_rotation(this: &VideoDecoderConfig) -> Option<f64>;
231 #[cfg(web_sys_unstable_apis)]
232 #[doc = "Change the `rotation` field of this object."]
233 #[doc = ""]
234 #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
235 #[doc = ""]
236 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
237 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
238 #[wasm_bindgen(method, setter = "rotation")]
239 pub fn set_rotation(this: &VideoDecoderConfig, val: f64);
240}
241#[cfg(web_sys_unstable_apis)]
242impl VideoDecoderConfig {
243 #[doc = "Construct a new `VideoDecoderConfig`."]
244 #[doc = ""]
245 #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
246 #[doc = ""]
247 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
248 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
249 pub fn new(codec: &str) -> Self {
250 #[allow(unused_mut)]
251 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
252 ret.set_codec(codec);
253 ret
254 }
255 #[cfg(web_sys_unstable_apis)]
256 #[deprecated = "Use `set_codec()` instead."]
257 pub fn codec(&mut self, val: &str) -> &mut Self {
258 self.set_codec(val);
259 self
260 }
261 #[cfg(web_sys_unstable_apis)]
262 #[deprecated = "Use `set_coded_height()` instead."]
263 pub fn coded_height(&mut self, val: u32) -> &mut Self {
264 self.set_coded_height(val);
265 self
266 }
267 #[cfg(web_sys_unstable_apis)]
268 #[deprecated = "Use `set_coded_width()` instead."]
269 pub fn coded_width(&mut self, val: u32) -> &mut Self {
270 self.set_coded_width(val);
271 self
272 }
273 #[cfg(web_sys_unstable_apis)]
274 #[cfg(feature = "VideoColorSpaceInit")]
275 #[deprecated = "Use `set_color_space()` instead."]
276 pub fn color_space(&mut self, val: &VideoColorSpaceInit) -> &mut Self {
277 self.set_color_space(val);
278 self
279 }
280 #[cfg(web_sys_unstable_apis)]
281 #[deprecated = "Use `set_description()` instead."]
282 pub fn description(&mut self, val: &::js_sys::Object) -> &mut Self {
283 self.set_description(val);
284 self
285 }
286 #[cfg(web_sys_unstable_apis)]
287 #[deprecated = "Use `set_display_aspect_height()` instead."]
288 pub fn display_aspect_height(&mut self, val: u32) -> &mut Self {
289 self.set_display_aspect_height(val);
290 self
291 }
292 #[cfg(web_sys_unstable_apis)]
293 #[deprecated = "Use `set_display_aspect_width()` instead."]
294 pub fn display_aspect_width(&mut self, val: u32) -> &mut Self {
295 self.set_display_aspect_width(val);
296 self
297 }
298 #[cfg(web_sys_unstable_apis)]
299 #[deprecated = "Use `set_flip()` instead."]
300 pub fn flip(&mut self, val: bool) -> &mut Self {
301 self.set_flip(val);
302 self
303 }
304 #[cfg(web_sys_unstable_apis)]
305 #[cfg(feature = "HardwareAcceleration")]
306 #[deprecated = "Use `set_hardware_acceleration()` instead."]
307 pub fn hardware_acceleration(&mut self, val: HardwareAcceleration) -> &mut Self {
308 self.set_hardware_acceleration(val);
309 self
310 }
311 #[cfg(web_sys_unstable_apis)]
312 #[deprecated = "Use `set_optimize_for_latency()` instead."]
313 pub fn optimize_for_latency(&mut self, val: bool) -> &mut Self {
314 self.set_optimize_for_latency(val);
315 self
316 }
317 #[cfg(web_sys_unstable_apis)]
318 #[deprecated = "Use `set_rotation()` instead."]
319 pub fn rotation(&mut self, val: f64) -> &mut Self {
320 self.set_rotation(val);
321 self
322 }
323}