Skip to main content

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