pub struct TsResync { /* private fields */ }Expand description
TS byte-stream resynchroniser.
Recovers 188-byte MPEG-TS packet alignment from an arbitrary byte stream that may start mid-packet or contain junk, and detects 204-byte Reed-Solomon-coded packets (stripping the 16 parity bytes).
ISO/IEC 13818-1 §2.4.3.2.
Implementations§
Source§impl TsResync
impl TsResync
Sourcepub fn feed(&mut self, data: &[u8]) -> Vec<[u8; 188]>
pub fn feed(&mut self, data: &[u8]) -> Vec<[u8; 188]>
Append data, emit every newly-aligned 188-byte TS packet.
When the stream is detected as 204-byte, the 16 Reed-Solomon parity bytes are stripped and only the 188-byte TS payload is emitted. Bytes are buffered across calls.
Sourcepub fn stride(&self) -> Option<PacketStride>
pub fn stride(&self) -> Option<PacketStride>
Detected packet stride, or None before the stream has locked.
Sourcepub fn stats(&self) -> ResyncStats
pub fn stats(&self) -> ResyncStats
Accumulated statistics.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TsResync
impl RefUnwindSafe for TsResync
impl Send for TsResync
impl Sync for TsResync
impl Unpin for TsResync
impl UnsafeUnpin for TsResync
impl UnwindSafe for TsResync
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