web_sys/features/
gen_VideoFrameInit.rs1#![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 = VideoFrameInit)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `VideoFrameInit` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
12 pub type VideoFrameInit;
13 #[cfg(feature = "AlphaOption")]
14 #[doc = "Get the `alpha` field of this object."]
15 #[doc = ""]
16 #[doc = "*This API requires the following crate features to be activated: `AlphaOption`, `VideoFrameInit`*"]
17 #[wasm_bindgen(method, getter = "alpha")]
18 pub fn get_alpha(this: &VideoFrameInit) -> Option<AlphaOption>;
19 #[cfg(feature = "AlphaOption")]
20 #[doc = "Change the `alpha` field of this object."]
21 #[doc = ""]
22 #[doc = "*This API requires the following crate features to be activated: `AlphaOption`, `VideoFrameInit`*"]
23 #[wasm_bindgen(method, setter = "alpha")]
24 pub fn set_alpha(this: &VideoFrameInit, val: AlphaOption);
25 #[doc = "Get the `displayHeight` field of this object."]
26 #[doc = ""]
27 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
28 #[wasm_bindgen(method, getter = "displayHeight")]
29 pub fn get_display_height(this: &VideoFrameInit) -> Option<u32>;
30 #[doc = "Change the `displayHeight` field of this object."]
31 #[doc = ""]
32 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
33 #[wasm_bindgen(method, setter = "displayHeight")]
34 pub fn set_display_height(this: &VideoFrameInit, val: u32);
35 #[doc = "Get the `displayWidth` field of this object."]
36 #[doc = ""]
37 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
38 #[wasm_bindgen(method, getter = "displayWidth")]
39 pub fn get_display_width(this: &VideoFrameInit) -> Option<u32>;
40 #[doc = "Change the `displayWidth` field of this object."]
41 #[doc = ""]
42 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
43 #[wasm_bindgen(method, setter = "displayWidth")]
44 pub fn set_display_width(this: &VideoFrameInit, val: u32);
45 #[doc = "Get the `duration` field of this object."]
46 #[doc = ""]
47 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
48 #[wasm_bindgen(method, getter = "duration")]
49 pub fn get_duration(this: &VideoFrameInit) -> Option<f64>;
50 #[doc = "Change the `duration` field of this object."]
51 #[doc = ""]
52 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
53 #[wasm_bindgen(method, setter = "duration")]
54 pub fn set_duration(this: &VideoFrameInit, val: u32);
55 #[doc = "Change the `duration` field of this object."]
56 #[doc = ""]
57 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
58 #[wasm_bindgen(method, setter = "duration")]
59 pub fn set_duration_f64(this: &VideoFrameInit, val: f64);
60 #[cfg(web_sys_unstable_apis)]
61 #[doc = "Get the `flip` field of this object."]
62 #[doc = ""]
63 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
64 #[doc = ""]
65 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
66 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
67 #[wasm_bindgen(method, getter = "flip")]
68 pub fn get_flip(this: &VideoFrameInit) -> Option<bool>;
69 #[cfg(web_sys_unstable_apis)]
70 #[doc = "Change the `flip` field of this object."]
71 #[doc = ""]
72 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
73 #[doc = ""]
74 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
75 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
76 #[wasm_bindgen(method, setter = "flip")]
77 pub fn set_flip(this: &VideoFrameInit, val: bool);
78 #[cfg(web_sys_unstable_apis)]
79 #[cfg(feature = "VideoFrameMetadata")]
80 #[doc = "Get the `metadata` field of this object."]
81 #[doc = ""]
82 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`, `VideoFrameMetadata`*"]
83 #[doc = ""]
84 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
85 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
86 #[wasm_bindgen(method, getter = "metadata")]
87 pub fn get_metadata(this: &VideoFrameInit) -> Option<VideoFrameMetadata>;
88 #[cfg(web_sys_unstable_apis)]
89 #[cfg(feature = "VideoFrameMetadata")]
90 #[doc = "Change the `metadata` field of this object."]
91 #[doc = ""]
92 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`, `VideoFrameMetadata`*"]
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 = "metadata")]
97 pub fn set_metadata(this: &VideoFrameInit, val: &VideoFrameMetadata);
98 #[cfg(web_sys_unstable_apis)]
99 #[doc = "Get the `rotation` field of this object."]
100 #[doc = ""]
101 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
102 #[doc = ""]
103 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
104 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
105 #[wasm_bindgen(method, getter = "rotation")]
106 pub fn get_rotation(this: &VideoFrameInit) -> Option<f64>;
107 #[cfg(web_sys_unstable_apis)]
108 #[doc = "Change the `rotation` field of this object."]
109 #[doc = ""]
110 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
111 #[doc = ""]
112 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
113 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
114 #[wasm_bindgen(method, setter = "rotation")]
115 pub fn set_rotation(this: &VideoFrameInit, val: f64);
116 #[doc = "Get the `timestamp` field of this object."]
117 #[doc = ""]
118 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
119 #[wasm_bindgen(method, getter = "timestamp")]
120 pub fn get_timestamp(this: &VideoFrameInit) -> Option<f64>;
121 #[doc = "Change the `timestamp` field of this object."]
122 #[doc = ""]
123 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
124 #[wasm_bindgen(method, setter = "timestamp")]
125 pub fn set_timestamp(this: &VideoFrameInit, val: i32);
126 #[doc = "Change the `timestamp` field of this object."]
127 #[doc = ""]
128 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
129 #[wasm_bindgen(method, setter = "timestamp")]
130 pub fn set_timestamp_f64(this: &VideoFrameInit, val: f64);
131 #[cfg(feature = "DomRectInit")]
132 #[doc = "Get the `visibleRect` field of this object."]
133 #[doc = ""]
134 #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `VideoFrameInit`*"]
135 #[wasm_bindgen(method, getter = "visibleRect")]
136 pub fn get_visible_rect(this: &VideoFrameInit) -> Option<DomRectInit>;
137 #[cfg(feature = "DomRectInit")]
138 #[doc = "Change the `visibleRect` field of this object."]
139 #[doc = ""]
140 #[doc = "*This API requires the following crate features to be activated: `DomRectInit`, `VideoFrameInit`*"]
141 #[wasm_bindgen(method, setter = "visibleRect")]
142 pub fn set_visible_rect(this: &VideoFrameInit, val: &DomRectInit);
143}
144impl VideoFrameInit {
145 #[doc = "Construct a new `VideoFrameInit`."]
146 #[doc = ""]
147 #[doc = "*This API requires the following crate features to be activated: `VideoFrameInit`*"]
148 pub fn new() -> Self {
149 #[allow(unused_mut)]
150 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
151 ret
152 }
153 #[cfg(feature = "AlphaOption")]
154 #[deprecated = "Use `set_alpha()` instead."]
155 pub fn alpha(&mut self, val: AlphaOption) -> &mut Self {
156 self.set_alpha(val);
157 self
158 }
159 #[deprecated = "Use `set_display_height()` instead."]
160 pub fn display_height(&mut self, val: u32) -> &mut Self {
161 self.set_display_height(val);
162 self
163 }
164 #[deprecated = "Use `set_display_width()` instead."]
165 pub fn display_width(&mut self, val: u32) -> &mut Self {
166 self.set_display_width(val);
167 self
168 }
169 #[deprecated = "Use `set_duration()` instead."]
170 pub fn duration(&mut self, val: u32) -> &mut Self {
171 self.set_duration(val);
172 self
173 }
174 #[cfg(web_sys_unstable_apis)]
175 #[deprecated = "Use `set_flip()` instead."]
176 pub fn flip(&mut self, val: bool) -> &mut Self {
177 self.set_flip(val);
178 self
179 }
180 #[cfg(web_sys_unstable_apis)]
181 #[cfg(feature = "VideoFrameMetadata")]
182 #[deprecated = "Use `set_metadata()` instead."]
183 pub fn metadata(&mut self, val: &VideoFrameMetadata) -> &mut Self {
184 self.set_metadata(val);
185 self
186 }
187 #[cfg(web_sys_unstable_apis)]
188 #[deprecated = "Use `set_rotation()` instead."]
189 pub fn rotation(&mut self, val: f64) -> &mut Self {
190 self.set_rotation(val);
191 self
192 }
193 #[deprecated = "Use `set_timestamp()` instead."]
194 pub fn timestamp(&mut self, val: i32) -> &mut Self {
195 self.set_timestamp(val);
196 self
197 }
198 #[cfg(feature = "DomRectInit")]
199 #[deprecated = "Use `set_visible_rect()` instead."]
200 pub fn visible_rect(&mut self, val: &DomRectInit) -> &mut Self {
201 self.set_visible_rect(val);
202 self
203 }
204}
205impl Default for VideoFrameInit {
206 fn default() -> Self {
207 Self::new()
208 }
209}