Skip to main content

web_sys/features/
gen_VideoFrameBufferInit.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 = VideoFrameBufferInit)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `VideoFrameBufferInit` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"]
12    pub type VideoFrameBufferInit;
13    #[doc = "Get the `codedHeight` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"]
16    #[wasm_bindgen(method, getter = "codedHeight")]
17    pub fn get_coded_height(this: &VideoFrameBufferInit) -> u32;
18    #[doc = "Change the `codedHeight` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"]
21    #[wasm_bindgen(method, setter = "codedHeight")]
22    pub fn set_coded_height(this: &VideoFrameBufferInit, val: u32);
23    #[doc = "Get the `codedWidth` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"]
26    #[wasm_bindgen(method, getter = "codedWidth")]
27    pub fn get_coded_width(this: &VideoFrameBufferInit) -> u32;
28    #[doc = "Change the `codedWidth` field of this object."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"]
31    #[wasm_bindgen(method, setter = "codedWidth")]
32    pub fn set_coded_width(this: &VideoFrameBufferInit, val: u32);
33    #[cfg(feature = "VideoColorSpaceInit")]
34    #[doc = "Get the `colorSpace` field of this object."]
35    #[doc = ""]
36    #[doc = "*This API requires the following crate features to be activated: `VideoColorSpaceInit`, `VideoFrameBufferInit`*"]
37    #[wasm_bindgen(method, getter = "colorSpace")]
38    pub fn get_color_space(this: &VideoFrameBufferInit) -> Option<VideoColorSpaceInit>;
39    #[cfg(feature = "VideoColorSpaceInit")]
40    #[doc = "Change the `colorSpace` field of this object."]
41    #[doc = ""]
42    #[doc = "*This API requires the following crate features to be activated: `VideoColorSpaceInit`, `VideoFrameBufferInit`*"]
43    #[wasm_bindgen(method, setter = "colorSpace")]
44    pub fn set_color_space(this: &VideoFrameBufferInit, val: &VideoColorSpaceInit);
45    #[doc = "Get the `displayHeight` field of this object."]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"]
48    #[wasm_bindgen(method, getter = "displayHeight")]
49    pub fn get_display_height(this: &VideoFrameBufferInit) -> Option<u32>;
50    #[doc = "Change the `displayHeight` field of this object."]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"]
53    #[wasm_bindgen(method, setter = "displayHeight")]
54    pub fn set_display_height(this: &VideoFrameBufferInit, val: u32);
55    #[doc = "Get the `displayWidth` field of this object."]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"]
58    #[wasm_bindgen(method, getter = "displayWidth")]
59    pub fn get_display_width(this: &VideoFrameBufferInit) -> Option<u32>;
60    #[doc = "Change the `displayWidth` field of this object."]
61    #[doc = ""]
62    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"]
63    #[wasm_bindgen(method, setter = "displayWidth")]
64    pub fn set_display_width(this: &VideoFrameBufferInit, val: u32);
65    #[doc = "Get the `duration` field of this object."]
66    #[doc = ""]
67    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"]
68    #[wasm_bindgen(method, getter = "duration")]
69    pub fn get_duration(this: &VideoFrameBufferInit) -> Option<f64>;
70    #[doc = "Change the `duration` field of this object."]
71    #[doc = ""]
72    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"]
73    #[wasm_bindgen(method, setter = "duration")]
74    pub fn set_duration(this: &VideoFrameBufferInit, val: u32);
75    #[doc = "Change the `duration` field of this object."]
76    #[doc = ""]
77    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"]
78    #[wasm_bindgen(method, setter = "duration")]
79    pub fn set_duration_f64(this: &VideoFrameBufferInit, val: f64);
80    #[cfg(web_sys_unstable_apis)]
81    #[doc = "Get the `flip` field of this object."]
82    #[doc = ""]
83    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"]
84    #[doc = ""]
85    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
86    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
87    #[wasm_bindgen(method, getter = "flip")]
88    pub fn get_flip(this: &VideoFrameBufferInit) -> Option<bool>;
89    #[cfg(web_sys_unstable_apis)]
90    #[doc = "Change the `flip` field of this object."]
91    #[doc = ""]
92    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"]
93    #[doc = ""]
94    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
95    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
96    #[wasm_bindgen(method, setter = "flip")]
97    pub fn set_flip(this: &VideoFrameBufferInit, val: bool);
98    #[cfg(feature = "VideoPixelFormat")]
99    #[doc = "Get the `format` field of this object."]
100    #[doc = ""]
101    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`, `VideoPixelFormat`*"]
102    #[wasm_bindgen(method, getter = "format")]
103    pub fn get_format(this: &VideoFrameBufferInit) -> VideoPixelFormat;
104    #[cfg(feature = "VideoPixelFormat")]
105    #[doc = "Change the `format` field of this object."]
106    #[doc = ""]
107    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`, `VideoPixelFormat`*"]
108    #[wasm_bindgen(method, setter = "format")]
109    pub fn set_format(this: &VideoFrameBufferInit, val: VideoPixelFormat);
110    #[cfg(feature = "PlaneLayout")]
111    #[doc = "Get the `layout` field of this object."]
112    #[doc = ""]
113    #[doc = "*This API requires the following crate features to be activated: `PlaneLayout`, `VideoFrameBufferInit`*"]
114    #[wasm_bindgen(method, getter = "layout")]
115    pub fn get_layout(this: &VideoFrameBufferInit) -> Option<::js_sys::Array<PlaneLayout>>;
116    #[cfg(feature = "PlaneLayout")]
117    #[doc = "Change the `layout` field of this object."]
118    #[doc = ""]
119    #[doc = "*This API requires the following crate features to be activated: `PlaneLayout`, `VideoFrameBufferInit`*"]
120    #[wasm_bindgen(method, setter = "layout")]
121    pub fn set_layout(this: &VideoFrameBufferInit, val: &[PlaneLayout]);
122    #[cfg(web_sys_unstable_apis)]
123    #[cfg(feature = "VideoFrameMetadata")]
124    #[doc = "Get the `metadata` field of this object."]
125    #[doc = ""]
126    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`, `VideoFrameMetadata`*"]
127    #[doc = ""]
128    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
129    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
130    #[wasm_bindgen(method, getter = "metadata")]
131    pub fn get_metadata(this: &VideoFrameBufferInit) -> Option<VideoFrameMetadata>;
132    #[cfg(web_sys_unstable_apis)]
133    #[cfg(feature = "VideoFrameMetadata")]
134    #[doc = "Change the `metadata` field of this object."]
135    #[doc = ""]
136    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`, `VideoFrameMetadata`*"]
137    #[doc = ""]
138    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
139    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
140    #[wasm_bindgen(method, setter = "metadata")]
141    pub fn set_metadata(this: &VideoFrameBufferInit, val: &VideoFrameMetadata);
142    #[cfg(web_sys_unstable_apis)]
143    #[doc = "Get the `rotation` field of this object."]
144    #[doc = ""]
145    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"]
146    #[doc = ""]
147    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
148    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
149    #[wasm_bindgen(method, getter = "rotation")]
150    pub fn get_rotation(this: &VideoFrameBufferInit) -> Option<f64>;
151    #[cfg(web_sys_unstable_apis)]
152    #[doc = "Change the `rotation` field of this object."]
153    #[doc = ""]
154    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"]
155    #[doc = ""]
156    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
157    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
158    #[wasm_bindgen(method, setter = "rotation")]
159    pub fn set_rotation(this: &VideoFrameBufferInit, val: f64);
160    #[doc = "Get the `timestamp` field of this object."]
161    #[doc = ""]
162    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"]
163    #[wasm_bindgen(method, getter = "timestamp")]
164    pub fn get_timestamp(this: &VideoFrameBufferInit) -> f64;
165    #[doc = "Change the `timestamp` field of this object."]
166    #[doc = ""]
167    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"]
168    #[wasm_bindgen(method, setter = "timestamp")]
169    pub fn set_timestamp(this: &VideoFrameBufferInit, val: i32);
170    #[doc = "Change the `timestamp` field of this object."]
171    #[doc = ""]
172    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"]
173    #[wasm_bindgen(method, setter = "timestamp")]
174    pub fn set_timestamp_f64(this: &VideoFrameBufferInit, val: f64);
175    #[cfg(web_sys_unstable_apis)]
176    #[doc = "Get the `transfer` field of this object."]
177    #[doc = ""]
178    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"]
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, getter = "transfer")]
183    pub fn get_transfer(
184        this: &VideoFrameBufferInit,
185    ) -> Option<::js_sys::Array<::js_sys::ArrayBuffer>>;
186    #[cfg(web_sys_unstable_apis)]
187    #[doc = "Change the `transfer` field of this object."]
188    #[doc = ""]
189    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`*"]
190    #[doc = ""]
191    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
192    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
193    #[wasm_bindgen(method, setter = "transfer")]
194    pub fn set_transfer(this: &VideoFrameBufferInit, val: &[::js_sys::ArrayBuffer]);
195    #[cfg(feature = "DomRectInit")]
196    #[doc = "Get the `visibleRect` field of this object."]
197    #[doc = ""]
198    #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `VideoFrameBufferInit`*"]
199    #[wasm_bindgen(method, getter = "visibleRect")]
200    pub fn get_visible_rect(this: &VideoFrameBufferInit) -> Option<DomRectInit>;
201    #[cfg(feature = "DomRectInit")]
202    #[doc = "Change the `visibleRect` field of this object."]
203    #[doc = ""]
204    #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `VideoFrameBufferInit`*"]
205    #[wasm_bindgen(method, setter = "visibleRect")]
206    pub fn set_visible_rect(this: &VideoFrameBufferInit, val: &DomRectInit);
207}
208impl VideoFrameBufferInit {
209    #[cfg(feature = "VideoPixelFormat")]
210    #[doc = "Construct a new `VideoFrameBufferInit`."]
211    #[doc = ""]
212    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`, `VideoPixelFormat`*"]
213    pub fn new(
214        coded_height: u32,
215        coded_width: u32,
216        format: VideoPixelFormat,
217        timestamp: i32,
218    ) -> Self {
219        #[allow(unused_mut)]
220        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
221        ret.set_coded_height(coded_height);
222        ret.set_coded_width(coded_width);
223        ret.set_format(format);
224        ret.set_timestamp(timestamp);
225        ret
226    }
227    #[cfg(feature = "VideoPixelFormat")]
228    #[doc = "Construct a new `VideoFrameBufferInit`."]
229    #[doc = ""]
230    #[doc = "*This API requires the following crate features to be activated: `VideoFrameBufferInit`, `VideoPixelFormat`*"]
231    pub fn new_with_f64(
232        coded_height: u32,
233        coded_width: u32,
234        format: VideoPixelFormat,
235        timestamp: f64,
236    ) -> Self {
237        #[allow(unused_mut)]
238        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
239        ret.set_coded_height(coded_height);
240        ret.set_coded_width(coded_width);
241        ret.set_format(format);
242        ret.set_timestamp_f64(timestamp);
243        ret
244    }
245    #[deprecated = "Use `set_coded_height()` instead."]
246    pub fn coded_height(&mut self, val: u32) -> &mut Self {
247        self.set_coded_height(val);
248        self
249    }
250    #[deprecated = "Use `set_coded_width()` instead."]
251    pub fn coded_width(&mut self, val: u32) -> &mut Self {
252        self.set_coded_width(val);
253        self
254    }
255    #[cfg(feature = "VideoColorSpaceInit")]
256    #[deprecated = "Use `set_color_space()` instead."]
257    pub fn color_space(&mut self, val: &VideoColorSpaceInit) -> &mut Self {
258        self.set_color_space(val);
259        self
260    }
261    #[deprecated = "Use `set_display_height()` instead."]
262    pub fn display_height(&mut self, val: u32) -> &mut Self {
263        self.set_display_height(val);
264        self
265    }
266    #[deprecated = "Use `set_display_width()` instead."]
267    pub fn display_width(&mut self, val: u32) -> &mut Self {
268        self.set_display_width(val);
269        self
270    }
271    #[deprecated = "Use `set_duration()` instead."]
272    pub fn duration(&mut self, val: u32) -> &mut Self {
273        self.set_duration(val);
274        self
275    }
276    #[cfg(web_sys_unstable_apis)]
277    #[deprecated = "Use `set_flip()` instead."]
278    pub fn flip(&mut self, val: bool) -> &mut Self {
279        self.set_flip(val);
280        self
281    }
282    #[cfg(feature = "VideoPixelFormat")]
283    #[deprecated = "Use `set_format()` instead."]
284    pub fn format(&mut self, val: VideoPixelFormat) -> &mut Self {
285        self.set_format(val);
286        self
287    }
288    #[cfg(feature = "PlaneLayout")]
289    #[deprecated = "Use `set_layout()` instead."]
290    pub fn layout(&mut self, val: &[PlaneLayout]) -> &mut Self {
291        self.set_layout(val);
292        self
293    }
294    #[cfg(web_sys_unstable_apis)]
295    #[cfg(feature = "VideoFrameMetadata")]
296    #[deprecated = "Use `set_metadata()` instead."]
297    pub fn metadata(&mut self, val: &VideoFrameMetadata) -> &mut Self {
298        self.set_metadata(val);
299        self
300    }
301    #[cfg(web_sys_unstable_apis)]
302    #[deprecated = "Use `set_rotation()` instead."]
303    pub fn rotation(&mut self, val: f64) -> &mut Self {
304        self.set_rotation(val);
305        self
306    }
307    #[deprecated = "Use `set_timestamp()` instead."]
308    pub fn timestamp(&mut self, val: i32) -> &mut Self {
309        self.set_timestamp(val);
310        self
311    }
312    #[cfg(web_sys_unstable_apis)]
313    #[deprecated = "Use `set_transfer()` instead."]
314    pub fn transfer(&mut self, val: &[::js_sys::ArrayBuffer]) -> &mut Self {
315        self.set_transfer(val);
316        self
317    }
318    #[cfg(feature = "DomRectInit")]
319    #[deprecated = "Use `set_visible_rect()` instead."]
320    pub fn visible_rect(&mut self, val: &DomRectInit) -> &mut Self {
321        self.set_visible_rect(val);
322        self
323    }
324}