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