📄 dvb_str.c
字号:
/*$Id: dvb_str.c,v 1.65 2005/08/10 21:28:19 rasc Exp $ DVBSNOOP a dvb sniffer and mpeg2 stream analyzer tool http://dvbsnoop.sourceforge.net/ (c) 2001-2004 Rainer.Scherg@gmx.de -- DVB-Strings -- dvb decoder helper functions$Log: dvb_str.c,v $Revision 1.65 2005/08/10 21:28:19 rascNew: Program Stream handling (-s ps)Revision 1.64 2005/07/18 21:11:40 rascTVA Content SectionRevision 1.63 2005/01/17 19:41:24 rascBugfix: data broadcast descriptor (tnx to Sergio SAGLIOCCO, SecureLAB)Revision 1.62 2004/09/01 20:20:34 rascnew cmdline option: -buffersize KB (set demux buffersize in KBytes)Revision 1.61 2004/08/25 21:33:41 rascsmall fix: Priority wrong in Terr. Sys Delivery descriptorRevision 1.60 2004/08/25 19:51:09 rasc - Update: EN 300 468 v1.6.1 Terrestrial delivery system descriptorRevision 1.59 2004/08/24 21:30:24 rascmore MetadataRevision 1.58 2004/08/13 11:05:29 rascMetadata_STD_descriptorRevision 1.57 2004/08/13 01:15:54 rascsmall change in PID assignment displayRevision 1.56 2004/08/12 22:57:19 rasc - New: MPEG Content Labeling descriptor (H.222.0 AMD1) - New: PES update ITU-T H.222.0 AMD2H.222.0 AMD3 updates startedRevision 1.55 2004/08/01 21:33:09 rascminor TVA stuff (TS 102 323)Revision 1.54 2004/07/26 20:58:03 rascRNT completed.. (TS 102 323)Revision 1.53 2004/07/25 20:12:59 rasc - New: content_identifier_descriptor (TS 102 323) - New: TVA_id_descriptor (TS 102 323) - New: related_content_descriptor (TS 102 323) - New: default_authority_descriptor (TS 102 323)Revision 1.52 2004/07/24 11:44:45 rascEN 301 192 update - New: ECM_repetition_rate_descriptor (EN 301 192 v1.4.1) - New: time_slice_fec_identifier_descriptor (EN 301 192 v1.4.1) - New: Section MPE_FEC EN 301 192 v1.4 - BugfixesRevision 1.51 2004/04/15 10:53:22 rascminor changesRevision 1.50 2004/04/05 17:32:13 rascmass typo fix adaption --> adaptationRevision 1.49 2004/03/31 21:14:23 rascNew: Spider section pids (snoop referenced section pids),some minor changesRevision 1.48 2004/03/21 00:37:47 rascQuery FrontEnd Info (option: -s feinfo)Revision 1.47 2004/03/10 21:05:53 rascWSS (Wide Screen Signalling) data decodingRevision 1.46 2004/03/09 20:59:23 rascVPS decoding (someone check the NPP & PTY code output please...)Revision 1.45 2004/02/15 18:58:31 rascDSM-CC data/object carousell continued (DSI, DII, DDB, DCancel)Revision 1.44 2004/02/12 21:21:22 rascMHP AIT descriptorssome smaller changesRevision 1.43 2004/02/09 22:57:01 rascBugfix VBI Data descriptorRevision 1.42 2004/02/09 21:25:01 rascAIT descriptorsminor redesign on output routinesRevision 1.41 2004/02/04 22:36:29 rascmore EBU/teletext stuffRevision 1.40 2004/02/02 23:34:11 rasc- output indent changed to avoid \r (which sucks on logged output)- EBU PES data started (teletext, vps, wss, ...)- bugfix: PES synch. data stream- some other stuffRevision 1.39 2004/01/25 21:37:28 rascbugfixes, minor changes & enhancmentsRevision 1.38 2004/01/12 22:49:53 rascget rid of stream descriptor moduleRevision 1.37 2004/01/11 22:49:41 rascPES restructuredRevision 1.36 2004/01/06 14:06:10 rascno messageRevision 1.35 2004/01/06 03:13:25 rascTS prints PES/Section ID on payload_startRevision 1.34 2004/01/05 02:03:42 rascno messageRevision 1.33 2004/01/01 20:09:40 rascDSM-CC INT/UNT descriptorsPES-sync changed, TS sync changed,descriptor scopeother changesRevision 1.32 2003/12/30 14:05:38 rascjust some annotations, so I do not forget these over Sylvester party...(some alkohol may reformat parts of /devbrain/0 ... )cheers!Revision 1.31 2003/12/28 00:01:15 rascsome minor changes/adds...Revision 1.30 2003/12/27 18:17:18 rascdsmcc PES dsmcc_program_stream_descriptorlistRevision 1.29 2003/12/27 00:21:17 rascdsmcc section tablesRevision 1.28 2003/11/26 19:55:34 rascno messageRevision 1.27 2003/11/25 00:17:11 rasc-sync option, some TS and PES stuff;dsm_addr inactive, may be wrong - due to missing ISO 13818-6Revision 1.26 2003/11/24 23:52:18 rasc-sync option, some TS and PES stuff;dsm_addr inactive, may be wrong - due to missing ISO 13818-6Revision 1.25 2003/11/24 14:16:07 obi- corrected transport scrambling control bits according to ETSI ETR 289- fixed lots of broken stringsRevision 1.24 2003/11/09 20:48:35 rascpes data packet (DSM-CC)Revision 1.23 2003/11/07 16:33:32 rascno messageRevision 1.22 2003/11/01 21:40:28 rascsome broadcast/linkage descriptor stuffRevision 1.21 2003/10/29 20:54:57 rascmore PES stuff, DSM descriptors, testdataRevision 1.20 2003/10/27 22:43:50 rasccarousel info descriptor and moreRevision 1.19 2003/10/26 23:00:43 rascfixRevision 1.18 2003/10/25 19:11:50 rascno messageRevision 1.17 2003/10/21 19:54:43 rascno messageRevision 1.16 2003/10/19 22:22:57 rasc- some datacarousell stuff startedRevision 1.15 2003/10/19 21:05:53 rasc- some datacarousell stuff startedRevision 1.14 2003/10/19 13:54:25 rasc-more table decodingRevision 1.13 2003/10/17 19:04:11 rasc- started more work on newer ISO 13818 descriptors- some reorg/update work startedRevision 1.12 2003/10/17 18:16:54 rasc- started more work on newer ISO 13818 descriptors- some reorg work startedRevision 1.11 2003/10/16 19:02:28 rascsome updates to dvbsnoop...- small bugfixes- tables updates from ETR 162Revision 1.10 2003/07/08 19:59:50 rascrestructuring... some new, some fixes,trying to include DSM-CC, Well someone a ISO13818-6 and latest version of ISO 18313-1 to spare?Revision 1.9 2003/06/24 23:51:03 rascbugfixes and enhancementsRevision 1.8 2002/08/17 20:36:12 obino more compiler warningsRevision 1.7 2001/12/07 22:17:20 rascno messageRevision 1.6 2001/12/06 15:33:18 rascsome small work on pespacket.cRevision 1.5 2001/12/01 12:34:17 rascpespacket weitergestrickt, leider z.Zt. zuwenig Zeit um es richtig fertig zu machen.Revision 1.4 2001/10/06 18:19:18 ToerliSteuerzeichen entfernt. rasc wuerdest du mal bitte nen gescheiten unix-konformen Editor verwenden... windows editoren sind ungeeignetRevision 1.3 2001/10/05 17:43:37 rasctypo...Revision 1.2 2001/10/02 21:52:44 rasc- init der time_delta- PES erweitert, PES arbeitet im read() noch nicht richtig!!- muss tmbinc fragem, ob ich Mist baue, oder der Treiber (??)Revision 1.1 2001/09/30 13:05:20 rascdvbsnoop v0.7 -- Commit to CVS*/#include "dvbsnoop.h"#include "dvb_str.h"#include "strtable_misc.h"/* -- PID assignment*/char *dvbstrPID_assignment (u_int id){ STR_TABLE TableIDs[] = { { 0x0000, 0x0000, "ISO 13818-1 Program Association Table (PAT)" }, { 0x0001, 0x0001, "ISO 13818-1 Conditional Access Table (CAT)" }, { 0x0002, 0x0002, "ISO 13818-1 Transport Stream Description Table (TSDT)" }, { 0x0003, 0x0003, "ISO 13818-11 IPMP Control Information " }, { 0x0004, 0x000F, "" }, { 0x0010, 0x0010, "DVB Network Information Table (NIT), Stuffing Table (ST)" }, { 0x0011, 0x0011, "DVB Service Description Table (SDT), Bouquet Association Table (BAT)" }, { 0x0012, 0x0012, "DVB Event Information Table (EIT)" }, { 0x0013, 0x0013, "DVB Running Status Table (RST)" }, { 0x0014, 0x0014, "DVB Time and Date Table (TDT), Time Offset Table (TOT)" }, { 0x0015, 0x0015, "DVB Network Synchronization" }, { 0x0016, 0x0016, "TV ANYTIME Resolution Notification Table (RNT)" }, { 0x0017, 0x001B, "" }, { 0x001C, 0x001C, "DVB Inband Signalling" }, { 0x001D, 0x001D, "DVB Measurement" }, { 0x001E, 0x001E, "DVB Discontinuity Information Table (DIT)" }, { 0x001F, 0x001F, "DVB Selection Information Table (SIT)" }, // $$$ TODO ATSC Pid assignment { 0x0020, 0x1FFE, "" }, { 0x1FFF, 0x1FFF, "Null Packet" }, { 0,0, NULL } }; return findTableID (TableIDs, id);}/* -- Table IDs (sections) ETSI EN 468 5.2 EN 301 192 TR 102 006 RE 101 202 ISO 13818-1 TS 102 323*/char *dvbstrTableID (u_int id){ STR_TABLE TableIDs[] = { // updated -- 2003-11-04 // -- updated 2004-07-26 from ITU-T Rec H.222.0 | ISO/IEC 13818-1:2000/FDAM 1 // -- updated 2004-08-12 from ITU-T Rec H.222.0 AMD2 // ATSC Table IDs could be included... { 0x00, 0x00, "Program Association Table (PAT)" }, { 0x01, 0x01, "Conditional Access Table (CAT)" }, { 0x02, 0x02, "Program Map Table (PMT)" }, { 0x03, 0x03, "Transport Stream Description Table (TSDT)" }, { 0x04, 0x04, "ISO_IEC_14496_scene_description_section" }, /* $$$ TODO */ { 0x05, 0x05, "ISO_IEC_14496_object_description_section" }, /* $$$ TODO */ { 0x06, 0x06, "Metadata Table" }, // $$$ TODO H.222.0 AMD1 { 0x07, 0x07, "IPMP_Control_Information_section (ISO 13818-11)" }, // $$$ TODO H.222.0 AMD1 { 0x08, 0x37, "ITU-T Rec. H.222.0|ISO/IEC13818 reserved" }, { 0x38, 0x39, "ISO/IEC 13818-6 reserved" }, { 0x3a, 0x3a, "DSM-CC - multiprotocol encapsulated data" }, { 0x3b, 0x3b, "DSM-CC - U-N messages (DSI or DII)" }, { 0x3c, 0x3c, "DSM-CC - Download Data Messages (DDB)" }, /* TR 101 202 */ { 0x3d, 0x3d, "DSM-CC - stream descriptorlist" }, { 0x3e, 0x3e, "DSM-CC - private data section // DVB datagram" }, /* EN 301 192 // ISO 13818-6 */ { 0x3f, 0x3f, "ISO/IEC 13818-6 reserved" }, { 0x40, 0x40, "Network Information Table (NIT) - actual network" }, { 0x41, 0x41, "Network Information Table (NIT) - other network" }, { 0x42, 0x42, "Service Description Table (SDT) - actual transport stream" }, { 0x43, 0x45, "reserved" }, { 0x46, 0x46, "Service Description Table (SDT) - other transport stream" }, { 0x47, 0x49, "reserved" },
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -