Skip to main content

web_sys/features/
gen_VideoDecoder.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(
9        extends = "EventTarget",
10        extends = "::js_sys::Object",
11        js_name = "VideoDecoder",
12        typescript_type = "VideoDecoder"
13    )]
14    #[derive(Debug, Clone, PartialEq, Eq)]
15    #[doc = "The `VideoDecoder` class."]
16    #[doc = ""]
17    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder)"]
18    #[doc = ""]
19    #[doc = "*This API requires the following crate features to be activated: `VideoDecoder`*"]
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 VideoDecoder;
24    #[cfg(web_sys_unstable_apis)]
25    #[cfg(feature = "CodecState")]
26    #[wasm_bindgen(method, getter, js_class = "VideoDecoder", 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/VideoDecoder/state)"]
30    #[doc = ""]
31    #[doc = "*This API requires the following crate features to be activated: `CodecState`, `VideoDecoder`*"]
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: &VideoDecoder) -> CodecState;
36    #[cfg(web_sys_unstable_apis)]
37    #[wasm_bindgen(method, getter, js_class = "VideoDecoder", js_name = "decodeQueueSize")]
38    #[doc = "Getter for the `decodeQueueSize` field of this object."]
39    #[doc = ""]
40    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/decodeQueueSize)"]
41    #[doc = ""]
42    #[doc = "*This API requires the following crate features to be activated: `VideoDecoder`*"]
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 decode_queue_size(this: &VideoDecoder) -> u32;
47    #[cfg(web_sys_unstable_apis)]
48    #[wasm_bindgen(method, getter, js_class = "VideoDecoder", 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/VideoDecoder/ondequeue)"]
52    #[doc = ""]
53    #[doc = "*This API requires the following crate features to be activated: `VideoDecoder`*"]
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: &VideoDecoder) -> Option<::js_sys::Function>;
58    #[cfg(web_sys_unstable_apis)]
59    #[wasm_bindgen(method, setter, js_class = "VideoDecoder", 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/VideoDecoder/ondequeue)"]
63    #[doc = ""]
64    #[doc = "*This API requires the following crate features to be activated: `VideoDecoder`*"]
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: &VideoDecoder, value: Option<&::js_sys::Function>);
69    #[cfg(web_sys_unstable_apis)]
70    #[cfg(feature = "VideoDecoderInit")]
71    #[wasm_bindgen(catch, constructor, js_class = "VideoDecoder")]
72    #[doc = "The `new VideoDecoder(..)` constructor, creating a new instance of `VideoDecoder`."]
73    #[doc = ""]
74    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/VideoDecoder)"]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `VideoDecoder`, `VideoDecoderInit`*"]
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: &VideoDecoderInit) -> Result<VideoDecoder, JsValue>;
81    #[cfg(web_sys_unstable_apis)]
82    #[wasm_bindgen(catch, method, js_class = "VideoDecoder")]
83    #[doc = "The `close()` method."]
84    #[doc = ""]
85    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/close)"]
86    #[doc = ""]
87    #[doc = "*This API requires the following crate features to be activated: `VideoDecoder`*"]
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: &VideoDecoder) -> Result<(), JsValue>;
92    #[cfg(web_sys_unstable_apis)]
93    #[cfg(feature = "VideoDecoderConfig")]
94    #[wasm_bindgen(catch, method, js_class = "VideoDecoder")]
95    #[doc = "The `configure()` method."]
96    #[doc = ""]
97    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/configure)"]
98    #[doc = ""]
99    #[doc = "*This API requires the following crate features to be activated: `VideoDecoder`, `VideoDecoderConfig`*"]
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: &VideoDecoder, config: &VideoDecoderConfig) -> Result<(), JsValue>;
104    #[cfg(web_sys_unstable_apis)]
105    #[cfg(feature = "EncodedVideoChunk")]
106    #[wasm_bindgen(catch, method, js_class = "VideoDecoder")]
107    #[doc = "The `decode()` method."]
108    #[doc = ""]
109    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/decode)"]
110    #[doc = ""]
111    #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunk`, `VideoDecoder`*"]
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 decode(this: &VideoDecoder, chunk: &EncodedVideoChunk) -> Result<(), JsValue>;
116    #[cfg(web_sys_unstable_apis)]
117    #[wasm_bindgen(method, js_class = "VideoDecoder")]
118    #[doc = "The `flush()` method."]
119    #[doc = ""]
120    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/flush)"]
121    #[doc = ""]
122    #[doc = "*This API requires the following crate features to be activated: `VideoDecoder`*"]
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    pub fn flush(this: &VideoDecoder) -> ::js_sys::Promise<::js_sys::Undefined>;
127    #[cfg(web_sys_unstable_apis)]
128    #[cfg(all(feature = "VideoDecoderConfig", feature = "VideoDecoderSupport",))]
129    #[wasm_bindgen(
130        static_method_of = "VideoDecoder",
131        js_class = "VideoDecoder",
132        js_name = "isConfigSupported"
133    )]
134    #[doc = "The `isConfigSupported()` method."]
135    #[doc = ""]
136    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/isConfigSupported_static)"]
137    #[doc = ""]
138    #[doc = "*This API requires the following crate features to be activated: `VideoDecoder`, `VideoDecoderConfig`, `VideoDecoderSupport`*"]
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 is_config_supported(
143        config: &VideoDecoderConfig,
144    ) -> ::js_sys::Promise<VideoDecoderSupport>;
145    #[cfg(web_sys_unstable_apis)]
146    #[wasm_bindgen(catch, method, js_class = "VideoDecoder")]
147    #[doc = "The `reset()` method."]
148    #[doc = ""]
149    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VideoDecoder/reset)"]
150    #[doc = ""]
151    #[doc = "*This API requires the following crate features to be activated: `VideoDecoder`*"]
152    #[doc = ""]
153    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
154    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
155    pub fn reset(this: &VideoDecoder) -> Result<(), JsValue>;
156}