annotate vm/decoder.h @ 420:d7720a050e67 src

Restore C++ compatibility by renaming the parameter to 'self' like in the other functions. Revision 1208 ("Add dvdnav_program_play & dvdnav_current_title_program") added dvdnav_program_play function to dvdnav.h. However, unlike the other API functions, its first parameter is named 'this' instead of 'self'. 'this' is a C++ keyword and prevents compilation of C++ projects using libdvdnav. Patch by Anssi Hannula \anssi.hannula%iki.fi/
author rathann
date Sun, 09 Dec 2012 21:39:37 +0000
parents 0a5a6f03b029
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
225
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
1 /*
390
ef8c0e834a14 Convert all ISO8859-1 sequences to proper UTF-8.
diego
parents: 389
diff changeset
2 * Copyright (C) 2000, 2001 Martin Norbäck, Håkan Hjort
388
90ca650854e0 Remove all trailing whitespace,
rathann
parents: 289
diff changeset
3 *
225
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
4 * This file is part of libdvdnav, a DVD navigation library. It is modified
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
5 * from a file originally part of the Ogle DVD player.
388
90ca650854e0 Remove all trailing whitespace,
rathann
parents: 289
diff changeset
6 *
225
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
7 * libdvdnav is free software; you can redistribute it and/or modify
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
10 * (at your option) any later version.
388
90ca650854e0 Remove all trailing whitespace,
rathann
parents: 289
diff changeset
11 *
225
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
12 * libdvdnav is distributed in the hope that it will be useful,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
15 * GNU General Public License for more details.
388
90ca650854e0 Remove all trailing whitespace,
rathann
parents: 289
diff changeset
16 *
389
d3c273ced49c Use consistent license headers everywhere: Fix wrong FSF address.
diego
parents: 388
diff changeset
17 * You should have received a copy of the GNU General Public License along
d3c273ced49c Use consistent license headers everywhere: Fix wrong FSF address.
diego
parents: 388
diff changeset
18 * with libdvdnav; if not, write to the Free Software Foundation, Inc.,
d3c273ced49c Use consistent license headers everywhere: Fix wrong FSF address.
diego
parents: 388
diff changeset
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
225
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
20 */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
21
391
d232a96ac231 Use consistent multiple inclusion guards everywhere:
diego
parents: 390
diff changeset
22 #ifndef LIBDVDNAV_DECODER_H
d232a96ac231 Use consistent multiple inclusion guards everywhere:
diego
parents: 390
diff changeset
23 #define LIBDVDNAV_DECODER_H
225
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
24
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
25 /* link command types */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
26 typedef enum {
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
27 LinkNoLink = 0,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
28
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
29 LinkTopC = 1,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
30 LinkNextC = 2,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
31 LinkPrevC = 3,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
32
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
33 LinkTopPG = 5,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
34 LinkNextPG = 6,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
35 LinkPrevPG = 7,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
36
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
37 LinkTopPGC = 9,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
38 LinkNextPGC = 10,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
39 LinkPrevPGC = 11,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
40 LinkGoUpPGC = 12,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
41 LinkTailPGC = 13,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
42
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
43 LinkRSM = 16,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
44
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
45 LinkPGCN,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
46 LinkPTTN,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
47 LinkPGN,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
48 LinkCN,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
49
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
50 Exit,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
51
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
52 JumpTT, /* 22 */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
53 JumpVTS_TT,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
54 JumpVTS_PTT,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
55
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
56 JumpSS_FP,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
57 JumpSS_VMGM_MENU,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
58 JumpSS_VTSM,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
59 JumpSS_VMGM_PGC,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
60
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
61 CallSS_FP, /* 29 */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
62 CallSS_VMGM_MENU,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
63 CallSS_VTSM,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
64 CallSS_VMGM_PGC,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
65
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
66 PlayThis
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
67 } link_cmd_t;
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
68
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
69 /* a link's data set */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
70 typedef struct {
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
71 link_cmd_t command;
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
72 uint16_t data1;
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
73 uint16_t data2;
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
74 uint16_t data3;
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
75 } link_t;
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
76
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
77 /* the VM registers */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
78 typedef struct {
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
79 uint16_t SPRM[24];
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
80 uint16_t GPRM[16];
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
81 uint8_t GPRM_mode[16]; /* Need to have some thing to indicate normal/counter mode for every GPRM */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
82 struct timeval GPRM_time[16]; /* For counter mode */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
83 } registers_t;
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
84
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
85 /* a VM command data set */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
86 typedef struct {
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
87 uint64_t instruction;
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
88 uint64_t examined;
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
89 registers_t *registers;
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
90 } command_t;
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
91
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
92 /* the big VM function, executing the given commands and writing
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
93 * the link where to continue, the return value indicates if a jump
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
94 * has been performed */
388
90ca650854e0 Remove all trailing whitespace,
rathann
parents: 289
diff changeset
95 int32_t vmEval_CMD(vm_cmd_t commands[], int32_t num_commands,
225
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
96 registers_t *registers, link_t *return_values);
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
97
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
98 /* extracts some bits from the command */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
99 uint32_t vm_getbits(command_t* command, int32_t start, int32_t count);
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
100
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
101 #ifdef TRACE
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
102 /* for debugging: prints a link in readable form */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
103 void vm_print_link(link_t value);
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
104
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
105 /* for debugging: dumps VM registers */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
106 void vm_print_registers( registers_t *registers );
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
107 #endif
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
108
391
d232a96ac231 Use consistent multiple inclusion guards everywhere:
diego
parents: 390
diff changeset
109 #endif /* LIBDVDNAV_DECODER_H */