maxcountryman_web_sys/features/
gen_RtcRtpEncodingParameters.rs1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[wasm_bindgen]
5extern "C" {
6 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCRtpEncodingParameters)]
7 #[derive(Debug, Clone, PartialEq, Eq)]
8 #[doc = "The `RtcRtpEncodingParameters` dictionary."]
9 #[doc = ""]
10 #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"]
11 pub type RtcRtpEncodingParameters;
12}
13impl RtcRtpEncodingParameters {
14 #[doc = "Construct a new `RtcRtpEncodingParameters`."]
15 #[doc = ""]
16 #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"]
17 pub fn new() -> Self {
18 #[allow(unused_mut)]
19 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
20 ret
21 }
22 #[doc = "Change the `active` field of this object."]
23 #[doc = ""]
24 #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"]
25 pub fn active(&mut self, val: bool) -> &mut Self {
26 use wasm_bindgen::JsValue;
27 let r =
28 ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("active"), &JsValue::from(val));
29 debug_assert!(
30 r.is_ok(),
31 "setting properties should never fail on our dictionary objects"
32 );
33 let _ = r;
34 self
35 }
36 #[cfg(feature = "RtcDegradationPreference")]
37 #[doc = "Change the `degradationPreference` field of this object."]
38 #[doc = ""]
39 #[doc = "*This API requires the following crate features to be activated: `RtcDegradationPreference`, `RtcRtpEncodingParameters`*"]
40 pub fn degradation_preference(&mut self, val: RtcDegradationPreference) -> &mut Self {
41 use wasm_bindgen::JsValue;
42 let r = ::js_sys::Reflect::set(
43 self.as_ref(),
44 &JsValue::from("degradationPreference"),
45 &JsValue::from(val),
46 );
47 debug_assert!(
48 r.is_ok(),
49 "setting properties should never fail on our dictionary objects"
50 );
51 let _ = r;
52 self
53 }
54 #[cfg(feature = "RtcFecParameters")]
55 #[doc = "Change the `fec` field of this object."]
56 #[doc = ""]
57 #[doc = "*This API requires the following crate features to be activated: `RtcFecParameters`, `RtcRtpEncodingParameters`*"]
58 pub fn fec(&mut self, val: &RtcFecParameters) -> &mut Self {
59 use wasm_bindgen::JsValue;
60 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("fec"), &JsValue::from(val));
61 debug_assert!(
62 r.is_ok(),
63 "setting properties should never fail on our dictionary objects"
64 );
65 let _ = r;
66 self
67 }
68 #[doc = "Change the `maxBitrate` field of this object."]
69 #[doc = ""]
70 #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"]
71 pub fn max_bitrate(&mut self, val: u32) -> &mut Self {
72 use wasm_bindgen::JsValue;
73 let r = ::js_sys::Reflect::set(
74 self.as_ref(),
75 &JsValue::from("maxBitrate"),
76 &JsValue::from(val),
77 );
78 debug_assert!(
79 r.is_ok(),
80 "setting properties should never fail on our dictionary objects"
81 );
82 let _ = r;
83 self
84 }
85 #[cfg(feature = "RtcPriorityType")]
86 #[doc = "Change the `priority` field of this object."]
87 #[doc = ""]
88 #[doc = "*This API requires the following crate features to be activated: `RtcPriorityType`, `RtcRtpEncodingParameters`*"]
89 pub fn priority(&mut self, val: RtcPriorityType) -> &mut Self {
90 use wasm_bindgen::JsValue;
91 let r = ::js_sys::Reflect::set(
92 self.as_ref(),
93 &JsValue::from("priority"),
94 &JsValue::from(val),
95 );
96 debug_assert!(
97 r.is_ok(),
98 "setting properties should never fail on our dictionary objects"
99 );
100 let _ = r;
101 self
102 }
103 #[doc = "Change the `rid` field of this object."]
104 #[doc = ""]
105 #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"]
106 pub fn rid(&mut self, val: &str) -> &mut Self {
107 use wasm_bindgen::JsValue;
108 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("rid"), &JsValue::from(val));
109 debug_assert!(
110 r.is_ok(),
111 "setting properties should never fail on our dictionary objects"
112 );
113 let _ = r;
114 self
115 }
116 #[cfg(feature = "RtcRtxParameters")]
117 #[doc = "Change the `rtx` field of this object."]
118 #[doc = ""]
119 #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`, `RtcRtxParameters`*"]
120 pub fn rtx(&mut self, val: &RtcRtxParameters) -> &mut Self {
121 use wasm_bindgen::JsValue;
122 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("rtx"), &JsValue::from(val));
123 debug_assert!(
124 r.is_ok(),
125 "setting properties should never fail on our dictionary objects"
126 );
127 let _ = r;
128 self
129 }
130 #[doc = "Change the `scaleResolutionDownBy` field of this object."]
131 #[doc = ""]
132 #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"]
133 pub fn scale_resolution_down_by(&mut self, val: f32) -> &mut Self {
134 use wasm_bindgen::JsValue;
135 let r = ::js_sys::Reflect::set(
136 self.as_ref(),
137 &JsValue::from("scaleResolutionDownBy"),
138 &JsValue::from(val),
139 );
140 debug_assert!(
141 r.is_ok(),
142 "setting properties should never fail on our dictionary objects"
143 );
144 let _ = r;
145 self
146 }
147 #[doc = "Change the `ssrc` field of this object."]
148 #[doc = ""]
149 #[doc = "*This API requires the following crate features to be activated: `RtcRtpEncodingParameters`*"]
150 pub fn ssrc(&mut self, val: u32) -> &mut Self {
151 use wasm_bindgen::JsValue;
152 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ssrc"), &JsValue::from(val));
153 debug_assert!(
154 r.is_ok(),
155 "setting properties should never fail on our dictionary objects"
156 );
157 let _ = r;
158 self
159 }
160}
161impl Default for RtcRtpEncodingParameters {
162 fn default() -> Self {
163 Self::new()
164 }
165}