[domistream] Implementation: HTTP, pairing, RTSP/SDP, ENet, control, input, RTP, FEC, video and audio receivers
Per PROTOCOL.md and the Wolf docs; interop with a real host is unverified. Strict, capped parsers throughout, shared helpers in util.rs. Where PROTOCOL.md says UNKNOWN the Wolf-documented behaviour is used. The audio receiver waits for the jitter budget before rebuilding a missing packet, so a late packet beats a rebuilt one.
This commit is contained in:
@@ -26,8 +26,18 @@ pub struct RtpHeader {
|
||||
///
|
||||
/// # Errors
|
||||
/// [`crate::Error::Truncated`] for fewer than 12 bytes, [`crate::Error::UnexpectedValue`] for another RTP version.
|
||||
/// Phase A: always [`crate::Error::Unimplemented`].
|
||||
pub fn parse_rtp_header(packet: &[u8]) -> crate::Result<RtpHeader> {
|
||||
let _ = packet;
|
||||
Err(crate::Error::Unimplemented)
|
||||
const W: &str = "rtp header";
|
||||
crate::util::need(W, RTP_HEADER_LEN, packet.len())?;
|
||||
let flags = crate::util::byte(W, packet, 0)?;
|
||||
if flags >> 6 != 2 {
|
||||
return Err(crate::Error::UnexpectedValue { what: "rtp version", value: (flags >> 6).into() });
|
||||
}
|
||||
Ok(RtpHeader {
|
||||
flags,
|
||||
payload_type: crate::util::byte(W, packet, 1)?,
|
||||
sequence: crate::util::u16_be(W, packet, 2)?,
|
||||
timestamp: crate::util::u32_be(W, packet, 4)?,
|
||||
ssrc: crate::util::u32_be(W, packet, 8)?,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user