|
| 1 | +#![allow(unused_imports)] |
| 2 | +#![allow(clippy::all)] |
| 3 | +use super::*; |
| 4 | +use wasm_bindgen::prelude::*; |
| 5 | +#[wasm_bindgen] |
| 6 | +extern "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 | +} |
| 14 | +impl RtcRtpCodecCapability { |
| 15 | + #[doc = "Construct a new `RtcRtpCodecCapability`."] |
| 16 | + #[doc = ""] |
| 17 | + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] |
| 18 | + pub fn new(clock_rate: u32, mime_type: &str) -> Self { |
| 19 | + #[allow(unused_mut)] |
| 20 | + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); |
| 21 | + ret.clock_rate(clock_rate); |
| 22 | + ret.mime_type(mime_type); |
| 23 | + ret |
| 24 | + } |
| 25 | + #[doc = "Change the `channels` field of this object."] |
| 26 | + #[doc = ""] |
| 27 | + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] |
| 28 | + pub fn channels(&mut self, val: u16) -> &mut Self { |
| 29 | + use wasm_bindgen::JsValue; |
| 30 | + let r = ::js_sys::Reflect::set( |
| 31 | + self.as_ref(), |
| 32 | + &JsValue::from("channels"), |
| 33 | + &JsValue::from(val), |
| 34 | + ); |
| 35 | + debug_assert!( |
| 36 | + r.is_ok(), |
| 37 | + "setting properties should never fail on our dictionary objects" |
| 38 | + ); |
| 39 | + let _ = r; |
| 40 | + self |
| 41 | + } |
| 42 | + #[doc = "Change the `clockRate` field of this object."] |
| 43 | + #[doc = ""] |
| 44 | + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] |
| 45 | + pub fn clock_rate(&mut self, val: u32) -> &mut Self { |
| 46 | + use wasm_bindgen::JsValue; |
| 47 | + let r = ::js_sys::Reflect::set( |
| 48 | + self.as_ref(), |
| 49 | + &JsValue::from("clockRate"), |
| 50 | + &JsValue::from(val), |
| 51 | + ); |
| 52 | + debug_assert!( |
| 53 | + r.is_ok(), |
| 54 | + "setting properties should never fail on our dictionary objects" |
| 55 | + ); |
| 56 | + let _ = r; |
| 57 | + self |
| 58 | + } |
| 59 | + #[doc = "Change the `mimeType` field of this object."] |
| 60 | + #[doc = ""] |
| 61 | + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] |
| 62 | + pub fn mime_type(&mut self, val: &str) -> &mut Self { |
| 63 | + use wasm_bindgen::JsValue; |
| 64 | + let r = ::js_sys::Reflect::set( |
| 65 | + self.as_ref(), |
| 66 | + &JsValue::from("mimeType"), |
| 67 | + &JsValue::from(val), |
| 68 | + ); |
| 69 | + debug_assert!( |
| 70 | + r.is_ok(), |
| 71 | + "setting properties should never fail on our dictionary objects" |
| 72 | + ); |
| 73 | + let _ = r; |
| 74 | + self |
| 75 | + } |
| 76 | + #[doc = "Change the `sdpFmtpLine` field of this object."] |
| 77 | + #[doc = ""] |
| 78 | + #[doc = "*This API requires the following crate features to be activated: `RtcRtpCodecCapability`*"] |
| 79 | + pub fn sdp_fmtp_line(&mut self, val: &str) -> &mut Self { |
| 80 | + use wasm_bindgen::JsValue; |
| 81 | + let r = ::js_sys::Reflect::set( |
| 82 | + self.as_ref(), |
| 83 | + &JsValue::from("sdpFmtpLine"), |
| 84 | + &JsValue::from(val), |
| 85 | + ); |
| 86 | + debug_assert!( |
| 87 | + r.is_ok(), |
| 88 | + "setting properties should never fail on our dictionary objects" |
| 89 | + ); |
| 90 | + let _ = r; |
| 91 | + self |
| 92 | + } |
| 93 | +} |
0 commit comments