annotate decoder.h @ 205:ba43bdbb07e8 src

Update to allow events sent to the gui to tell it whether we are in a button or not.
author jcdutton
date Sun, 01 Jun 2003 21:55:22 +0000
parents 6b1bfe8f5283
children c2d0cf87a5ee
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
1 /*
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
2 * Copyright (C) 2000, 2001 Martin Norbäck, Håkan Hjort
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
3 *
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
4 * This file is part of libdvdnav, a DVD navigation library. It is modified
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
5 * from a file originally part of the Ogle DVD player.
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
6 *
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
7 * libdvdnav is free software; you can redistribute it and/or modify
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
10 * (at your option) any later version.
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
11 *
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
12 * libdvdnav is distributed in the hope that it will be useful,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
15 * GNU General Public License for more details.
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
16 *
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
20 *
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
21 * $Id$
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
22 *
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
23 */
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
24
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
25 #ifndef DECODER_H_INCLUDED
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
26 #define DECODER_H_INCLUDED
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
27
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
28 #include <inttypes.h>
19
7e8628911b4f Implement General Register Counters or GPRM counters.
jcdutton
parents: 15
diff changeset
29 #include <sys/time.h>
7e8628911b4f Implement General Register Counters or GPRM counters.
jcdutton
parents: 15
diff changeset
30
169
90b1f6f0520e Modified libdvdnav to do without libdvdread.
jcdutton
parents: 153
diff changeset
31 #include "ifo_types.h" /* vm_cmd_t */
136
5897ff629f7c reorganize mutual header inclusion to fix warnings when compiling with TRACE defined
mroi
parents: 114
diff changeset
32 #include "dvdnav_internal.h"
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
33
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 78
diff changeset
34 /* link command types */
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
35 typedef enum {
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
36 LinkNoLink = 0,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
37
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
38 LinkTopC = 1,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
39 LinkNextC = 2,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
40 LinkPrevC = 3,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
41
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
42 LinkTopPG = 5,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
43 LinkNextPG = 6,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
44 LinkPrevPG = 7,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
45
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
46 LinkTopPGC = 9,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
47 LinkNextPGC = 10,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
48 LinkPrevPGC = 11,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
49 LinkGoUpPGC = 12,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
50 LinkTailPGC = 13,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
51
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
52 LinkRSM = 16,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
53
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
54 LinkPGCN,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
55 LinkPTTN,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
56 LinkPGN,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
57 LinkCN,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
58
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
59 Exit,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
60
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
61 JumpTT, /* 22 */
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
62 JumpVTS_TT,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
63 JumpVTS_PTT,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
64
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
65 JumpSS_FP,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
66 JumpSS_VMGM_MENU,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
67 JumpSS_VTSM,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
68 JumpSS_VMGM_PGC,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
69
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
70 CallSS_FP, /* 29 */
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
71 CallSS_VMGM_MENU,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
72 CallSS_VTSM,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
73 CallSS_VMGM_PGC,
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
74
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
75 PlayThis
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
76 } link_cmd_t;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
77
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 78
diff changeset
78 /* a link's data set */
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
79 typedef struct {
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
80 link_cmd_t command;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
81 uint16_t data1;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
82 uint16_t data2;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
83 uint16_t data3;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
84 } link_t;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
85
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 78
diff changeset
86 /* the VM registers */
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
87 typedef struct {
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
88 uint16_t SPRM[24];
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
89 uint16_t GPRM[16];
10
6f0fb88d1463 Added some debug info, to hopefully help in tracking bugs in libdvdnav.
jcdutton
parents: 0
diff changeset
90 uint8_t GPRM_mode[16]; /* Need to have some thing to indicate normal/counter mode for every GPRM */
19
7e8628911b4f Implement General Register Counters or GPRM counters.
jcdutton
parents: 15
diff changeset
91 struct timeval GPRM_time[16]; /* For counter mode */
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
92 } registers_t;
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
93
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 78
diff changeset
94 /* a VM command data set */
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 78
diff changeset
95 typedef struct {
15
74aee0b81da0 only one bits function now.
jcdutton
parents: 10
diff changeset
96 uint64_t instruction;
74aee0b81da0 only one bits function now.
jcdutton
parents: 10
diff changeset
97 uint64_t examined;
74aee0b81da0 only one bits function now.
jcdutton
parents: 10
diff changeset
98 registers_t *registers;
74aee0b81da0 only one bits function now.
jcdutton
parents: 10
diff changeset
99 } command_t;
74aee0b81da0 only one bits function now.
jcdutton
parents: 10
diff changeset
100
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 78
diff changeset
101 /* the big VM function, executing the given commands and writing
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 78
diff changeset
102 * the link where to continue, the return value indicates if a jump
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 78
diff changeset
103 * has been performed */
195
6b1bfe8f5283 Start some cleanups.
jcdutton
parents: 169
diff changeset
104 int vmEval_CMD(vm_cmd_t commands[], int32_t num_commands,
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
105 registers_t *registers, link_t *return_values);
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
106
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 78
diff changeset
107 /* extracts some bits from the command */
195
6b1bfe8f5283 Start some cleanups.
jcdutton
parents: 169
diff changeset
108 uint32_t vm_getbits(command_t* command, int32_t start, int32_t count);
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
109
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 78
diff changeset
110 #ifdef TRACE
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 78
diff changeset
111 /* for debugging: prints a link in readable form */
153
175d5fef21e4 Minor changes.
jcdutton
parents: 136
diff changeset
112 void vm_print_link(link_t value);
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 78
diff changeset
113
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 78
diff changeset
114 /* for debugging: dumps VM registers */
153
175d5fef21e4 Minor changes.
jcdutton
parents: 136
diff changeset
115 void vm_print_registers( registers_t *registers );
114
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 78
diff changeset
116 #endif
b6834e6359cf big libdvdnav cleanup, quoting the ChangeLog:
mroi
parents: 78
diff changeset
117
0
3ddf0eaece51 Initial revision
richwareham
parents:
diff changeset
118 #endif /* DECODER_H_INCLUDED */