kodi
nav_types.h
1 /*
2  * Copyright (C) 2000, 2001, 2002 HÃ¥kan Hjort <d95hjort@dtek.chalmers.se>
3  *
4  * SPDX-License-Identifier: GPL-2.0-only
5  * See LICENSES/README.md for more information.
6  *
7  * The data structures in this file should represent the layout of the
8  * pci and dsi packets as they are stored in the stream. Information
9  * found by reading the source to VOBDUMP is the base for the structure
10  * and names of these data types.
11  *
12  * VOBDUMP: a program for examining DVD .VOB files.
13  * Copyright 1998, 1999 Eric Smith <eric@brouhaha.com>
14  */
15 
16 #pragma once
17 
18 //#include <inttypes.h>
19 #include "ifo_types.h" /* only dvd_time_t, vm_cmd_t and user_ops_t */
20 
21 
22 #undef ATTRIBUTE_PACKED
23 #undef PRAGMA_PACK_BEGIN
24 #undef PRAGMA_PACK_END
25 
26 #if defined(__GNUC__)
27 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
28 #define ATTRIBUTE_PACKED __attribute__ ((packed))
29 #define PRAGMA_PACK 0
30 #endif
31 #endif
32 
33 #if !defined(ATTRIBUTE_PACKED)
34 #define ATTRIBUTE_PACKED
35 #define PRAGMA_PACK 1
36 #endif
37 
38 
39 /* The length including the substream id byte. */
40 #define PCI_BYTES 0x3d4
41 #define DSI_BYTES 0x3fa
42 
43 #define PS2_PCI_SUBSTREAM_ID 0x00
44 #define PS2_DSI_SUBSTREAM_ID 0x01
45 
46 /* Remove this */
47 #define DSI_START_BYTE 1031
48 
49 
50 #if PRAGMA_PACK
51 #pragma pack(1)
52 #endif
53 
54 
58 typedef struct {
59  uint32_t nv_pck_lbn;
60  uint16_t vobu_cat;
61  uint16_t zero1;
62  user_ops_t vobu_uop_ctl;
63  uint32_t vobu_s_ptm;
64  uint32_t vobu_e_ptm;
65  uint32_t vobu_se_e_ptm;
66  dvd_time_t e_eltm;
67  char vobu_isrc[32];
68 } ATTRIBUTE_PACKED pci_gi_t;
69 
73 typedef struct {
74  uint32_t nsml_agl_dsta[9];
75 } ATTRIBUTE_PACKED nsml_agli_t;
76 
86 typedef struct {
87  uint16_t hli_ss;
88  uint32_t hli_s_ptm;
89  uint32_t hli_e_ptm;
90  uint32_t btn_se_e_ptm;
91  unsigned int zero1 : 2;
92  unsigned int btngr_ns : 2;
93  unsigned int zero2 : 1;
94  unsigned int btngr1_dsp_ty : 3;
95  unsigned int zero3 : 1;
96  unsigned int btngr2_dsp_ty : 3;
97  unsigned int zero4 : 1;
98  unsigned int btngr3_dsp_ty : 3;
99  uint8_t btn_ofn;
100  uint8_t btn_ns;
101  uint8_t nsl_btn_ns;
102  uint8_t zero5;
103  uint8_t fosl_btnn;
104  uint8_t foac_btnn;
105 } ATTRIBUTE_PACKED hl_gi_t;
106 
107 
116 typedef struct {
117  uint32_t btn_coli[3][2];
118 } ATTRIBUTE_PACKED btn_colit_t;
119 
127 typedef struct {
128  unsigned int btn_coln : 2;
129  unsigned int x_start : 10;
130  unsigned int zero1 : 2;
131  unsigned int x_end : 10;
133  unsigned int auto_action_mode : 2;
134  unsigned int y_start : 10;
135  unsigned int zero2 : 2;
136  unsigned int y_end : 10;
138  unsigned int zero3 : 2;
139  unsigned int up : 6;
140  unsigned int zero4 : 2;
141  unsigned int down : 6;
142  unsigned int zero5 : 2;
143  unsigned int left : 6;
144  unsigned int zero6 : 2;
145  unsigned int right : 6;
146  vm_cmd_t cmd;
147 } ATTRIBUTE_PACKED btni_t;
148 
152 typedef struct {
153  hl_gi_t hl_gi;
154  btn_colit_t btn_colit;
155  btni_t btnit[36];
156 } ATTRIBUTE_PACKED hli_t;
157 
161 typedef struct {
162  pci_gi_t pci_gi;
163  nsml_agli_t nsml_agli;
164  hli_t hli;
165  uint8_t zero1[189];
166 } ATTRIBUTE_PACKED pci_t;
167 
168 
169 
170 
174 typedef struct {
175  uint32_t nv_pck_scr;
176  uint32_t nv_pck_lbn;
177  uint32_t vobu_ea;
178  uint32_t vobu_1stref_ea;
179  uint32_t vobu_2ndref_ea;
180  uint32_t vobu_3rdref_ea;
181  uint16_t vobu_vob_idn;
182  uint8_t zero1;
183  uint8_t vobu_c_idn;
184  dvd_time_t c_eltm;
185 } ATTRIBUTE_PACKED dsi_gi_t;
186 
190 typedef struct {
191  uint16_t category;
192  uint32_t ilvu_ea;
193  uint32_t ilvu_sa;
194  uint16_t size;
195  uint32_t vob_v_s_s_ptm;
196  uint32_t vob_v_e_e_ptm;
197  struct {
198  uint32_t stp_ptm1;
199  uint32_t stp_ptm2;
200  uint32_t gap_len1;
201  uint32_t gap_len2;
202  } vob_a[8];
203 } ATTRIBUTE_PACKED sml_pbi_t;
204 
208 typedef struct {
209  uint32_t address;
210  uint16_t size;
211 } ATTRIBUTE_PACKED sml_agl_data_t;
212 
216 typedef struct {
217  sml_agl_data_t data[9];
218 } ATTRIBUTE_PACKED sml_agli_t;
219 
223 typedef struct {
224  uint32_t next_video;
225  uint32_t fwda[19];
226  uint32_t next_vobu;
227  uint32_t prev_vobu;
228  uint32_t bwda[19];
229  uint32_t prev_video;
230 } ATTRIBUTE_PACKED vobu_sri_t;
231 
232 #define SRI_END_OF_CELL 0x3fffffff
233 
237 typedef struct {
238  uint16_t a_synca[8];
239  uint32_t sp_synca[32];
240 } ATTRIBUTE_PACKED synci_t;
241 
245 typedef struct {
246  dsi_gi_t dsi_gi;
247  sml_pbi_t sml_pbi;
248  sml_agli_t sml_agli;
249  vobu_sri_t vobu_sri;
250  synci_t synci;
251  uint8_t zero1[471];
252 } ATTRIBUTE_PACKED dsi_t;
253 
254 
255 #if PRAGMA_PACK
256 #pragma pack()
257 #endif
258 
uint16_t hli_ss
status, only low 2 bits 0: no buttons, 1: different 2: equal 3: equal except for button cmds ...
Definition: nav_types.h:87
unsigned int zero4
reserved
Definition: nav_types.h:97
unsigned int zero2
reserved
Definition: nav_types.h:93
unsigned int down
button index when pressing down
Definition: nav_types.h:141
uint8_t zero5
reserved
Definition: nav_types.h:102
uint32_t vobu_s_ptm
start presentation time of vobu
Definition: nav_types.h:63
uint32_t vobu_ea
end address of this VOBU
Definition: nav_types.h:177
unsigned int x_start
x start offset within the overlay
Definition: nav_types.h:129
unsigned int zero1
reserved
Definition: nav_types.h:91
unsigned int right
button index when pressing right
Definition: nav_types.h:145
uint32_t vobu_1stref_ea
end address of the 1st reference image
Definition: nav_types.h:178
unsigned int zero3
reserved
Definition: nav_types.h:95
uint32_t vobu_2ndref_ea
end address of the 2nd reference image
Definition: nav_types.h:179
uint16_t category
&#39;category&#39; of seamless VOBU
Definition: nav_types.h:191
unsigned int left
button index when pressing left
Definition: nav_types.h:143
unsigned int btngr1_dsp_ty
display type of subpic stream for button group 1
Definition: nav_types.h:94
uint32_t next_video
Next vobu that contains video.
Definition: nav_types.h:224
uint32_t vobu_3rdref_ea
end address of the 3rd reference image
Definition: nav_types.h:180
Common.
Definition: ifo_types.h:61
uint32_t hli_e_ptm
end ptm of hli
Definition: nav_types.h:89
uint32_t nv_pck_lbn
sector address of this nav pack
Definition: nav_types.h:59
unsigned int x_end
x end offset within the overlay
Definition: nav_types.h:131
uint32_t vobu_se_e_ptm
end ptm of sequence end in vobu
Definition: nav_types.h:65
unsigned int y_start
y start offset within the overlay
Definition: nav_types.h:134
uint8_t nsl_btn_ns
number of buttons selectable by U_BTNNi (low 6 bits) nsl_btn_ns <= btn_ns
Definition: nav_types.h:101
uint32_t ilvu_sa
start address of next interleaved unit
Definition: nav_types.h:193
user_ops_t vobu_uop_ctl
UOP of vobu.
Definition: nav_types.h:62
uint8_t btn_ofn
button offset number range 0-255
Definition: nav_types.h:99
unsigned int y_end
y end offset within the overlay
Definition: nav_types.h:136
unsigned int btngr2_dsp_ty
display type of subpic stream for button group 2
Definition: nav_types.h:96
uint32_t vobu_e_ptm
end presentation time of vobu
Definition: nav_types.h:64
unsigned int zero5
reserved
Definition: nav_types.h:142
uint32_t vob_v_e_e_ptm
video end ptm in vob
Definition: nav_types.h:196
unsigned int btn_coln
button color number
Definition: nav_types.h:128
uint8_t foac_btnn
forcedly activated button (low 6 bits)
Definition: nav_types.h:104
uint32_t hli_s_ptm
start ptm of hli
Definition: nav_types.h:88
uint32_t ilvu_ea
end address of interleaved Unit
Definition: nav_types.h:192
uint8_t fosl_btnn
forcedly selected button (low 6 bits)
Definition: nav_types.h:103
unsigned int zero6
reserved
Definition: nav_types.h:144
uint32_t vob_v_s_s_ptm
video start ptm in vob
Definition: nav_types.h:195
unsigned int auto_action_mode
0: no, 1: activated if selected
Definition: nav_types.h:133
unsigned int btngr3_dsp_ty
display type of subpic stream for button group 3
Definition: nav_types.h:98
unsigned int up
button index when pressing up
Definition: nav_types.h:139
uint8_t vobu_c_idn
Cell Id number that this VOBU is part of.
Definition: nav_types.h:183
uint32_t address
offset to next ILVU, high bit is before/after
Definition: nav_types.h:209
uint8_t btn_ns
number of valid buttons <= 36/18/12 (low 6 bits)
Definition: nav_types.h:100
uint16_t vobu_vob_idn
VOB Id number that this VOBU is part of.
Definition: nav_types.h:181
unsigned int btngr_ns
number of button groups 1, 2 or 3 with 36/18/12 buttons
Definition: nav_types.h:92
uint16_t vobu_cat
&#39;category&#39; of vobu
Definition: nav_types.h:60
dvd_time_t e_eltm
Cell elapsed time.
Definition: nav_types.h:66
uint16_t zero1
reserved
Definition: nav_types.h:61
uint32_t btn_se_e_ptm
end ptm of button select
Definition: nav_types.h:90
dvd_time_t c_eltm
Cell elapsed time.
Definition: nav_types.h:184
uint16_t size
size of next interleaved unit
Definition: nav_types.h:194