#[non_exhaustive]pub struct RedundantEncoding {
pub payload: Bytes,
}Expand description
Another encoding of a packet’s audio, for the RED packets after it to carry instead of a
copy of the packet (RFC 8854 section 4.1: when multi-packet protection is needed,
“redundant encoding with reduced-bitrate Opus encodings SHOULD be used”; RFC 2198 section 3:
“the redundant encoding shall use significantly less bandwidth”). The engine does not
encode audio: the application’s encoder makes it, at the primary’s payload type and
timestamp, and puts it on the packet it writes as Attribute::Custom.
One larger than the primary is not used (RFC 2198: it “MUST NOT be higher bandwidth than
the primary”); a stream not sent in RED ignores it.
use bytes::Bytes;
use rtci_interceptor::{Attribute, AttributedPacket, Packet, RedundantEncoding};
use std::sync::Arc;
let low_bitrate = Bytes::from_static(&[0x08, 0x01, 0x02]);
let message = AttributedPacket::new(Packet::Rtp(primary))
.with(Attribute::Custom(Arc::new(RedundantEncoding::new(low_bitrate))));Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.payload: BytesThe payload of the other encoding.
Implementations§
Trait Implementations§
Source§impl Clone for RedundantEncoding
impl Clone for RedundantEncoding
Source§impl Debug for RedundantEncoding
impl Debug for RedundantEncoding
impl Eq for RedundantEncoding
Source§impl PartialEq for RedundantEncoding
impl PartialEq for RedundantEncoding
impl StructuralPartialEq for RedundantEncoding
Auto Trait Implementations§
impl !Freeze for RedundantEncoding
impl Forget for RedundantEncoding
impl Move for RedundantEncoding
impl RefUnwindSafe for RedundantEncoding
impl Send for RedundantEncoding
impl Sync for RedundantEncoding
impl Unpin for RedundantEncoding
impl UnsafeUnpin for RedundantEncoding
impl UnwindSafe for RedundantEncoding
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more