pub struct PgsSegmentHeader {
pub segment_type: PgsSegmentType,
pub segment_length: u16,
pub presentation_timestamp: u32,
pub decoding_timestamp: u32,
}
Expand description
Struct representing the header of a PGS segment.
Fields§
§segment_type: PgsSegmentType
§segment_length: u16
The length of the segment (excluding the header).
presentation_timestamp: u32
The presentation timestamp (PTS) for the segment.
decoding_timestamp: u32
The decoding timestamp (DTS) for the segment.
Implementations§
Source§impl PgsSegmentHeader
impl PgsSegmentHeader
Sourcepub fn from_data(data: &[u8]) -> Result<PgsSegmentHeader>
pub fn from_data(data: &[u8]) -> Result<PgsSegmentHeader>
Parses a PgsSegmentHeader
from the provided raw data.
This function reads the necessary fields from the data buffer and constructs a PgsSegmentHeader
.
It checks the validity of the header, ensuring that the segment begins with the expected PG
marker.
§Parameters
data
: A slice of raw data representing the contents of the PGS segment header.
§Errors
Returns an error if the length of the data is less than the required header length or if the header is invalid.
§Returns
A PgsSegmentHeader
constructed from the provided data.
Trait Implementations§
Source§impl Debug for PgsSegmentHeader
impl Debug for PgsSegmentHeader
Auto Trait Implementations§
impl Freeze for PgsSegmentHeader
impl RefUnwindSafe for PgsSegmentHeader
impl Send for PgsSegmentHeader
impl Sync for PgsSegmentHeader
impl Unpin for PgsSegmentHeader
impl UnwindSafe for PgsSegmentHeader
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