web_sys/features/
gen_RtcRtpCodecCapability.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCRtpCodecCapability)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `RtcRtpCodecCapability` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"]
12    pub type RtcRtpCodecCapability;
13    #[doc = "Get the `channels` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"]
16    #[wasm_bindgen(method, getter = "channels")]
17    pub fn get_channels(this: &RtcRtpCodecCapability) -> Option<u16>;
18    #[doc = "Change the `channels` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"]
21    #[wasm_bindgen(method, setter = "channels")]
22    pub fn set_channels(this: &RtcRtpCodecCapability, val: u16);
23    #[doc = "Get the `clockRate` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"]
26    #[wasm_bindgen(method, getter = "clockRate")]
27    pub fn get_clock_rate(this: &RtcRtpCodecCapability) -> u32;
28    #[doc = "Change the `clockRate` field of this object."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"]
31    #[wasm_bindgen(method, setter = "clockRate")]
32    pub fn set_clock_rate(this: &RtcRtpCodecCapability, val: u32);
33    #[doc = "Get the `mimeType` field of this object."]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"]
36    #[wasm_bindgen(method, getter = "mimeType")]
37    pub fn get_mime_type(this: &RtcRtpCodecCapability) -> ::alloc::string::String;
38    #[doc = "Change the `mimeType` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"]
41    #[wasm_bindgen(method, setter = "mimeType")]
42    pub fn set_mime_type(this: &RtcRtpCodecCapability, val: &str);
43    #[doc = "Get the `sdpFmtpLine` field of this object."]
44    #[doc = ""]
45    #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"]
46    #[wasm_bindgen(method, getter = "sdpFmtpLine")]
47    pub fn get_sdp_fmtp_line(this: &RtcRtpCodecCapability) -> Option<::alloc::string::String>;
48    #[doc = "Change the `sdpFmtpLine` field of this object."]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"]
51    #[wasm_bindgen(method, setter = "sdpFmtpLine")]
52    pub fn set_sdp_fmtp_line(this: &RtcRtpCodecCapability, val: &str);
53}
54impl RtcRtpCodecCapability {
55    #[doc = "Construct a new `RtcRtpCodecCapability`."]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"]
58    pub fn new(clock_rate: u32, mime_type: &str) -> Self {
59        #[allow(unused_mut)]
60        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
61        ret.set_clock_rate(clock_rate);
62        ret.set_mime_type(mime_type);
63        ret
64    }
65    #[deprecated = "Use `set_channels()` instead."]
66    pub fn channels(&mut self, val: u16) -> &mut Self {
67        self.set_channels(val);
68        self
69    }
70    #[deprecated = "Use `set_clock_rate()` instead."]
71    pub fn clock_rate(&mut self, val: u32) -> &mut Self {
72        self.set_clock_rate(val);
73        self
74    }
75    #[deprecated = "Use `set_mime_type()` instead."]
76    pub fn mime_type(&mut self, val: &str) -> &mut Self {
77        self.set_mime_type(val);
78        self
79    }
80    #[deprecated = "Use `set_sdp_fmtp_line()` instead."]
81    pub fn sdp_fmtp_line(&mut self, val: &str) -> &mut Self {
82        self.set_sdp_fmtp_line(val);
83        self
84    }
85}