mpegts/parser/
table_id.rs

1
2use mpegts::table_id::*;
3
4pub fn get_table_id(table_id: u8) -> TableId {
5  match table_id {
6    0x00 => TableId::ProgramAssociation,
7    0x01 => TableId::ConditionalAccess,
8    0x02 => TableId::ProgramMap,
9    0x03 => TableId::TransportStreamDescription,
10    0x04 => TableId::IsoIec_14496_SceneDescription,
11    0x05 => TableId::IsoIec_14496_ObjectDescription,
12    0x06 => TableId::Metadata,
13    0x07 => TableId::IsoIec_13818_11_IpmpControlInformation,
14
15    0x3a => TableId::IsoIec_13818_6_DsmCc_MultiprotocolEncapsulated,
16    0x3b => TableId::IsoIec_13818_6_DsmCc_UNMessages,
17    0x3c => TableId::IsoIec_13818_6_DsmCc_DownloadDataMessages,
18    0x3d => TableId::IsoIec_13818_6_DsmCc_StreamDescriptorList,
19    0x3e => TableId::IsoIec_13818_6_DsmCc_PrivatelyDefined,
20    0x3f => TableId::IsoIec_13818_6_DsmCc_Addressable,
21    0xff => TableId::Forbidden,
22       _ => {
23      if (table_id >= 0x08) && (table_id <= 0x39) {
24        TableId::Reserved
25      } else {
26        TableId::Other
27      }
28    }
29  }
30}