Mercurial > libdvdread4.hg
annotate nav_print.c @ 21:4aa618ae094f src
Use consistent license headers everywhere: Fix FSF address and boilerplate.
| author | diego |
|---|---|
| date | Sun, 14 Sep 2008 15:42:49 +0000 |
| parents | fce16251755c |
| children | 447c5319a522 |
| 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 | |
|
21
4aa618ae094f
Use consistent license headers everywhere: Fix FSF address and boilerplate.
diego
parents:
20
diff
changeset
|
22 * along with this program; if not, write to the Free Software Foundation, |
|
4aa618ae094f
Use consistent license headers everywhere: Fix FSF address and boilerplate.
diego
parents:
20
diff
changeset
|
23 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 3 | 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 |
| 35 static void navPrint_PCI_GI(pci_gi_t *pci_gi) { | |
| 36 int i; | |
| 37 | |
| 38 printf("pci_gi:\n"); | |
| 39 printf("nv_pck_lbn 0x%08x\n", pci_gi->nv_pck_lbn); | |
| 40 printf("vobu_cat 0x%04x\n", pci_gi->vobu_cat); | |
| 41 printf("vobu_uop_ctl 0x%08x\n", *(uint32_t*)&pci_gi->vobu_uop_ctl); | |
| 42 printf("vobu_s_ptm 0x%08x\n", pci_gi->vobu_s_ptm); | |
| 43 printf("vobu_e_ptm 0x%08x\n", pci_gi->vobu_e_ptm); | |
| 44 printf("vobu_se_e_ptm 0x%08x\n", pci_gi->vobu_se_e_ptm); | |
| 45 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
|
46 dvdread_print_time(&pci_gi->e_eltm); |
| 3 | 47 printf("\n"); |
| 20 | 48 |
| 3 | 49 printf("vobu_isrc \""); |
| 50 for(i = 0; i < 32; i++) { | |
| 51 char c = pci_gi->vobu_isrc[i]; | |
| 52 if((c >= ' ') && (c <= '~')) | |
| 53 printf("%c", c); | |
| 54 else | |
| 55 printf("."); | |
| 56 } | |
| 57 printf("\"\n"); | |
| 58 } | |
| 59 | |
| 60 static void navPrint_NSML_AGLI(nsml_agli_t *nsml_agli) { | |
| 61 int i, j = 0; | |
| 20 | 62 |
| 3 | 63 for(i = 0; i < 9; i++) |
| 64 j |= nsml_agli->nsml_agl_dsta[i]; | |
| 65 if(j == 0) | |
| 66 return; | |
| 20 | 67 |
| 3 | 68 printf("nsml_agli:\n"); |
| 69 for(i = 0; i < 9; i++) | |
| 70 if(nsml_agli->nsml_agl_dsta[i]) | |
| 20 | 71 printf("nsml_agl_c%d_dsta 0x%08x\n", i + 1, |
| 3 | 72 nsml_agli->nsml_agl_dsta[i]); |
| 73 } | |
| 74 | |
| 75 static void navPrint_HL_GI(hl_gi_t *hl_gi, int *btngr_ns, int *btn_ns) { | |
| 20 | 76 |
| 3 | 77 if((hl_gi->hli_ss & 0x03) == 0) |
| 78 return; | |
| 20 | 79 |
| 3 | 80 printf("hl_gi:\n"); |
| 81 printf("hli_ss 0x%01x\n", hl_gi->hli_ss & 0x03); | |
| 82 printf("hli_s_ptm 0x%08x\n", hl_gi->hli_s_ptm); | |
| 83 printf("hli_e_ptm 0x%08x\n", hl_gi->hli_e_ptm); | |
| 84 printf("btn_se_e_ptm 0x%08x\n", hl_gi->btn_se_e_ptm); | |
| 85 | |
| 86 *btngr_ns = hl_gi->btngr_ns; | |
| 87 printf("btngr_ns %d\n", hl_gi->btngr_ns); | |
| 88 printf("btngr%d_dsp_ty 0x%02x\n", 1, hl_gi->btngr1_dsp_ty); | |
| 89 printf("btngr%d_dsp_ty 0x%02x\n", 2, hl_gi->btngr2_dsp_ty); | |
| 90 printf("btngr%d_dsp_ty 0x%02x\n", 3, hl_gi->btngr3_dsp_ty); | |
| 20 | 91 |
| 3 | 92 printf("btn_ofn %d\n", hl_gi->btn_ofn); |
| 93 *btn_ns = hl_gi->btn_ns; | |
| 94 printf("btn_ns %d\n", hl_gi->btn_ns); | |
| 95 printf("nsl_btn_ns %d\n", hl_gi->nsl_btn_ns); | |
| 96 printf("fosl_btnn %d\n", hl_gi->fosl_btnn); | |
| 97 printf("foac_btnn %d\n", hl_gi->foac_btnn); | |
| 98 } | |
| 99 | |
| 100 static void navPrint_BTN_COLIT(btn_colit_t *btn_colit) { | |
| 101 int i, j; | |
| 20 | 102 |
| 3 | 103 j = 0; |
| 104 for(i = 0; i < 6; i++) | |
| 105 j |= btn_colit->btn_coli[i/2][i&1]; | |
| 106 if(j == 0) | |
| 107 return; | |
| 20 | 108 |
| 3 | 109 printf("btn_colit:\n"); |
| 110 for(i = 0; i < 3; i++) | |
| 111 for(j = 0; j < 2; j++) | |
| 112 printf("btn_cqoli %d %s_coli: %08x\n", | |
| 113 i, (j == 0) ? "sl" : "ac", | |
| 114 btn_colit->btn_coli[i][j]); | |
| 115 } | |
| 116 | |
| 117 static void navPrint_BTNIT(btni_t *btni_table, int btngr_ns, int btn_ns) { | |
| 118 int i, j; | |
| 20 | 119 |
| 3 | 120 printf("btnit:\n"); |
| 121 printf("btngr_ns: %i\n", btngr_ns); | |
| 122 printf("btn_ns: %i\n", btn_ns); | |
| 20 | 123 |
| 3 | 124 if(btngr_ns == 0) |
| 125 return; | |
| 20 | 126 |
| 3 | 127 for(i = 0; i < btngr_ns; i++) { |
| 128 for(j = 0; j < (36 / btngr_ns); j++) { | |
| 129 if(j < btn_ns) { | |
| 130 btni_t *btni = &btni_table[(36 / btngr_ns) * i + j]; | |
| 20 | 131 |
| 3 | 132 printf("group %d btni %d: ", i+1, j+1); |
| 133 printf("btn_coln %d, auto_action_mode %d\n", | |
| 134 btni->btn_coln, btni->auto_action_mode); | |
| 135 printf("coords (%d, %d) .. (%d, %d)\n", | |
| 136 btni->x_start, btni->y_start, btni->x_end, btni->y_end); | |
| 20 | 137 |
| 3 | 138 printf("up %d, ", btni->up); |
| 139 printf("down %d, ", btni->down); | |
| 140 printf("left %d, ", btni->left); | |
| 141 printf("right %d\n", btni->right); | |
| 20 | 142 |
| 3 | 143 /* ifoPrint_COMMAND(&btni->cmd); */ |
| 144 printf("\n"); | |
| 145 } | |
| 146 } | |
| 147 } | |
| 148 } | |
| 149 | |
| 150 static void navPrint_HLI(hli_t *hli) { | |
| 151 int btngr_ns = 0, btn_ns = 0; | |
| 20 | 152 |
| 3 | 153 printf("hli:\n"); |
| 154 navPrint_HL_GI(&hli->hl_gi, & btngr_ns, & btn_ns); | |
| 155 navPrint_BTN_COLIT(&hli->btn_colit); | |
| 156 navPrint_BTNIT(hli->btnit, btngr_ns, btn_ns); | |
| 157 } | |
| 158 | |
| 159 void navPrint_PCI(pci_t *pci) { | |
| 160 printf("pci packet:\n"); | |
| 161 navPrint_PCI_GI(&pci->pci_gi); | |
| 162 navPrint_NSML_AGLI(&pci->nsml_agli); | |
| 163 navPrint_HLI(&pci->hli); | |
| 164 } | |
| 165 | |
| 166 static void navPrint_DSI_GI(dsi_gi_t *dsi_gi) { | |
| 167 printf("dsi_gi:\n"); | |
| 168 printf("nv_pck_scr 0x%08x\n", dsi_gi->nv_pck_scr); | |
| 169 printf("nv_pck_lbn 0x%08x\n", dsi_gi->nv_pck_lbn ); | |
| 170 printf("vobu_ea 0x%08x\n", dsi_gi->vobu_ea); | |
| 171 printf("vobu_1stref_ea 0x%08x\n", dsi_gi->vobu_1stref_ea); | |
| 172 printf("vobu_2ndref_ea 0x%08x\n", dsi_gi->vobu_2ndref_ea); | |
| 173 printf("vobu_3rdref_ea 0x%08x\n", dsi_gi->vobu_3rdref_ea); | |
| 174 printf("vobu_vob_idn 0x%04x\n", dsi_gi->vobu_vob_idn); | |
| 175 printf("vobu_c_idn 0x%02x\n", dsi_gi->vobu_c_idn); | |
| 176 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
|
177 dvdread_print_time(&dsi_gi->c_eltm); |
| 3 | 178 printf("\n"); |
| 179 } | |
| 180 | |
| 181 static void navPrint_SML_PBI(sml_pbi_t *sml_pbi) { | |
| 182 printf("sml_pbi:\n"); | |
| 183 printf("category 0x%04x\n", sml_pbi->category); | |
| 184 if(sml_pbi->category & 0x8000) | |
| 185 printf("VOBU is in preunit\n"); | |
| 186 if(sml_pbi->category & 0x4000) | |
| 187 printf("VOBU is in ILVU\n"); | |
| 188 if(sml_pbi->category & 0x2000) | |
| 189 printf("VOBU at the beginning of ILVU\n"); | |
| 190 if(sml_pbi->category & 0x1000) | |
| 191 printf("VOBU at end of PREU of ILVU\n"); | |
| 20 | 192 |
| 3 | 193 printf("ilvu_ea 0x%08x\n", sml_pbi->ilvu_ea); |
| 194 printf("nxt_ilvu_sa 0x%08x\n", sml_pbi->ilvu_sa); | |
| 195 printf("nxt_ilvu_size 0x%04x\n", sml_pbi->size); | |
| 20 | 196 |
| 3 | 197 printf("vob_v_s_s_ptm 0x%08x\n", sml_pbi->vob_v_s_s_ptm); |
| 198 printf("vob_v_e_e_ptm 0x%08x\n", sml_pbi->vob_v_e_e_ptm); | |
| 20 | 199 |
| 3 | 200 /* $$$ more code needed here */ |
| 201 } | |
| 202 | |
| 203 static void navPrint_SML_AGLI(sml_agli_t *sml_agli) { | |
| 204 int i; | |
| 205 printf("sml_agli:\n"); | |
| 206 for(i = 0; i < 9; i++) { | |
| 207 printf("agl_c%d address: 0x%08x size 0x%04x\n", i, | |
| 208 sml_agli->data[i].address, sml_agli->data[i].size); | |
| 209 } | |
| 210 } | |
| 211 | |
| 212 static void navPrint_VOBU_SRI(vobu_sri_t *vobu_sri) { | |
| 213 int i; | |
| 20 | 214 int stime[19] = { 240, 120, 60, 20, 15, 14, 13, 12, 11, |
| 3 | 215 10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; |
| 216 printf("vobu_sri:\n"); | |
| 217 printf("Next VOBU with Video %08x\n", vobu_sri->next_video); | |
| 218 for(i = 0; i < 19; i++) { | |
| 219 printf("%3.1f %08x ", stime[i]/2.0, vobu_sri->fwda[i]); | |
| 220 } | |
| 221 printf("\n"); | |
| 222 printf("Next VOBU %08x\n", vobu_sri->next_vobu); | |
| 223 printf("--\n"); | |
| 224 printf("Prev VOBU %08x\n", vobu_sri->prev_vobu); | |
| 225 for(i = 0; i < 19; i++) { | |
| 226 printf("%3.1f %08x ", stime[18 - i]/2.0, vobu_sri->bwda[i]); | |
| 227 } | |
| 228 printf("\n"); | |
| 229 printf("Prev VOBU with Video %08x\n", vobu_sri->prev_video); | |
| 230 } | |
| 231 | |
| 232 static void navPrint_SYNCI(synci_t *synci) { | |
| 233 int i; | |
| 20 | 234 |
| 3 | 235 printf("synci:\n"); |
| 236 /* $$$ more code needed here */ | |
| 237 for(i = 0; i < 8; i++) | |
| 238 printf("%04x ", synci->a_synca[i]); | |
| 239 for(i = 0; i < 32; i++) | |
| 240 printf("%08x ", synci->sp_synca[i]); | |
| 241 } | |
| 242 | |
| 243 void navPrint_DSI(dsi_t *dsi) { | |
| 244 printf("dsi packet:\n"); | |
| 245 navPrint_DSI_GI(&dsi->dsi_gi); | |
| 246 navPrint_SML_PBI(&dsi->sml_pbi); | |
| 247 navPrint_SML_AGLI(&dsi->sml_agli); | |
| 248 navPrint_VOBU_SRI(&dsi->vobu_sri); | |
| 249 navPrint_SYNCI(&dsi->synci); | |
| 250 } | |
| 251 | |
| 252 |
