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,
25 *------------------------------------------------------------
32 #include <sys/types.h>
34 #define PS_SYSTEM_HDR_LEN 12
37 u_char header_length_hi
: 8;
38 u_char header_length_lo
: 8;
40 #if BYTE_ORDER == BIG_ENDIAN
42 u_char rate_bound_1
: 7;
44 u_char rate_bound_1
: 7;
48 u_char rate_bound_2
: 8;
50 #if BYTE_ORDER == BIG_ENDIAN
51 u_char rate_bound_3
: 7;
54 u_char audio_bound
: 6;
55 u_char fixed_flag
: 1;
58 u_char system_audio_lock_flag
: 1;
59 u_char system_video_lock_flag
: 1;
61 u_char video_bound
: 5;
63 u_char packet_rate_restriction_flag
: 1;
64 u_char reserved_byte
: 7;
67 u_char rate_bound_3
: 7;
70 u_char fixed_flag
: 1;
71 u_char audio_bound
: 6;
73 u_char video_bound
: 5;
75 u_char system_video_lock_flag
: 1;
76 u_char system_audio_lock_flag
: 1;
78 u_char reserved_byte
: 7;
79 u_char packet_rate_restriction_flag
: 1;
83 struct ps_system_hdr_2_struct
{
86 #if BYTE_ORDER == BIG_ENDIAN
87 u_char
: 2; // has to be 11
88 u_char PSTD_buffer_bound_scale
: 1;
89 u_char PSDT_buffer_size_bound_hi
: 5;
91 u_char PSDT_buffer_size_bound_hi
: 5;
92 u_char PSTD_buffer_bound_scale
: 1;
93 u_char
: 2; // has to be 11
96 u_char PSDT_buffer_size_bound_lo
: 8;
99 #define PS_STREAM_PACK_HDR 0xBA
100 #define PS_STREAM_SYSTEM_HDR 0xBB
101 #define PS_STREAM_VIDEO 0xE0
103 #if BYTE_ORDER == BIG_ENDIAN
104 #define PS_START_CODE_PREFIX_RAW 0x000010
106 #define PS_START_CODE_PREFIX_RAW 0x010000
109 #define PS_START_CODE_PREFIX 0x000010
114 u_int start_code_prefix
: 24;
115 u_char stream_id
: 8;
119 #if BYTE_ORDER == BIG_ENDIAN
120 u_char
: 2; // should be '01'
121 u_char system_clock_reference_1
: 3;
123 u_char system_clock_reference_2
: 2;
125 u_char system_clock_reference_2
: 2;
127 u_char system_clock_reference_1
: 3;
128 u_char
: 2; // should be '01'
131 u_char system_clock_reference_3
: 8;
133 #if BYTE_ORDER == BIG_ENDIAN
134 u_char system_clock_reference_4
: 5;
136 u_char system_clock_reference_5
: 2;
138 u_char system_clock_reference_5
: 2;
140 u_char system_clock_reference_4
: 5;
143 u_char system_clock_reference_6
: 8;
145 #if BYTE_ORDER == BIG_ENDIAN
146 u_char system_clock_reference_7
: 5;
148 u_char system_clock_reference_ext_1
: 2;
150 u_char system_clock_reference_ext_2
: 7;
153 u_char system_clock_reference_ext_1
: 2;
155 u_char system_clock_reference_7
: 5;
158 u_char system_clock_reference_ext_2
: 7;
161 u_char program_mux_rate_1
: 8;
162 u_char program_mux_rate_2
: 8;
164 #if BYTE_ORDER == BIG_ENDIAN
165 u_char program_mux_rate_3
: 6;
168 u_char
: 5; //reserved
169 u_char pack_stuffing_length
: 3;
172 u_char program_mux_rate_3
: 6;
174 u_char pack_stuffing_length
: 3;
175 u_char
: 5; //reserved
179 #define PS_PACK_LEN 10