trunk 20080912
[gitenigma.git] / include / lib / dvb / lowlevel / pmt.h
blobe0b99541f8f99992b99d55d831e40083ebbcc0bf
2 /*
3 * PROGRAM MAP TABLE
5 * Copyright (C) 1998 Thomas Mirlacher
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * The author may be reached as dent@cosy.sbg.ac.at, or
22 * Thomas Mirlacher, Jakob-Haringerstr. 2, A-5020 Salzburg,
23 * Austria
25 *------------------------------------------------------------
29 #ifndef __PMT_H__
30 #define __PMT_H__
32 #include <sys/types.h>
34 #define PMT_LEN 12
36 typedef struct pmt_struct {
37 u_char table_id : 8;
39 #if BYTE_ORDER == BIG_ENDIAN
40 u_char section_syntax_indicator : 1;
41 u_char dummy : 1; // has to be 0
42 u_char : 2;
43 u_char section_length_hi : 4;
44 #else
45 u_char section_length_hi : 4;
46 u_char : 2;
47 u_char dummy : 1; // has to be 0
48 u_char section_syntax_indicator : 1;
49 #endif
51 u_char section_length_lo : 8;
53 u_char program_number_hi : 8;
55 u_char program_number_lo : 8;
58 #if BYTE_ORDER == BIG_ENDIAN
59 u_char :2;
60 u_char version_number :5;
61 u_char current_next_indicator :1;
62 #else
63 u_char current_next_indicator :1;
64 u_char version_number :5;
65 u_char :2;
66 #endif
68 u_char section_number : 8;
70 u_char last_section_number : 8;
72 #if BYTE_ORDER == BIG_ENDIAN
73 u_char : 3;
74 u_char PCR_PID_hi : 5;
75 #else
76 u_char PCR_PID_hi : 5;
77 u_char : 3;
78 #endif
80 u_char PCR_PID_lo : 8;
82 #if BYTE_ORDER == BIG_ENDIAN
83 u_char : 4;
84 u_char program_info_length_hi : 4;
85 #else
86 u_char program_info_length_hi : 4;
87 u_char : 4;
88 #endif
90 u_char program_info_length_lo : 8;
91 //descriptors
92 } pmt_t;
94 #define PMT_info_LEN 5
96 typedef struct pmt_info_struct {
97 u_char stream_type : 8;
99 #if BYTE_ORDER == BIG_ENDIAN
100 u_char : 3;
101 u_char elementary_PID_hi : 5;
102 #else
103 u_char elementary_PID_hi : 5;
104 u_char : 3;
105 #endif
106 u_char elementary_PID_lo : 8;
108 #if BYTE_ORDER == BIG_ENDIAN
109 u_char : 4;
110 u_char ES_info_length_hi : 4;
111 #else
112 u_char ES_info_length_hi : 4;
113 u_char : 4;
114 #endif
116 u_char ES_info_length_lo : 8;
117 // descriptors
118 } pmt_info_t;
120 #endif