use std::rc::Rc;
use dom_struct::dom_struct;
use crate::dom::bindings::codegen::Bindings::RTCRtpSenderBinding::{
RTCRtcpParameters, RTCRtpParameters, RTCRtpSendParameters, RTCRtpSenderMethods,
};
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::str::DOMString;
use crate::dom::globalscope::GlobalScope;
use crate::dom::promise::Promise;
use crate::script_runtime::CanGc;
#[dom_struct]
pub struct RTCRtpSender {
reflector_: Reflector,
}
impl RTCRtpSender {
fn new_inherited() -> Self {
Self {
reflector_: Reflector::new(),
}
}
pub(crate) fn new(global: &GlobalScope) -> DomRoot<Self> {
reflect_dom_object(Box::new(Self::new_inherited()), global, CanGc::note())
}
}
impl RTCRtpSenderMethods<crate::DomTypeHolder> for RTCRtpSender {
fn GetParameters(&self) -> RTCRtpSendParameters {
RTCRtpSendParameters {
parent: RTCRtpParameters {
headerExtensions: vec![],
rtcp: RTCRtcpParameters {
cname: None,
reducedSize: None,
},
codecs: vec![],
},
transactionId: DOMString::new(),
encodings: vec![],
}
}
fn SetParameters(&self, _parameters: &RTCRtpSendParameters, can_gc: CanGc) -> Rc<Promise> {
let promise = Promise::new(&self.global(), can_gc);
promise.resolve_native(&());
promise
}
}