pub struct RTCRtpTransceiverInit {
pub direction: RTCRtpTransceiverDirection,
pub streams: Vec<MediaStreamId>,
pub send_encodings: Vec<RTCRtpEncodingParameters>,
}Expand description
Initialization parameters for creating an RTCRtpTransceiver.
Used with add_transceiver_from_track or add_transceiver_from_kind to configure
the transceiver’s initial direction and encoding parameters.
§Specification
Fields§
§direction: RTCRtpTransceiverDirectionThe initial direction of the transceiver; sendrecv by default.
streams: Vec<MediaStreamId>The stream IDs associated with the transceiver’s sender.
send_encodings: Vec<RTCRtpEncodingParameters>The encoding parameters to use when sending media.
Implementations§
Source§impl RTCRtpTransceiverInit
impl RTCRtpTransceiverInit
Sourcepub fn with_direction(direction: RTCRtpTransceiverDirection) -> Self
pub fn with_direction(direction: RTCRtpTransceiverDirection) -> Self
An init with direction, no streams and no send encodings.
Sourcepub fn with_simulcast_layers(
self,
encodings: Vec<RTCRtpEncodingParameters>,
) -> Self
pub fn with_simulcast_layers( self, encodings: Vec<RTCRtpEncodingParameters>, ) -> Self
Sends encodings as simulcast layers: each one an RTP stream of its own, named by
its rid in the description (a=rid and a=simulcast, RFC 8853).
In this API several encodings without rids are codec alternatives of one stream
(the first one the negotiation allows is sent), as upstream has them. Encodings given
here are layers instead: one without a rid gets one generated, as RFC 9429 section
5.2.1 asks when the application set none (“an rid-id value MUST be generated … it
MUST NOT contain user data, … SHOULD be no more than 3 bytes”): the smallest
decimal number (0, 1, …) no other encoding uses. Rids the application set are
kept.
§Examples
use rtci::rtp_transceiver::RTCRtpTransceiverInit;
use rtci::rtp_transceiver::rtp_sender::RTCRtpEncodingParameters;
let init = RTCRtpTransceiverInit::default()
.with_simulcast_layers(vec![RTCRtpEncodingParameters::default(); 3]);
let rids: Vec<&str> = init
.send_encodings
.iter()
.map(|e| e.rtp_coding_parameters.rid.as_str())
.collect();
assert_eq!(rids, ["0", "1", "2"]);Trait Implementations§
Source§impl Clone for RTCRtpTransceiverInit
impl Clone for RTCRtpTransceiverInit
Auto Trait Implementations§
impl Forget for RTCRtpTransceiverInit
impl Freeze for RTCRtpTransceiverInitwhere
*const u8 is !null: Freeze,
PhantomData<String>: Freeze,
PhantomData<RTCRtpEncodingParameters>: Freeze,
impl Move for RTCRtpTransceiverInit
impl RefUnwindSafe for RTCRtpTransceiverInit
impl Send for RTCRtpTransceiverInitwhere
RawVecInner: Send,
impl Sync for RTCRtpTransceiverInitwhere
RawVecInner: Sync,
impl Unpin for RTCRtpTransceiverInit
impl UnsafeUnpin for RTCRtpTransceiverInitwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<RTCRtpEncodingParameters>: UnsafeUnpin,
impl UnwindSafe for RTCRtpTransceiverInitwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.