Skip to main content

web_sys/features/
gen_MediaStreamTrackProcessorInit.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 = "::js_sys::Object",
10        js_name = "MediaStreamTrackProcessorInit"
11    )]
12    #[derive(Debug, Clone, PartialEq, Eq)]
13    #[doc = "The `MediaStreamTrackProcessorInit` dictionary."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackProcessorInit`*"]
16    #[doc = ""]
17    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
18    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
19    pub type MediaStreamTrackProcessorInit;
20    #[cfg(web_sys_unstable_apis)]
21    #[doc = "Get the `maxBufferSize` field of this object."]
22    #[doc = ""]
23    #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackProcessorInit`*"]
24    #[doc = ""]
25    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
26    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
27    #[wasm_bindgen(method, getter = "maxBufferSize")]
28    pub fn get_max_buffer_size(this: &MediaStreamTrackProcessorInit) -> Option<u16>;
29    #[cfg(web_sys_unstable_apis)]
30    #[doc = "Change the `maxBufferSize` field of this object."]
31    #[doc = ""]
32    #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrackProcessorInit`*"]
33    #[doc = ""]
34    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
35    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
36    #[wasm_bindgen(method, setter = "maxBufferSize")]
37    pub fn set_max_buffer_size(this: &MediaStreamTrackProcessorInit, val: u16);
38    #[cfg(web_sys_unstable_apis)]
39    #[cfg(feature = "MediaStreamTrack")]
40    #[doc = "Get the `track` field of this object."]
41    #[doc = ""]
42    #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `MediaStreamTrackProcessorInit`*"]
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    #[wasm_bindgen(method, getter = "track")]
47    pub fn get_track(this: &MediaStreamTrackProcessorInit) -> MediaStreamTrack;
48    #[cfg(web_sys_unstable_apis)]
49    #[cfg(feature = "MediaStreamTrack")]
50    #[doc = "Change the `track` field of this object."]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `MediaStreamTrackProcessorInit`*"]
53    #[doc = ""]
54    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
55    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
56    #[wasm_bindgen(method, setter = "track")]
57    pub fn set_track(this: &MediaStreamTrackProcessorInit, val: &MediaStreamTrack);
58}
59#[cfg(web_sys_unstable_apis)]
60impl MediaStreamTrackProcessorInit {
61    #[cfg(feature = "MediaStreamTrack")]
62    #[doc = "Construct a new `MediaStreamTrackProcessorInit`."]
63    #[doc = ""]
64    #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `MediaStreamTrackProcessorInit`*"]
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 new(track: &MediaStreamTrack) -> Self {
69        #[allow(unused_mut)]
70        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
71        ret.set_track(track);
72        ret
73    }
74    #[cfg(web_sys_unstable_apis)]
75    #[deprecated = "Use `set_max_buffer_size()` instead."]
76    pub fn max_buffer_size(&mut self, val: u16) -> &mut Self {
77        self.set_max_buffer_size(val);
78        self
79    }
80    #[cfg(web_sys_unstable_apis)]
81    #[cfg(feature = "MediaStreamTrack")]
82    #[deprecated = "Use `set_track()` instead."]
83    pub fn track(&mut self, val: &MediaStreamTrack) -> &mut Self {
84        self.set_track(val);
85        self
86    }
87}