libmpegts 0.3.2

MPEG-TS Library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use libmpegts::{
    psi::*,
    slicer::TsSlicer,
};
mod data;

#[test]
fn test_parse_tdt() {
    let mut psi = Psi::default();
    TsSlicer::new().slice(data::TDT).for_each(|p| {
        psi.assemble(&p);
    });

    let payload = psi.payload().expect("TDT section payload expected");
    let tdt = TdtSectionRef::try_from(payload).expect("Valid TDT section");

    assert_eq!(tdt.time(), 1547057412);
}