async fn bind(&self, t: &TrackLocalContext) -> Result<RTCRtpCodecParameters> {
        let codec = self.rtp_track.bind(t).await?;

        let mut internal = self.internal.lock().await;

        // We only need one packetizer
        if internal.packetizer.is_some() {
            return Ok(codec);
        }

        let payloader = codec.capability.payloader_for_codec()?;
        let sequencer: Box<dyn rtp::sequence::Sequencer + Send + Sync> =
            Box::new(rtp::sequence::new_random_sequencer());
        internal.packetizer = Some(Box::new(rtp::packetizer::new_packetizer(
            RTP_OUTBOUND_MTU,
            0, // Value is handled when writing
            0, // Value is handled when writing
            payloader,
            sequencer.clone(),
            codec.capability.clock_rate,
        )));
        internal.sequencer = Some(sequencer);
        internal.clock_rate = codec.capability.clock_rate as f64;

        Ok(codec)
    }
/// Bind is called by the PeerConnection after negotiation is complete
/// This asserts that the code requested is supported by the remote peer.
/// If so it setups all the state (SSRC and PayloadType) to have a call
Bind is called by the PeerConnection after negotiation is complete
This asserts that the code requested is supported by the remote peer.
If so it setups all the state (SSRC and PayloadType) to have a call
Bind is called by the PeerConnection after negotiation is complete This asserts that the code requested is supported by the remote peer . If so it setups all the state ( SSRC and PayloadType ) to have a call
async fn bind(&self, t: &TrackLocalContext) -> Result<RTCRtpCodecParameters> {
        let codec = self.rtp_track.bind(t).await?;
        let mut internal = self.internal.lock().await;
        // We only need one packetizer
        if internal.packetizer.is_some() {
            return Ok(codec);
        }
        let payloader = codec.capability.payloader_for_codec()?;
        let sequencer: Box<dyn rtp::sequence::Sequencer + Send + Sync> =
            Box::new(rtp::sequence::new_random_sequencer());
        internal.packetizer = Some(Box::new(rtp::packetizer::new_packetizer(
            RTP_OUTBOUND_MTU,
            0, // Value is handled when writing
            0, // Value is handled when writing
            payloader,
            sequencer.clone(),
            codec.capability.clock_rate,
        )));
        internal.sequencer = Some(sequencer);
        internal.clock_rate = codec.capability.clock_rate as f64;
        Ok(codec)
    }
async fn bind ( & self , t : & TrackLocalContext ) -> Result < RTCRtpCodecParameters > { let codec = self . rtp_track . bind ( t ) . await ? ; let mut internal = self . internal . lock ( ) . await ; // We only need one packetizer if internal . packetizer . is_some ( ) { return Ok ( codec ) ; } let payloader = codec . capability . payloader_for_codec ( ) ? ; let sequencer : Box < dyn rtp :: sequence :: Sequencer + Send + Sync > = Box :: new ( rtp :: sequence :: new_random_sequencer ( ) ) ; internal . packetizer = Some ( Box :: new ( rtp :: packetizer :: new_packetizer ( RTP_OUTBOUND_MTU , 0 , // Value is handled when writing 0 , // Value is handled when writing payloader , sequencer . clone ( ) , codec . capability . clock_rate , ) ) ) ; internal . sequencer = Some ( sequencer ) ; internal . clock_rate = codec . capability . clock_rate as f64 ; Ok ( codec ) }
Bind is called by the PeerConnection after negotiation is complete
This asserts that the code requested is supported by the remote peer.
Bind is called by the PeerConnection after negotiation is complete This asserts that the code requested is supported by the remote peer .
&self
t
&TrackLocalContext