web_sys/features/
gen_VideoEncoder.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(
9 extends = "EventTarget",
10 extends = "::js_sys::Object",
11 js_name = "VideoEncoder",
12 typescript_type = "VideoEncoder"
13 )]
14 #[derive(Debug, Clone, PartialEq, Eq)]
15 #[doc = "The `VideoEncoder` class."]
16 #[doc = ""]
17 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoEncoder)"]
18 #[doc = ""]
19 #[doc = "*This API requires the following crate features to be activated: `VideoEncoder`*"]
20 #[doc = ""]
21 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
22 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
23 pub type VideoEncoder;
24 #[cfg(web_sys_unstable_apis)]
25 #[cfg(feature = "CodecState")]
26 #[wasm_bindgen(method, getter, js_class = "VideoEncoder", js_name = "state")]
27 #[doc = "Getter for the `state` field of this object."]
28 #[doc = ""]
29 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoEncoder/state)"]
30 #[doc = ""]
31 #[doc = "*This API requires the following crate features to be activated: `CodecState`, `VideoEncoder`*"]
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 pub fn state(this: &VideoEncoder) -> CodecState;
36 #[cfg(web_sys_unstable_apis)]
37 #[wasm_bindgen(method, getter, js_class = "VideoEncoder", js_name = "encodeQueueSize")]
38 #[doc = "Getter for the `encodeQueueSize` field of this object."]
39 #[doc = ""]
40 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoEncoder/encodeQueueSize)"]
41 #[doc = ""]
42 #[doc = "*This API requires the following crate features to be activated: `VideoEncoder`*"]
43 #[doc = ""]
44 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
45 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
46 pub fn encode_queue_size(this: &VideoEncoder) -> u32;
47 #[cfg(web_sys_unstable_apis)]
48 #[wasm_bindgen(method, getter, js_class = "VideoEncoder", js_name = "ondequeue")]
49 #[doc = "Getter for the `ondequeue` field of this object."]
50 #[doc = ""]
51 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoEncoder/ondequeue)"]
52 #[doc = ""]
53 #[doc = "*This API requires the following crate features to be activated: `VideoEncoder`*"]
54 #[doc = ""]
55 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
56 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
57 pub fn ondequeue(this: &VideoEncoder) -> Option<::js_sys::Function>;
58 #[cfg(web_sys_unstable_apis)]
59 #[wasm_bindgen(method, setter, js_class = "VideoEncoder", js_name = "ondequeue")]
60 #[doc = "Setter for the `ondequeue` field of this object."]
61 #[doc = ""]
62 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoEncoder/ondequeue)"]
63 #[doc = ""]
64 #[doc = "*This API requires the following crate features to be activated: `VideoEncoder`*"]
65 #[doc = ""]
66 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
67 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
68 pub fn set_ondequeue(this: &VideoEncoder, value: Option<&::js_sys::Function>);
69 #[cfg(web_sys_unstable_apis)]
70 #[cfg(feature = "VideoEncoderInit")]
71 #[wasm_bindgen(catch, constructor, js_class = "VideoEncoder")]
72 #[doc = "The `new VideoEncoder(..)` constructor, creating a new instance of `VideoEncoder`."]
73 #[doc = ""]
74 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoEncoder/VideoEncoder)"]
75 #[doc = ""]
76 #[doc = "*This API requires the following crate features to be activated: `VideoEncoder`, `VideoEncoderInit`*"]
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 pub fn new(init: &VideoEncoderInit) -> Result<VideoEncoder, JsValue>;
81 #[cfg(web_sys_unstable_apis)]
82 #[wasm_bindgen(catch, method, js_class = "VideoEncoder")]
83 #[doc = "The `close()` method."]
84 #[doc = ""]
85 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoEncoder/close)"]
86 #[doc = ""]
87 #[doc = "*This API requires the following crate features to be activated: `VideoEncoder`*"]
88 #[doc = ""]
89 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
90 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
91 pub fn close(this: &VideoEncoder) -> Result<(), JsValue>;
92 #[cfg(web_sys_unstable_apis)]
93 #[cfg(feature = "VideoEncoderConfig")]
94 #[wasm_bindgen(catch, method, js_class = "VideoEncoder")]
95 #[doc = "The `configure()` method."]
96 #[doc = ""]
97 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoEncoder/configure)"]
98 #[doc = ""]
99 #[doc = "*This API requires the following crate features to be activated: `VideoEncoder`, `VideoEncoderConfig`*"]
100 #[doc = ""]
101 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
102 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
103 pub fn configure(this: &VideoEncoder, config: &VideoEncoderConfig) -> Result<(), JsValue>;
104 #[cfg(web_sys_unstable_apis)]
105 #[cfg(feature = "VideoFrame")]
106 #[wasm_bindgen(catch, method, js_class = "VideoEncoder")]
107 #[doc = "The `encode()` method."]
108 #[doc = ""]
109 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoEncoder/encode)"]
110 #[doc = ""]
111 #[doc = "*This API requires the following crate features to be activated: `VideoEncoder`, `VideoFrame`*"]
112 #[doc = ""]
113 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
114 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
115 pub fn encode(this: &VideoEncoder, frame: &VideoFrame) -> Result<(), JsValue>;
116 #[cfg(web_sys_unstable_apis)]
117 #[cfg(all(feature = "VideoEncoderEncodeOptions", feature = "VideoFrame",))]
118 #[wasm_bindgen(catch, method, js_class = "VideoEncoder", js_name = "encode")]
119 #[doc = "The `encode()` method."]
120 #[doc = ""]
121 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoEncoder/encode)"]
122 #[doc = ""]
123 #[doc = "*This API requires the following crate features to be activated: `VideoEncoder`, `VideoEncoderEncodeOptions`, `VideoFrame`*"]
124 #[doc = ""]
125 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
126 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
127 pub fn encode_with_options(
128 this: &VideoEncoder,
129 frame: &VideoFrame,
130 options: &VideoEncoderEncodeOptions,
131 ) -> Result<(), JsValue>;
132 #[cfg(web_sys_unstable_apis)]
133 #[wasm_bindgen(method, js_class = "VideoEncoder")]
134 #[doc = "The `flush()` method."]
135 #[doc = ""]
136 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoEncoder/flush)"]
137 #[doc = ""]
138 #[doc = "*This API requires the following crate features to be activated: `VideoEncoder`*"]
139 #[doc = ""]
140 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
141 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
142 pub fn flush(this: &VideoEncoder) -> ::js_sys::Promise<::js_sys::Undefined>;
143 #[cfg(web_sys_unstable_apis)]
144 #[cfg(all(feature = "VideoEncoderConfig", feature = "VideoEncoderSupport",))]
145 #[wasm_bindgen(
146 static_method_of = "VideoEncoder",
147 js_class = "VideoEncoder",
148 js_name = "isConfigSupported"
149 )]
150 #[doc = "The `isConfigSupported()` method."]
151 #[doc = ""]
152 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoEncoder/isConfigSupported_static)"]
153 #[doc = ""]
154 #[doc = "*This API requires the following crate features to be activated: `VideoEncoder`, `VideoEncoderConfig`, `VideoEncoderSupport`*"]
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 pub fn is_config_supported(
159 config: &VideoEncoderConfig,
160 ) -> ::js_sys::Promise<VideoEncoderSupport>;
161 #[cfg(web_sys_unstable_apis)]
162 #[wasm_bindgen(catch, method, js_class = "VideoEncoder")]
163 #[doc = "The `reset()` method."]
164 #[doc = ""]
165 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoEncoder/reset)"]
166 #[doc = ""]
167 #[doc = "*This API requires the following crate features to be activated: `VideoEncoder`*"]
168 #[doc = ""]
169 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
170 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
171 pub fn reset(this: &VideoEncoder) -> Result<(), JsValue>;
172}