mpeg2ps/ps/
stream_table.rs1use crate::es::StreamId;
2use crate::Result;
3use bitfield::bitfield;
4use std::io::Read;
5
6bitfield! {
7 pub struct PsSystemHeaderStreamTable(MSB0 [u8]);
8 impl Debug;
9 pub u8, stream_id,set_stream_id: 7,0;
10 pub u8, one_one,_: 9,8;
11 pub bool,p_std_buffer_bound_scale,set_p_std_buffer_bound_scale: 10;
12 pub u16,p_std_buffer_size_bound,set_p_std_buffer_size_bound: 23,11;
13}
14
15impl PsSystemHeaderStreamTable<[u8; 3]> {
16 pub(super) fn read_from<R: Read>(mut reader: R) -> Result<Self> {
17 let mut buf = [0; 3];
18 reader.read_exact(&mut buf);
19 let system_header_stream_table = PsSystemHeaderStreamTable(buf);
20 Ok(system_header_stream_table)
21 }
22}