Mercurial > libdvdread4.hg
annotate nav_print.c @ 16:26068a8f3927 src
Add missing include, fixes
libdvdread/src/nav_print.c:46: warning: implicit declaration of function ¡Ædvdread_print_time¡Ç
author | rathann |
---|---|
date | Sat, 30 Aug 2008 17:56:27 +0000 |
parents | 4e610984cc3f |
children | 5aeaa695eadb |
rev | line source |
---|---|
3 | 1 /* |
2 * Copyright (C) 2000, 2001, 2002, 2003 Håkan Hjort <d95hjort@dtek.chalmers.se> | |
3 * | |
4 * Much of the contents in this file is based on VOBDUMP. | |
5 * | |
6 * VOBDUMP: a program for examining DVD .VOB filse | |
7 * | |
8 * Copyright 1998, 1999 Eric Smith <eric@brouhaha.com> | |
9 * | |
10 * VOBDUMP is free software; you can redistribute it and/or modify it | |
11 * under the terms of the GNU General Public License version 2 as | |
12 * published by the Free Software Foundation. Note that I am not | |
13 * granting permission to redistribute or modify VOBDUMP under the | |
14 * terms of any later version of the General Public License. | |
15 * | |
16 * This program is distributed in the hope that it will be useful (or | |
17 * at least amusing), but WITHOUT ANY WARRANTY; without even the | |
18 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR | |
19 * PURPOSE. See the GNU General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU General Public License | |
22 * along with this program; if not, write to the Free Software | |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
24 */ | |
25 | |
26 #include "config.h" | |
27 | |
28 #include <stdio.h> | |
29 #include <inttypes.h> | |
30 | |
31 #include "nav_types.h" | |
32 #include "nav_print.h" | |
16 | 33 #include "ifo_print.h" |
3 | 34 #include "dvdread_internal.h" |
35 | |
36 static void navPrint_PCI_GI(pci_gi_t *pci_gi) { | |
37 int i; | |
38 | |
39 printf("pci_gi:\n"); | |
40 printf("nv_pck_lbn 0x%08x\n", pci_gi->nv_pck_lbn); | |
41 printf("vobu_cat 0x%04x\n", pci_gi->vobu_cat); | |
42 printf("vobu_uop_ctl 0x%08x\n", *(uint32_t*)&pci_gi->vobu_uop_ctl); | |
43 printf("vobu_s_ptm 0x%08x\n", pci_gi->vobu_s_ptm); | |
44 printf("vobu_e_ptm 0x%08x\n", pci_gi->vobu_e_ptm); | |
45 printf("vobu_se_e_ptm 0x%08x\n", pci_gi->vobu_se_e_ptm); | |
46 printf("e_eltm "); | |
13
4e610984cc3f
added dvdread_print_time() and removed the file-static print_time() in nav_print.c; based on a patch by Erik Hovland org
nicodvb
parents:
3
diff
changeset
|
47 dvdread_print_time(&pci_gi->e_eltm); |
3 | 48 printf("\n"); |
49 | |
50 printf("vobu_isrc \""); | |
51 for(i = 0; i < 32; i++) { | |
52 char c = pci_gi->vobu_isrc[i]; | |
53 if((c >= ' ') && (c <= '~')) | |
54 printf("%c", c); | |
55 else | |
56 printf("."); | |
57 } | |
58 printf("\"\n"); | |
59 } | |
60 | |
61 static void navPrint_NSML_AGLI(nsml_agli_t *nsml_agli) { | |
62 int i, j = 0; | |
63 | |
64 for(i = 0; i < 9; i++) | |
65 j |= nsml_agli->nsml_agl_dsta[i]; | |
66 if(j == 0) | |
67 return; | |
68 | |
69 printf("nsml_agli:\n"); | |
70 for(i = 0; i < 9; i++) | |
71 if(nsml_agli->nsml_agl_dsta[i]) | |
72 printf("nsml_agl_c%d_dsta 0x%08x\n", i + 1, | |
73 nsml_agli->nsml_agl_dsta[i]); | |
74 } | |
75 | |
76 static void navPrint_HL_GI(hl_gi_t *hl_gi, int *btngr_ns, int *btn_ns) { | |
77 | |
78 if((hl_gi->hli_ss & 0x03) == 0) | |
79 return; | |
80 | |
81 printf("hl_gi:\n"); | |
82 printf("hli_ss 0x%01x\n", hl_gi->hli_ss & 0x03); | |
83 printf("hli_s_ptm 0x%08x\n", hl_gi->hli_s_ptm); | |
84 printf("hli_e_ptm 0x%08x\n", hl_gi->hli_e_ptm); | |
85 printf("btn_se_e_ptm 0x%08x\n", hl_gi->btn_se_e_ptm); | |
86 | |
87 *btngr_ns = hl_gi->btngr_ns; | |
88 printf("btngr_ns %d\n", hl_gi->btngr_ns); | |
89 printf("btngr%d_dsp_ty 0x%02x\n", 1, hl_gi->btngr1_dsp_ty); | |
90 printf("btngr%d_dsp_ty 0x%02x\n", 2, hl_gi->btngr2_dsp_ty); | |
91 printf("btngr%d_dsp_ty 0x%02x\n", 3, hl_gi->btngr3_dsp_ty); | |
92 | |
93 printf("btn_ofn %d\n", hl_gi->btn_ofn); | |
94 *btn_ns = hl_gi->btn_ns; | |
95 printf("btn_ns %d\n", hl_gi->btn_ns); | |
96 printf("nsl_btn_ns %d\n", hl_gi->nsl_btn_ns); | |
97 printf("fosl_btnn %d\n", hl_gi->fosl_btnn); | |
98 printf("foac_btnn %d\n", hl_gi->foac_btnn); | |
99 } | |
100 | |
101 static void navPrint_BTN_COLIT(btn_colit_t *btn_colit) { | |
102 int i, j; | |
103 | |
104 j = 0; | |
105 for(i = 0; i < 6; i++) | |
106 j |= btn_colit->btn_coli[i/2][i&1]; | |
107 if(j == 0) | |
108 return; | |
109 | |
110 printf("btn_colit:\n"); | |
111 for(i = 0; i < 3; i++) | |
112 for(j = 0; j < 2; j++) | |
113 printf("btn_cqoli %d %s_coli: %08x\n", | |
114 i, (j == 0) ? "sl" : "ac", | |
115 btn_colit->btn_coli[i][j]); | |
116 } | |
117 | |
118 static void navPrint_BTNIT(btni_t *btni_table, int btngr_ns, int btn_ns) { | |
119 int i, j; | |
120 | |
121 printf("btnit:\n"); | |
122 printf("btngr_ns: %i\n", btngr_ns); | |
123 printf("btn_ns: %i\n", btn_ns); | |
124 | |
125 if(btngr_ns == 0) | |
126 return; | |
127 | |
128 for(i = 0; i < btngr_ns; i++) { | |
129 for(j = 0; j < (36 / btngr_ns); j++) { | |
130 if(j < btn_ns) { | |
131 btni_t *btni = &btni_table[(36 / btngr_ns) * i + j]; | |
132 | |
133 printf("group %d btni %d: ", i+1, j+1); | |
134 printf("btn_coln %d, auto_action_mode %d\n", | |
135 btni->btn_coln, btni->auto_action_mode); | |
136 printf("coords (%d, %d) .. (%d, %d)\n", | |
137 btni->x_start, btni->y_start, btni->x_end, btni->y_end); | |
138 | |
139 printf("up %d, ", btni->up); | |
140 printf("down %d, ", btni->down); | |
141 printf("left %d, ", btni->left); | |
142 printf("right %d\n", btni->right); | |
143 | |
144 /* ifoPrint_COMMAND(&btni->cmd); */ | |
145 printf("\n"); | |
146 } | |
147 } | |
148 } | |
149 } | |
150 | |
151 static void navPrint_HLI(hli_t *hli) { | |
152 int btngr_ns = 0, btn_ns = 0; | |
153 | |
154 printf("hli:\n"); | |
155 navPrint_HL_GI(&hli->hl_gi, & btngr_ns, & btn_ns); | |
156 navPrint_BTN_COLIT(&hli->btn_colit); | |
157 navPrint_BTNIT(hli->btnit, btngr_ns, btn_ns); | |
158 } | |
159 | |
160 void navPrint_PCI(pci_t *pci) { | |
161 printf("pci packet:\n"); | |
162 navPrint_PCI_GI(&pci->pci_gi); | |
163 navPrint_NSML_AGLI(&pci->nsml_agli); | |
164 navPrint_HLI(&pci->hli); | |
165 } | |
166 | |
167 static void navPrint_DSI_GI(dsi_gi_t *dsi_gi) { | |
168 printf("dsi_gi:\n"); | |
169 printf("nv_pck_scr 0x%08x\n", dsi_gi->nv_pck_scr); | |
170 printf("nv_pck_lbn 0x%08x\n", dsi_gi->nv_pck_lbn ); | |
171 printf("vobu_ea 0x%08x\n", dsi_gi->vobu_ea); | |
172 printf("vobu_1stref_ea 0x%08x\n", dsi_gi->vobu_1stref_ea); | |
173 printf("vobu_2ndref_ea 0x%08x\n", dsi_gi->vobu_2ndref_ea); | |
174 printf("vobu_3rdref_ea 0x%08x\n", dsi_gi->vobu_3rdref_ea); | |
175 printf("vobu_vob_idn 0x%04x\n", dsi_gi->vobu_vob_idn); | |
176 printf("vobu_c_idn 0x%02x\n", dsi_gi->vobu_c_idn); | |
177 printf("c_eltm "); | |
13
4e610984cc3f
added dvdread_print_time() and removed the file-static print_time() in nav_print.c; based on a patch by Erik Hovland org
nicodvb
parents:
3
diff
changeset
|
178 dvdread_print_time(&dsi_gi->c_eltm); |
3 | 179 printf("\n"); |
180 } | |
181 | |
182 static void navPrint_SML_PBI(sml_pbi_t *sml_pbi) { | |
183 printf("sml_pbi:\n"); | |
184 printf("category 0x%04x\n", sml_pbi->category); | |
185 if(sml_pbi->category & 0x8000) | |
186 printf("VOBU is in preunit\n"); | |
187 if(sml_pbi->category & 0x4000) | |
188 printf("VOBU is in ILVU\n"); | |
189 if(sml_pbi->category & 0x2000) | |
190 printf("VOBU at the beginning of ILVU\n"); | |
191 if(sml_pbi->category & 0x1000) | |
192 printf("VOBU at end of PREU of ILVU\n"); | |
193 | |
194 printf("ilvu_ea 0x%08x\n", sml_pbi->ilvu_ea); | |
195 printf("nxt_ilvu_sa 0x%08x\n", sml_pbi->ilvu_sa); | |
196 printf("nxt_ilvu_size 0x%04x\n", sml_pbi->size); | |
197 | |
198 printf("vob_v_s_s_ptm 0x%08x\n", sml_pbi->vob_v_s_s_ptm); | |
199 printf("vob_v_e_e_ptm 0x%08x\n", sml_pbi->vob_v_e_e_ptm); | |
200 | |
201 /* $$$ more code needed here */ | |
202 } | |
203 | |
204 static void navPrint_SML_AGLI(sml_agli_t *sml_agli) { | |
205 int i; | |
206 printf("sml_agli:\n"); | |
207 for(i = 0; i < 9; i++) { | |
208 printf("agl_c%d address: 0x%08x size 0x%04x\n", i, | |
209 sml_agli->data[i].address, sml_agli->data[i].size); | |
210 } | |
211 } | |
212 | |
213 static void navPrint_VOBU_SRI(vobu_sri_t *vobu_sri) { | |
214 int i; | |
215 int stime[19] = { 240, 120, 60, 20, 15, 14, 13, 12, 11, | |
216 10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; | |
217 printf("vobu_sri:\n"); | |
218 printf("Next VOBU with Video %08x\n", vobu_sri->next_video); | |
219 for(i = 0; i < 19; i++) { | |
220 printf("%3.1f %08x ", stime[i]/2.0, vobu_sri->fwda[i]); | |
221 } | |
222 printf("\n"); | |
223 printf("Next VOBU %08x\n", vobu_sri->next_vobu); | |
224 printf("--\n"); | |
225 printf("Prev VOBU %08x\n", vobu_sri->prev_vobu); | |
226 for(i = 0; i < 19; i++) { | |
227 printf("%3.1f %08x ", stime[18 - i]/2.0, vobu_sri->bwda[i]); | |
228 } | |
229 printf("\n"); | |
230 printf("Prev VOBU with Video %08x\n", vobu_sri->prev_video); | |
231 } | |
232 | |
233 static void navPrint_SYNCI(synci_t *synci) { | |
234 int i; | |
235 | |
236 printf("synci:\n"); | |
237 /* $$$ more code needed here */ | |
238 for(i = 0; i < 8; i++) | |
239 printf("%04x ", synci->a_synca[i]); | |
240 for(i = 0; i < 32; i++) | |
241 printf("%08x ", synci->sp_synca[i]); | |
242 } | |
243 | |
244 void navPrint_DSI(dsi_t *dsi) { | |
245 printf("dsi packet:\n"); | |
246 navPrint_DSI_GI(&dsi->dsi_gi); | |
247 navPrint_SML_PBI(&dsi->sml_pbi); | |
248 navPrint_SML_AGLI(&dsi->sml_agli); | |
249 navPrint_VOBU_SRI(&dsi->vobu_sri); | |
250 navPrint_SYNCI(&dsi->synci); | |
251 } | |
252 | |
253 |