- Switched to Rust 2021 edition.
RtpPacketBuildError
andRtpReaderError
now implementstd::error::Error
- The
Seq
type now implementsOrd
(in addition to thePartialOrd
implementation that was already available). - @WolverinDEV added an
RtpPacketBuilder
🎊
RtpHeaderError
was renamed toRtpReaderError
(the type relates to read-failures specifically, and we now have support for writing too)RtpHeader::padding()
now returnsOption<u8>
, rather thanbool
, exposing how many padding bytes are present as well as the fact that padding is in use.- We no longer reject RTP packets that contain headers but no payload
- Trailing padding-bytes, indicated by the
padding
flag in the RTP header, are now excluded from the data returned by thepayload()
method. - Since we now pay attention to padding data,
RtpReader::new()
will fail if the indicated padding length is nonsensical (less than one byte, or greater than the available space).
RtpHeaderError
gains a newPaddingLengthInvalid
variant- The
Seq
methodsnext()
andprecedes()
now both takeself
by value, which clippy points out should be more efficient,
csrc()
method to expose any CSRC header values that might be present (rarely used RTP feature).- API docs are now provided for all public items
RtpReader::extension()
no longer returns the boolean flag indicating if an extension is present, and instead produces anOption
which isSome
when an extension header is present. TheOption
contains a(u16, &[u8])
tuple when an extension header is present, where theu16
value is the extension header id, and the byte-slice is the extension header payload.
- Should no longer panic if the RTP packet length is not sufficient to contain all 4 bytes of an extension header (where the extension header is flagged to be present) -- thanks to @ts252 for spotting.
- Extension header lengths where incorrectly calculated in earlier releases, which would have resulted in invalid RTP payload data being produced for any packets that actually had an extension (the extension length header is a count of 32-bit values, not a count of 8-bit values as the previous implementation had assumed).