pub struct fec_packet_t { /* private fields */ }Expand description
FEC报文,实现对FEC的处理
Implementations§
Source§impl fec_packet_t
FEC处理,Encoder/Decoder同一套代码
impl fec_packet_t
FEC处理,Encoder/Decoder同一套代码
pub fn new() -> Self
pub fn start_encoder(&mut self, start_seq: u64, ratio: u8)
pub fn start_decoder(&mut self, start_seq: u64, ratio: u8)
pub fn is_fec_finished(&self) -> bool
pub fn is_first_packet(&self) -> bool
pub fn add_raw_packet(&mut self, seq: u64, pkt: &[u8]) -> RESULT
Sourcepub fn next_session(&mut self, new_ratio: u8)
pub fn next_session(&mut self, new_ratio: u8)
FEC Encoder和Decoder进入下一个处理会话,Seq顺延
pub fn next_start_seq(&self) -> u64
pub fn add_fec_packet(&mut self, seq: u64, pkt: &[u8]) -> RESULT
Sourcepub fn get_raw_packet(&self, buf: &mut [u8]) -> (usize, u64)
pub fn get_raw_packet(&self, buf: &mut [u8]) -> (usize, u64)
读取RawPacket,用于FEC计算恢复的原始报文;buf是应用传入的缓冲区,应该大于MTU长度 返回报文实际长度和恢复的rawPacket的序号,如果无丢包,则返回(0,0)
pub fn get_raw_packet_slice(&self) -> Option<(&[u8], u64)>
Sourcepub fn get_fec_packet(&self, buf: &mut [u8]) -> (usize, u64)
pub fn get_fec_packet(&self, buf: &mut [u8]) -> (usize, u64)
读取FecPacket,用于FEC计算结果;buf是应用传入的缓冲区,应该大于MTU长度 返回FEC报文实际长度和起始rawPacket序号
pub fn get_packet_len(&self) -> usize
pub fn get_payload_len(&self) -> usize
pub fn as_slice(&self) -> &[u8] ⓘ
pub fn as_mut_slice(&mut self) -> &[u8] ⓘ
pub fn get_recv_pkt_count(&self) -> usize
pub fn is_fec_pkt_recved(&self) -> bool
pub fn get_start_seq(&self) -> u64
Trait Implementations§
Source§impl Clone for fec_packet_t
impl Clone for fec_packet_t
Source§fn clone(&self) -> fec_packet_t
fn clone(&self) -> fec_packet_t
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for fec_packet_t
impl RefUnwindSafe for fec_packet_t
impl Send for fec_packet_t
impl Sync for fec_packet_t
impl Unpin for fec_packet_t
impl UnwindSafe for fec_packet_t
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