use super::*;
#[derive(Clone, Debug, PartialEq, PartialOrd)]
#[repr(transparent)]
pub struct RTCCodecStats {
inner: Any,
}
impl FromVal for RTCCodecStats {
fn from_val(v: &Any) -> Self {
RTCCodecStats { inner: v.clone() }
}
fn take_ownership(v: AnyHandle) -> Self {
Self::from_val(&Any::take_ownership(v))
}
fn as_handle(&self) -> AnyHandle {
self.inner.as_handle()
}
}
impl core::ops::Deref for RTCCodecStats {
type Target = Any;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl core::ops::DerefMut for RTCCodecStats {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner
}
}
impl AsRef<Any> for RTCCodecStats {
fn as_ref(&self) -> &Any {
&self.inner
}
}
impl AsMut<Any> for RTCCodecStats {
fn as_mut(&mut self) -> &mut Any {
&mut self.inner
}
}
impl From<RTCCodecStats> for Any {
fn from(s: RTCCodecStats) -> Any {
let handle = s.inner.as_handle();
core::mem::forget(s);
Any::take_ownership(handle)
}
}
impl From<&RTCCodecStats> for Any {
fn from(s: &RTCCodecStats) -> Any {
s.inner.clone()
}
}
impl RTCCodecStats {
pub fn payload_type(&self) -> u32 {
self.inner.get("payloadType").as_::<u32>()
}
pub fn set_payload_type(&mut self, value: u32) {
self.inner.set("payloadType", value);
}
}
impl RTCCodecStats {
pub fn transport_id(&self) -> JsString {
self.inner.get("transportId").as_::<JsString>()
}
pub fn set_transport_id(&mut self, value: &JsString) {
self.inner.set("transportId", value);
}
}
impl RTCCodecStats {
pub fn mime_type(&self) -> JsString {
self.inner.get("mimeType").as_::<JsString>()
}
pub fn set_mime_type(&mut self, value: &JsString) {
self.inner.set("mimeType", value);
}
}
impl RTCCodecStats {
pub fn clock_rate(&self) -> u32 {
self.inner.get("clockRate").as_::<u32>()
}
pub fn set_clock_rate(&mut self, value: u32) {
self.inner.set("clockRate", value);
}
}
impl RTCCodecStats {
pub fn channels(&self) -> u32 {
self.inner.get("channels").as_::<u32>()
}
pub fn set_channels(&mut self, value: u32) {
self.inner.set("channels", value);
}
}
impl RTCCodecStats {
pub fn sdp_fmtp_line(&self) -> JsString {
self.inner.get("sdpFmtpLine").as_::<JsString>()
}
pub fn set_sdp_fmtp_line(&mut self, value: &JsString) {
self.inner.set("sdpFmtpLine", value);
}
}