async fn write_rtp(&self, p: &rtp::packet::Packet) -> Result<usize> {
        let mut n = 0;
        let mut write_errs = vec![];
        let mut pkt = p.clone();

        let bindings = {
            let bindings = self.bindings.lock().await;
            bindings.clone()
        };
        for b in bindings {
            pkt.header.ssrc = b.ssrc;
            pkt.header.payload_type = b.payload_type;
            if let Some(write_stream) = &b.write_stream {
                match write_stream.write_rtp(&pkt).await {
                    Ok(m) => {
                        n += m;
                    }
                    Err(err) => {
                        write_errs.push(err);
                    }
                }
            } else {
                write_errs.push(Error::new("track binding has none write_stream".to_owned()));
            }
        }

        flatten_errs(write_errs)?;
        Ok(n)
    }
/// write_rtp writes a RTP Packet to the TrackLocalStaticRTP
/// If one PeerConnection fails the packets will still be sent to
/// all PeerConnections. The error message will contain the ID of the failed
/// PeerConnections so you can remove them
write_rtp writes a RTP Packet to the TrackLocalStaticRTP
If one PeerConnection fails the packets will still be sent to
all PeerConnections. The error message will contain the ID of the failed
PeerConnections so you can remove them
write_rtp writes a RTP Packet to the TrackLocalStaticRTP If one PeerConnection fails the packets will still be sent to all PeerConnections . The error message will contain the ID of the failed PeerConnections so you can remove them
async fn write_rtp(&self, p: &rtp::packet::Packet) -> Result<usize> {
        let mut n = 0;
        let mut write_errs = vec![];
        let mut pkt = p.clone();
        let bindings = {
            let bindings = self.bindings.lock().await;
            bindings.clone()
        };
        for b in bindings {
            pkt.header.ssrc = b.ssrc;
            pkt.header.payload_type = b.payload_type;
            if let Some(write_stream) = &b.write_stream {
                match write_stream.write_rtp(&pkt).await {
                    Ok(m) => {
                        n += m;
                    }
                    Err(err) => {
                        write_errs.push(err);
                    }
                }
            } else {
                write_errs.push(Error::new("track binding has none write_stream".to_owned()));
            }
        }
        flatten_errs(write_errs)?;
        Ok(n)
    }
async fn write_rtp ( & self , p : & rtp :: packet :: Packet ) -> Result < usize > { let mut n = 0 ; let mut write_errs = vec ! [ ] ; let mut pkt = p . clone ( ) ; let bindings = { let bindings = self . bindings . lock ( ) . await ; bindings . clone ( ) } ; for b in bindings { pkt . header . ssrc = b . ssrc ; pkt . header . payload_type = b . payload_type ; if let Some ( write_stream ) = & b . write_stream { match write_stream . write_rtp ( & pkt ) . await { Ok ( m ) => { n += m ; } Err ( err ) => { write_errs . push ( err ) ; } } } else { write_errs . push ( Error :: new ( " " . to_owned ( ) ) ) ; } } flatten_errs ( write_errs ) ? ; Ok ( n ) }
write_rtp writes a RTP Packet to the TrackLocalStaticRTP
If one PeerConnection fails the packets will still be sent to
all PeerConnections.
write_rtp writes a RTP Packet to the TrackLocalStaticRTP If one PeerConnection fails the packets will still be sent to all PeerConnections .
&self
p
&rtp::packet::Packet