aboutsummaryrefslogtreecommitdiff
path: root/rtp/src/rtcp.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rtp/src/rtcp.rs')
-rw-r--r--rtp/src/rtcp.rs26
1 files changed, 26 insertions, 0 deletions
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<RtcpPacket<'a>, Error> {
+ Ok(Self { a: packet })
+ }
+ pub fn write(&self, out: &mut Vec<u8>) {
+ out.extend(self.a);
+ }
+}