web_sys/features/
gen_VideoDecoderConfig.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 = 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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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://rustwasm.github.io/docs/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 = "Get the `displayAspectHeight` 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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
116    #[wasm_bindgen(method, getter = "displayAspectHeight")]
117    pub fn get_display_aspect_height(this: &VideoDecoderConfig) -> Option<u32>;
118    #[cfg(web_sys_unstable_apis)]
119    #[doc = "Change the `displayAspectHeight` field of this object."]
120    #[doc = ""]
121    #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
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 = "displayAspectHeight")]
126    pub fn set_display_aspect_height(this: &VideoDecoderConfig, val: u32);
127    #[cfg(web_sys_unstable_apis)]
128    #[doc = "Get the `displayAspectWidth` field of this object."]
129    #[doc = ""]
130    #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
131    #[doc = ""]
132    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
133    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
134    #[wasm_bindgen(method, getter = "displayAspectWidth")]
135    pub fn get_display_aspect_width(this: &VideoDecoderConfig) -> Option<u32>;
136    #[cfg(web_sys_unstable_apis)]
137    #[doc = "Change the `displayAspectWidth` field of this object."]
138    #[doc = ""]
139    #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
140    #[doc = ""]
141    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
142    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
143    #[wasm_bindgen(method, setter = "displayAspectWidth")]
144    pub fn set_display_aspect_width(this: &VideoDecoderConfig, val: u32);
145    #[cfg(web_sys_unstable_apis)]
146    #[cfg(feature = "HardwareAcceleration")]
147    #[doc = "Get the `hardwareAcceleration` field of this object."]
148    #[doc = ""]
149    #[doc = "*This API requires the following crate features to be activated: `HardwareAcceleration`, `VideoDecoderConfig`*"]
150    #[doc = ""]
151    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
152    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
153    #[wasm_bindgen(method, getter = "hardwareAcceleration")]
154    pub fn get_hardware_acceleration(this: &VideoDecoderConfig) -> Option<HardwareAcceleration>;
155    #[cfg(web_sys_unstable_apis)]
156    #[cfg(feature = "HardwareAcceleration")]
157    #[doc = "Change the `hardwareAcceleration` field of this object."]
158    #[doc = ""]
159    #[doc = "*This API requires the following crate features to be activated: `HardwareAcceleration`, `VideoDecoderConfig`*"]
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 = "hardwareAcceleration")]
164    pub fn set_hardware_acceleration(this: &VideoDecoderConfig, val: HardwareAcceleration);
165    #[cfg(web_sys_unstable_apis)]
166    #[doc = "Get the `optimizeForLatency` field of this object."]
167    #[doc = ""]
168    #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
169    #[doc = ""]
170    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
171    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
172    #[wasm_bindgen(method, getter = "optimizeForLatency")]
173    pub fn get_optimize_for_latency(this: &VideoDecoderConfig) -> Option<bool>;
174    #[cfg(web_sys_unstable_apis)]
175    #[doc = "Change the `optimizeForLatency` field of this object."]
176    #[doc = ""]
177    #[doc = "*This API requires the following crate features to be activated: `VideoDecoderConfig`*"]
178    #[doc = ""]
179    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
180    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
181    #[wasm_bindgen(method, setter = "optimizeForLatency")]
182    pub fn set_optimize_for_latency(this: &VideoDecoderConfig, val: bool);
183}
184#[cfg(web_sys_unstable_apis)]
185impl VideoDecoderConfig {
186    #[doc = "Construct a new `VideoDecoderConfig`."]
187    #[doc = ""]
188    #[doc = "*This API requires the following crate features to be activated: `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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
192    pub fn new(codec: &str) -> Self {
193        #[allow(unused_mut)]
194        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
195        ret.set_codec(codec);
196        ret
197    }
198    #[cfg(web_sys_unstable_apis)]
199    #[deprecated = "Use `set_codec()` instead."]
200    pub fn codec(&mut self, val: &str) -> &mut Self {
201        self.set_codec(val);
202        self
203    }
204    #[cfg(web_sys_unstable_apis)]
205    #[deprecated = "Use `set_coded_height()` instead."]
206    pub fn coded_height(&mut self, val: u32) -> &mut Self {
207        self.set_coded_height(val);
208        self
209    }
210    #[cfg(web_sys_unstable_apis)]
211    #[deprecated = "Use `set_coded_width()` instead."]
212    pub fn coded_width(&mut self, val: u32) -> &mut Self {
213        self.set_coded_width(val);
214        self
215    }
216    #[cfg(web_sys_unstable_apis)]
217    #[cfg(feature = "VideoColorSpaceInit")]
218    #[deprecated = "Use `set_color_space()` instead."]
219    pub fn color_space(&mut self, val: &VideoColorSpaceInit) -> &mut Self {
220        self.set_color_space(val);
221        self
222    }
223    #[cfg(web_sys_unstable_apis)]
224    #[deprecated = "Use `set_description()` instead."]
225    pub fn description(&mut self, val: &::js_sys::Object) -> &mut Self {
226        self.set_description(val);
227        self
228    }
229    #[cfg(web_sys_unstable_apis)]
230    #[deprecated = "Use `set_display_aspect_height()` instead."]
231    pub fn display_aspect_height(&mut self, val: u32) -> &mut Self {
232        self.set_display_aspect_height(val);
233        self
234    }
235    #[cfg(web_sys_unstable_apis)]
236    #[deprecated = "Use `set_display_aspect_width()` instead."]
237    pub fn display_aspect_width(&mut self, val: u32) -> &mut Self {
238        self.set_display_aspect_width(val);
239        self
240    }
241    #[cfg(web_sys_unstable_apis)]
242    #[cfg(feature = "HardwareAcceleration")]
243    #[deprecated = "Use `set_hardware_acceleration()` instead."]
244    pub fn hardware_acceleration(&mut self, val: HardwareAcceleration) -> &mut Self {
245        self.set_hardware_acceleration(val);
246        self
247    }
248    #[cfg(web_sys_unstable_apis)]
249    #[deprecated = "Use `set_optimize_for_latency()` instead."]
250    pub fn optimize_for_latency(&mut self, val: bool) -> &mut Self {
251        self.set_optimize_for_latency(val);
252        self
253    }
254}