Mercurial > mplayer.hg
annotate dvdread/nav_print.c @ 24016:92a75037c439
r23920: Teletext support (and editor's info)
patch by JRaSH (jrash06 163 com)
author | kraymer |
---|---|
date | Wed, 08 Aug 2007 19:33:26 +0000 |
parents | 22cb9d5f1e21 |
children | de28f9e8cb00 |
rev | line source |
---|---|
7029 | 1 /* |
15874 | 2 * Copyright (C) 2000, 2001, 2002, 2003 Håkan Hjort <d95hjort@dtek.chalmers.se> |
14938
25df9508f9a8
Mark modified files as such to comply more closely with GPL ¡ø2a.
diego
parents:
7033
diff
changeset
|
3 * |
7029 | 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 | |
15874 | 26 #include "config.h" |
27 | |
7029 | 28 #include <stdio.h> |
29 #include <inttypes.h> | |
30 | |
31 #include "nav_types.h" | |
32 #include "nav_print.h" | |
15874 | 33 #include "dvdread_internal.h" |
7029 | 34 |
35 static void print_time(dvd_time_t *dtime) { | |
36 const char *rate; | |
15874 | 37 CHECK_VALUE((dtime->hour>>4) < 0xa && (dtime->hour&0xf) < 0xa); |
38 CHECK_VALUE((dtime->minute>>4) < 0x7 && (dtime->minute&0xf) < 0xa); | |
39 CHECK_VALUE((dtime->second>>4) < 0x7 && (dtime->second&0xf) < 0xa); | |
40 CHECK_VALUE((dtime->frame_u&0xf) < 0xa); | |
7029 | 41 |
42 printf("%02x:%02x:%02x.%02x", | |
43 dtime->hour, | |
44 dtime->minute, | |
45 dtime->second, | |
46 dtime->frame_u & 0x3f); | |
47 switch((dtime->frame_u & 0xc0) >> 6) { | |
48 case 1: | |
49 rate = "25.00"; | |
50 break; | |
51 case 3: | |
52 rate = "29.97"; | |
53 break; | |
54 default: | |
55 rate = "(please send a bug report)"; | |
56 break; | |
57 } | |
58 printf(" @ %s fps", rate); | |
59 } | |
60 | |
61 | |
62 static void navPrint_PCI_GI(pci_gi_t *pci_gi) { | |
63 int i; | |
64 | |
65 printf("pci_gi:\n"); | |
66 printf("nv_pck_lbn 0x%08x\n", pci_gi->nv_pck_lbn); | |
67 printf("vobu_cat 0x%04x\n", pci_gi->vobu_cat); | |
68 printf("vobu_uop_ctl 0x%08x\n", *(uint32_t*)&pci_gi->vobu_uop_ctl); | |
69 printf("vobu_s_ptm 0x%08x\n", pci_gi->vobu_s_ptm); | |
70 printf("vobu_e_ptm 0x%08x\n", pci_gi->vobu_e_ptm); | |
71 printf("vobu_se_e_ptm 0x%08x\n", pci_gi->vobu_se_e_ptm); | |
72 printf("e_eltm "); | |
73 print_time(&pci_gi->e_eltm); | |
74 printf("\n"); | |
75 | |
76 printf("vobu_isrc \""); | |
77 for(i = 0; i < 32; i++) { | |
78 char c = pci_gi->vobu_isrc[i]; | |
79 if((c >= ' ') && (c <= '~')) | |
80 printf("%c", c); | |
81 else | |
82 printf("."); | |
83 } | |
84 printf("\"\n"); | |
85 } | |
86 | |
87 static void navPrint_NSML_AGLI(nsml_agli_t *nsml_agli) { | |
88 int i, j = 0; | |
89 | |
90 for(i = 0; i < 9; i++) | |
91 j |= nsml_agli->nsml_agl_dsta[i]; | |
92 if(j == 0) | |
93 return; | |
94 | |
95 printf("nsml_agli:\n"); | |
96 for(i = 0; i < 9; i++) | |
97 if(nsml_agli->nsml_agl_dsta[i]) | |
98 printf("nsml_agl_c%d_dsta 0x%08x\n", i + 1, | |
99 nsml_agli->nsml_agl_dsta[i]); | |
100 } | |
101 | |
102 static void navPrint_HL_GI(hl_gi_t *hl_gi, int *btngr_ns, int *btn_ns) { | |
103 | |
104 if((hl_gi->hli_ss & 0x03) == 0) | |
105 return; | |
106 | |
107 printf("hl_gi:\n"); | |
108 printf("hli_ss 0x%01x\n", hl_gi->hli_ss & 0x03); | |
109 printf("hli_s_ptm 0x%08x\n", hl_gi->hli_s_ptm); | |
110 printf("hli_e_ptm 0x%08x\n", hl_gi->hli_e_ptm); | |
111 printf("btn_se_e_ptm 0x%08x\n", hl_gi->btn_se_e_ptm); | |
112 | |
113 *btngr_ns = hl_gi->btngr_ns; | |
114 printf("btngr_ns %d\n", hl_gi->btngr_ns); | |
115 printf("btngr%d_dsp_ty 0x%02x\n", 1, hl_gi->btngr1_dsp_ty); | |
116 printf("btngr%d_dsp_ty 0x%02x\n", 2, hl_gi->btngr2_dsp_ty); | |
117 printf("btngr%d_dsp_ty 0x%02x\n", 3, hl_gi->btngr3_dsp_ty); | |
118 | |
119 printf("btn_ofn %d\n", hl_gi->btn_ofn); | |
120 *btn_ns = hl_gi->btn_ns; | |
121 printf("btn_ns %d\n", hl_gi->btn_ns); | |
122 printf("nsl_btn_ns %d\n", hl_gi->nsl_btn_ns); | |
123 printf("fosl_btnn %d\n", hl_gi->fosl_btnn); | |
124 printf("foac_btnn %d\n", hl_gi->foac_btnn); | |
125 } | |
126 | |
127 static void navPrint_BTN_COLIT(btn_colit_t *btn_colit) { | |
128 int i, j; | |
129 | |
130 j = 0; | |
131 for(i = 0; i < 6; i++) | |
132 j |= btn_colit->btn_coli[i/2][i&1]; | |
133 if(j == 0) | |
134 return; | |
135 | |
136 printf("btn_colit:\n"); | |
137 for(i = 0; i < 3; i++) | |
138 for(j = 0; j < 2; j++) | |
139 printf("btn_cqoli %d %s_coli: %08x\n", | |
140 i, (j == 0) ? "sl" : "ac", | |
141 btn_colit->btn_coli[i][j]); | |
142 } | |
143 | |
144 static void navPrint_BTNIT(btni_t *btni_table, int btngr_ns, int btn_ns) { | |
145 int i, j; | |
146 | |
147 printf("btnit:\n"); | |
148 printf("btngr_ns: %i\n", btngr_ns); | |
149 printf("btn_ns: %i\n", btn_ns); | |
150 | |
151 if(btngr_ns == 0) | |
152 return; | |
153 | |
154 for(i = 0; i < btngr_ns; i++) { | |
155 for(j = 0; j < (36 / btngr_ns); j++) { | |
156 if(j < btn_ns) { | |
157 btni_t *btni = &btni_table[(36 / btngr_ns) * i + j]; | |
158 | |
159 printf("group %d btni %d: ", i+1, j+1); | |
160 printf("btn_coln %d, auto_action_mode %d\n", | |
161 btni->btn_coln, btni->auto_action_mode); | |
162 printf("coords (%d, %d) .. (%d, %d)\n", | |
163 btni->x_start, btni->y_start, btni->x_end, btni->y_end); | |
164 | |
165 printf("up %d, ", btni->up); | |
166 printf("down %d, ", btni->down); | |
167 printf("left %d, ", btni->left); | |
168 printf("right %d\n", btni->right); | |
169 | |
170 // ifoPrint_COMMAND(&btni->cmd); | |
171 printf("\n"); | |
172 } | |
173 } | |
174 } | |
175 } | |
176 | |
177 static void navPrint_HLI(hli_t *hli) { | |
178 int btngr_ns = 0, btn_ns = 0; | |
179 | |
180 printf("hli:\n"); | |
181 navPrint_HL_GI(&hli->hl_gi, & btngr_ns, & btn_ns); | |
182 navPrint_BTN_COLIT(&hli->btn_colit); | |
183 navPrint_BTNIT(hli->btnit, btngr_ns, btn_ns); | |
184 } | |
185 | |
186 void navPrint_PCI(pci_t *pci) { | |
187 printf("pci packet:\n"); | |
188 navPrint_PCI_GI(&pci->pci_gi); | |
189 navPrint_NSML_AGLI(&pci->nsml_agli); | |
190 navPrint_HLI(&pci->hli); | |
191 } | |
192 | |
193 static void navPrint_DSI_GI(dsi_gi_t *dsi_gi) { | |
194 printf("dsi_gi:\n"); | |
195 printf("nv_pck_scr 0x%08x\n", dsi_gi->nv_pck_scr); | |
196 printf("nv_pck_lbn 0x%08x\n", dsi_gi->nv_pck_lbn ); | |
197 printf("vobu_ea 0x%08x\n", dsi_gi->vobu_ea); | |
198 printf("vobu_1stref_ea 0x%08x\n", dsi_gi->vobu_1stref_ea); | |
199 printf("vobu_2ndref_ea 0x%08x\n", dsi_gi->vobu_2ndref_ea); | |
200 printf("vobu_3rdref_ea 0x%08x\n", dsi_gi->vobu_3rdref_ea); | |
201 printf("vobu_vob_idn 0x%04x\n", dsi_gi->vobu_vob_idn); | |
202 printf("vobu_c_idn 0x%02x\n", dsi_gi->vobu_c_idn); | |
203 printf("c_eltm "); | |
204 print_time(&dsi_gi->c_eltm); | |
205 printf("\n"); | |
206 } | |
207 | |
208 static void navPrint_SML_PBI(sml_pbi_t *sml_pbi) { | |
209 printf("sml_pbi:\n"); | |
210 printf("category 0x%04x\n", sml_pbi->category); | |
211 if(sml_pbi->category & 0x8000) | |
212 printf("VOBU is in preunit\n"); | |
213 if(sml_pbi->category & 0x4000) | |
214 printf("VOBU is in ILVU\n"); | |
215 if(sml_pbi->category & 0x2000) | |
216 printf("VOBU at the beginning of ILVU\n"); | |
217 if(sml_pbi->category & 0x1000) | |
218 printf("VOBU at end of PREU of ILVU\n"); | |
219 | |
220 printf("ilvu_ea 0x%08x\n", sml_pbi->ilvu_ea); | |
221 printf("nxt_ilvu_sa 0x%08x\n", sml_pbi->ilvu_sa); | |
222 printf("nxt_ilvu_size 0x%04x\n", sml_pbi->size); | |
223 | |
224 printf("vob_v_s_s_ptm 0x%08x\n", sml_pbi->vob_v_s_s_ptm); | |
225 printf("vob_v_e_e_ptm 0x%08x\n", sml_pbi->vob_v_e_e_ptm); | |
226 | |
227 /* $$$ more code needed here */ | |
228 } | |
229 | |
230 static void navPrint_SML_AGLI(sml_agli_t *sml_agli) { | |
231 int i; | |
232 printf("sml_agli:\n"); | |
233 for(i = 0; i < 9; i++) { | |
234 printf("agl_c%d address: 0x%08x size 0x%04x\n", i, | |
235 sml_agli->data[i].address, sml_agli->data[i].size); | |
236 } | |
237 } | |
238 | |
239 static void navPrint_VOBU_SRI(vobu_sri_t *vobu_sri) { | |
240 int i; | |
241 int stime[19] = { 240, 120, 60, 20, 15, 14, 13, 12, 11, | |
242 10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; | |
243 printf("vobu_sri:\n"); | |
244 printf("Next VOBU with Video %08x\n", vobu_sri->next_video); | |
245 for(i = 0; i < 19; i++) { | |
246 printf("%3.1f %08x ", stime[i]/2.0, vobu_sri->fwda[i]); | |
247 } | |
248 printf("\n"); | |
249 printf("Next VOBU %08x\n", vobu_sri->next_vobu); | |
250 printf("--\n"); | |
251 printf("Prev VOBU %08x\n", vobu_sri->prev_vobu); | |
252 for(i = 0; i < 19; i++) { | |
253 printf("%3.1f %08x ", stime[18 - i]/2.0, vobu_sri->bwda[i]); | |
254 } | |
255 printf("\n"); | |
256 printf("Prev VOBU with Video %08x\n", vobu_sri->prev_video); | |
257 } | |
258 | |
259 static void navPrint_SYNCI(synci_t *synci) { | |
260 int i; | |
261 | |
262 printf("synci:\n"); | |
263 /* $$$ more code needed here */ | |
264 for(i = 0; i < 8; i++) | |
265 printf("%04x ", synci->a_synca[i]); | |
266 for(i = 0; i < 32; i++) | |
267 printf("%08x ", synci->sp_synca[i]); | |
268 } | |
269 | |
270 void navPrint_DSI(dsi_t *dsi) { | |
271 printf("dsi packet:\n"); | |
272 navPrint_DSI_GI(&dsi->dsi_gi); | |
273 navPrint_SML_PBI(&dsi->sml_pbi); | |
274 navPrint_SML_AGLI(&dsi->sml_agli); | |
275 navPrint_VOBU_SRI(&dsi->vobu_sri); | |
276 navPrint_SYNCI(&dsi->synci); | |
277 } | |
278 | |
279 |