From d40f5bc6ece18c8fa09013d2e47e500a9e333dcd Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 19 Nov 2024 03:25:57 +0100 Subject: move files again --- rtp/src/rtcp.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 rtp/src/rtcp.rs (limited to 'rtp/src/rtcp.rs') diff --git a/rtp/src/rtcp.rs b/rtp/src/rtcp.rs new file mode 100644 index 0000000..0ae8ea7 --- /dev/null +++ b/rtp/src/rtcp.rs @@ -0,0 +1,26 @@ +#[derive(Debug, thiserror::Error)] +pub enum Error { + #[error("packet truncated")] + Truncated, +} + +pub struct RtcpPacket<'a> { + a: &'a [u8], +} + +pub enum RtcpPart { + SenderReport {}, + ReceiverReport {}, + SourceDescription {}, + Bye {}, + Application {}, +} + +impl<'a> RtcpPacket<'a> { + pub fn parse(packet: &'a [u8]) -> Result, Error> { + Ok(Self { a: packet }) + } + pub fn write(&self, out: &mut Vec) { + out.extend(self.a); + } +} -- cgit v1.2.3-70-g09d2