1 #![warn(rust_2018_idioms)] 2 #![allow(dead_code)] 3 4 //! Package rtcp implements encoding and decoding of RTCP packets according to RFCs 3550 and 5506. 5 //! 6 //! RTCP is a sister protocol of the Real-time Transport Protocol (RTP). Its basic functionality 7 //! and packet structure is defined in RFC 3550. RTCP provides out-of-band statistics and control 8 //! information for an RTP session. It partners with RTP in the delivery and packaging of multimedia data, 9 //! but does not transport any media data itself. 10 //! 11 //! The primary function of RTCP is to provide feedback on the quality of service (QoS) 12 //! in media distribution by periodically sending statistics information such as transmitted octet 13 //! and packet counts, packet loss, packet delay variation, and round-trip delay time to participants 14 //! in a streaming multimedia session. An application may use this information to control quality of 15 //! service parameters, perhaps by limiting flow, or using a different codec. 16 //! 17 //! Decoding RTCP packets: 18 //!```nobuild 19 //! let pkt = rtcp::unmarshal(&rtcp_data).unwrap(); 20 //! 21 //! if let Some(e) = pkt 22 //! .as_any() 23 //! .downcast_ref::<PictureLossIndication>() 24 //! { 25 //! 26 //! } 27 //! else if let Some(e) = packet 28 //! .as_any() 29 //! .downcast_ref::<Goodbye>(){} 30 //! .... 31 //!``` 32 //! 33 //! Encoding RTCP packets: 34 //!```nobuild 35 //! let pkt = PictureLossIndication{ 36 //! sender_ssrc: sender_ssrc, 37 //! media_ssrc: media_ssrc 38 //! }; 39 //! 40 //! let pli_data = pkt.marshal().unwrap(); 41 //! // ... 42 //!``` 43 44 pub mod compound_packet; 45 mod error; 46 pub mod extended_report; 47 pub mod goodbye; 48 pub mod header; 49 pub mod packet; 50 pub mod payload_feedbacks; 51 pub mod raw_packet; 52 pub mod receiver_report; 53 pub mod reception_report; 54 pub mod sender_report; 55 pub mod source_description; 56 pub mod transport_feedbacks; 57 mod util; 58 59 pub use error::Error; 60