web_sys/features/
gen_VideoFrameInit.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 = VideoFrameInit)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `VideoFrameInit` dictionary."]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
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 VideoFrameInit;
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`, `VideoFrameInit`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
25 #[wasm_bindgen(method, getter = "alpha")]
26 pub fn get_alpha(this: &VideoFrameInit) -> 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`, `VideoFrameInit`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
35 #[wasm_bindgen(method, setter = "alpha")]
36 pub fn set_alpha(this: &VideoFrameInit, val: AlphaOption);
37 #[cfg(web_sys_unstable_apis)]
38 #[doc = "Get the `displayHeight` field of this object."]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
44 #[wasm_bindgen(method, getter = "displayHeight")]
45 pub fn get_display_height(this: &VideoFrameInit) -> Option<u32>;
46 #[cfg(web_sys_unstable_apis)]
47 #[doc = "Change the `displayHeight` field of this object."]
48 #[doc = ""]
49 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
53 #[wasm_bindgen(method, setter = "displayHeight")]
54 pub fn set_display_height(this: &VideoFrameInit, val: u32);
55 #[cfg(web_sys_unstable_apis)]
56 #[doc = "Get the `displayWidth` field of this object."]
57 #[doc = ""]
58 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
62 #[wasm_bindgen(method, getter = "displayWidth")]
63 pub fn get_display_width(this: &VideoFrameInit) -> Option<u32>;
64 #[cfg(web_sys_unstable_apis)]
65 #[doc = "Change the `displayWidth` field of this object."]
66 #[doc = ""]
67 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
71 #[wasm_bindgen(method, setter = "displayWidth")]
72 pub fn set_display_width(this: &VideoFrameInit, val: u32);
73 #[cfg(web_sys_unstable_apis)]
74 #[doc = "Get the `duration` field of this object."]
75 #[doc = ""]
76 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
80 #[wasm_bindgen(method, getter = "duration")]
81 pub fn get_duration(this: &VideoFrameInit) -> Option<f64>;
82 #[cfg(web_sys_unstable_apis)]
83 #[doc = "Change the `duration` field of this object."]
84 #[doc = ""]
85 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
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 = "duration")]
90 pub fn set_duration(this: &VideoFrameInit, val: u32);
91 #[cfg(web_sys_unstable_apis)]
92 #[doc = "Change the `duration` field of this object."]
93 #[doc = ""]
94 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
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, setter = "duration")]
99 pub fn set_duration_f64(this: &VideoFrameInit, val: f64);
100 #[cfg(web_sys_unstable_apis)]
101 #[doc = "Get the `flip` field of this object."]
102 #[doc = ""]
103 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
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, getter = "flip")]
108 pub fn get_flip(this: &VideoFrameInit) -> Option<bool>;
109 #[cfg(web_sys_unstable_apis)]
110 #[doc = "Change the `flip` field of this object."]
111 #[doc = ""]
112 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
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 #[wasm_bindgen(method, setter = "flip")]
117 pub fn set_flip(this: &VideoFrameInit, val: bool);
118 #[cfg(web_sys_unstable_apis)]
119 #[cfg(feature = "VideoFrameMetadata")]
120 #[doc = "Get the `metadata` field of this object."]
121 #[doc = ""]
122 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`, `VideoFrameMetadata`*"]
123 #[doc = ""]
124 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
125 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
126 #[wasm_bindgen(method, getter = "metadata")]
127 pub fn get_metadata(this: &VideoFrameInit) -> Option<VideoFrameMetadata>;
128 #[cfg(web_sys_unstable_apis)]
129 #[cfg(feature = "VideoFrameMetadata")]
130 #[doc = "Change the `metadata` field of this object."]
131 #[doc = ""]
132 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`, `VideoFrameMetadata`*"]
133 #[doc = ""]
134 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
135 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
136 #[wasm_bindgen(method, setter = "metadata")]
137 pub fn set_metadata(this: &VideoFrameInit, val: &VideoFrameMetadata);
138 #[cfg(web_sys_unstable_apis)]
139 #[doc = "Get the `rotation` field of this object."]
140 #[doc = ""]
141 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
145 #[wasm_bindgen(method, getter = "rotation")]
146 pub fn get_rotation(this: &VideoFrameInit) -> Option<f64>;
147 #[cfg(web_sys_unstable_apis)]
148 #[doc = "Change the `rotation` field of this object."]
149 #[doc = ""]
150 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
154 #[wasm_bindgen(method, setter = "rotation")]
155 pub fn set_rotation(this: &VideoFrameInit, val: f64);
156 #[cfg(web_sys_unstable_apis)]
157 #[doc = "Get the `timestamp` field of this object."]
158 #[doc = ""]
159 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
163 #[wasm_bindgen(method, getter = "timestamp")]
164 pub fn get_timestamp(this: &VideoFrameInit) -> Option<f64>;
165 #[cfg(web_sys_unstable_apis)]
166 #[doc = "Change the `timestamp` field of this object."]
167 #[doc = ""]
168 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
172 #[wasm_bindgen(method, setter = "timestamp")]
173 pub fn set_timestamp(this: &VideoFrameInit, val: i32);
174 #[cfg(web_sys_unstable_apis)]
175 #[doc = "Change the `timestamp` field of this object."]
176 #[doc = ""]
177 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
181 #[wasm_bindgen(method, setter = "timestamp")]
182 pub fn set_timestamp_f64(this: &VideoFrameInit, val: f64);
183 #[cfg(web_sys_unstable_apis)]
184 #[cfg(feature = "DomRectInit")]
185 #[doc = "Get the `visibleRect` field of this object."]
186 #[doc = ""]
187 #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `VideoFrameInit`*"]
188 #[doc = ""]
189 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
190 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
191 #[wasm_bindgen(method, getter = "visibleRect")]
192 pub fn get_visible_rect(this: &VideoFrameInit) -> Option<DomRectInit>;
193 #[cfg(web_sys_unstable_apis)]
194 #[cfg(feature = "DomRectInit")]
195 #[doc = "Change the `visibleRect` field of this object."]
196 #[doc = ""]
197 #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `VideoFrameInit`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
201 #[wasm_bindgen(method, setter = "visibleRect")]
202 pub fn set_visible_rect(this: &VideoFrameInit, val: &DomRectInit);
203}
204#[cfg(web_sys_unstable_apis)]
205impl VideoFrameInit {
206 #[doc = "Construct a new `VideoFrameInit`."]
207 #[doc = ""]
208 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
209 #[doc = ""]
210 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
211 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
212 pub fn new() -> Self {
213 #[allow(unused_mut)]
214 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
215 ret
216 }
217 #[cfg(web_sys_unstable_apis)]
218 #[cfg(feature = "AlphaOption")]
219 #[deprecated = "Use `set_alpha()` instead."]
220 pub fn alpha(&mut self, val: AlphaOption) -> &mut Self {
221 self.set_alpha(val);
222 self
223 }
224 #[cfg(web_sys_unstable_apis)]
225 #[deprecated = "Use `set_display_height()` instead."]
226 pub fn display_height(&mut self, val: u32) -> &mut Self {
227 self.set_display_height(val);
228 self
229 }
230 #[cfg(web_sys_unstable_apis)]
231 #[deprecated = "Use `set_display_width()` instead."]
232 pub fn display_width(&mut self, val: u32) -> &mut Self {
233 self.set_display_width(val);
234 self
235 }
236 #[cfg(web_sys_unstable_apis)]
237 #[deprecated = "Use `set_duration()` instead."]
238 pub fn duration(&mut self, val: u32) -> &mut Self {
239 self.set_duration(val);
240 self
241 }
242 #[cfg(web_sys_unstable_apis)]
243 #[deprecated = "Use `set_flip()` instead."]
244 pub fn flip(&mut self, val: bool) -> &mut Self {
245 self.set_flip(val);
246 self
247 }
248 #[cfg(web_sys_unstable_apis)]
249 #[cfg(feature = "VideoFrameMetadata")]
250 #[deprecated = "Use `set_metadata()` instead."]
251 pub fn metadata(&mut self, val: &VideoFrameMetadata) -> &mut Self {
252 self.set_metadata(val);
253 self
254 }
255 #[cfg(web_sys_unstable_apis)]
256 #[deprecated = "Use `set_rotation()` instead."]
257 pub fn rotation(&mut self, val: f64) -> &mut Self {
258 self.set_rotation(val);
259 self
260 }
261 #[cfg(web_sys_unstable_apis)]
262 #[deprecated = "Use `set_timestamp()` instead."]
263 pub fn timestamp(&mut self, val: i32) -> &mut Self {
264 self.set_timestamp(val);
265 self
266 }
267 #[cfg(web_sys_unstable_apis)]
268 #[cfg(feature = "DomRectInit")]
269 #[deprecated = "Use `set_visible_rect()` instead."]
270 pub fn visible_rect(&mut self, val: &DomRectInit) -> &mut Self {
271 self.set_visible_rect(val);
272 self
273 }
274}
275#[cfg(web_sys_unstable_apis)]
276impl Default for VideoFrameInit {
277 fn default() -> Self {
278 Self::new()
279 }
280}