Mercurial > libdvdnav.hg
annotate vm.h @ 222:1ebbad52714a src
Put ifo_print.c and .h back in.
author | jcdutton |
---|---|
date | Thu, 01 Jan 2004 15:13:13 +0000 |
parents | 80078f2c53f6 |
children |
rev | line source |
---|---|
0 | 1 /* |
2 * Copyright (C) 2000, 2001 Håkan Hjort | |
3 * Copyright (C) 2001 Rich Wareham <richwareham@users.sourceforge.net> | |
4 * | |
5 * This file is part of libdvdnav, a DVD navigation library. It is modified | |
6 * from a file originally part of the Ogle DVD player. | |
7 * | |
8 * libdvdnav is free software; you can redistribute it and/or modify | |
9 * it under the terms of the GNU General Public License as published by | |
10 * the Free Software Foundation; either version 2 of the License, or | |
11 * (at your option) any later version. | |
12 * | |
13 * libdvdnav is distributed in the hope that it will be useful, | |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 * GNU General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU General Public License | |
19 * along with this program; if not, write to the Free Software | |
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA | |
21 * | |
22 * $Id$ | |
23 * | |
24 */ | |
25 | |
26 #ifndef VM_H_INCLUDED | |
27 #define VM_H_INCLUDED | |
28 | |
97
c1dff1899bda
First patch for personalized dvd viewing. I have not tested it yet.
jcdutton
parents:
90
diff
changeset
|
29 #include "remap.h" |
136
5897ff629f7c
reorganize mutual header inclusion to fix warnings when compiling with TRACE defined
mroi
parents:
134
diff
changeset
|
30 #include "dvdnav_internal.h" |
0 | 31 |
32 /* DOMAIN enum */ | |
33 | |
34 typedef enum { | |
114 | 35 FP_DOMAIN = 1, |
36 VTS_DOMAIN = 2, | |
0 | 37 VMGM_DOMAIN = 4, |
38 VTSM_DOMAIN = 8 | |
39 } domain_t; | |
40 | |
41 /** | |
42 * State: SPRM, GPRM, Domain, pgc, pgN, cellN, ? | |
43 */ | |
44 typedef struct { | |
45 registers_t registers; | |
46 | |
114 | 47 domain_t domain; |
48 int vtsN; /* 0 is vmgm? */ | |
49 pgc_t *pgc; /* either this or 'int pgcN' is enough? */ | |
157
7094c8661c05
Return details about menu number in dvdnav_current_title_info()
jcdutton
parents:
136
diff
changeset
|
50 int pgcN; /* but provide pgcN for quick lookup */ |
114 | 51 int pgN; /* is this needed? can allways fid pgN from cellN? */ |
52 int cellN; | |
53 int32_t cell_restart; /* get cell to restart */ | |
54 int blockN; | |
0 | 55 |
56 /* Resume info */ | |
114 | 57 int rsm_vtsN; |
58 int rsm_blockN; /* of nav_packet */ | |
59 uint16_t rsm_regs[5]; /* system registers 4-8 */ | |
60 int rsm_pgcN; | |
61 int rsm_cellN; | |
0 | 62 } dvd_state_t; |
63 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
17
diff
changeset
|
64 typedef struct vm_position_s { |
114 | 65 int16_t button; /* Button highlighted */ |
66 int32_t vts; /* vts number to use */ | |
182 | 67 domain_t domain; /* domain to use */ |
114 | 68 int32_t spu_channel; /* spu channel to use */ |
69 int32_t angle_channel; /* angle channel to use */ | |
70 int32_t audio_channel; /* audio channel to use */ | |
71 int32_t hop_channel; /* channel hopping. E.g menu button pressed */ | |
134
d9d75a22a061
- new event on cell changes to report program and cell number and some time info
mroi
parents:
133
diff
changeset
|
72 #if 0 |
d9d75a22a061
- new event on cell changes to report program and cell number and some time info
mroi
parents:
133
diff
changeset
|
73 /* currently unused */ |
114 | 74 int32_t title; /* title number */ |
75 int32_t chapter; /* chapter number */ | |
134
d9d75a22a061
- new event on cell changes to report program and cell number and some time info
mroi
parents:
133
diff
changeset
|
76 #endif |
114 | 77 int32_t cell; /* cell number */ |
78 int32_t cell_restart; /* get cell to restart */ | |
79 int32_t cell_start; /* sector number of start of current cell in use */ | |
80 int32_t still; /* is cell still */ | |
81 int32_t block; /* block number within cell in use */ | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
17
diff
changeset
|
82 } vm_position_t; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
17
diff
changeset
|
83 |
0 | 84 typedef struct { |
85 dvd_reader_t *dvd; | |
86 ifo_handle_t *vmgi; | |
87 ifo_handle_t *vtsi; | |
88 dvd_state_t state; | |
114 | 89 int32_t hop_channel; |
90 char dvd_name[50]; | |
91 remap_t *map; | |
92 int stopped; | |
0 | 93 } vm_t; |
94 | |
114 | 95 /* magic number for seeking hops */ |
96 #define HOP_SEEK 0x1000 | |
97 | |
0 | 98 |
99 /* Audio stream number */ | |
100 #define AST_REG registers.SPRM[1] | |
101 /* Subpicture stream number */ | |
102 #define SPST_REG registers.SPRM[2] | |
103 /* Angle number */ | |
104 #define AGL_REG registers.SPRM[3] | |
105 /* Title Track Number */ | |
106 #define TTN_REG registers.SPRM[4] | |
107 /* VTS Title Track Number */ | |
108 #define VTS_TTN_REG registers.SPRM[5] | |
109 /* PGC Number for this Title Track */ | |
110 #define TT_PGCN_REG registers.SPRM[6] | |
111 /* Current Part of Title (PTT) number for (One_Sequential_PGC_Title) */ | |
112 #define PTTN_REG registers.SPRM[7] | |
113 /* Highlighted Button Number (btn nr 1 == value 1024) */ | |
114 #define HL_BTNN_REG registers.SPRM[8] | |
115 /* Parental Level */ | |
116 #define PTL_REG registers.SPRM[13] | |
117 | |
118 /* Initialisation & destruction */ | |
209
80078f2c53f6
this function actually has (void) parameters, not (...)
mroi
parents:
182
diff
changeset
|
119 vm_t *vm_new_vm(void); |
114 | 120 void vm_free_vm(vm_t *vm); |
0 | 121 |
122 /* IFO access */ | |
6 | 123 ifo_handle_t *vm_get_vmgi(vm_t *vm); |
124 ifo_handle_t *vm_get_vtsi(vm_t *vm); | |
0 | 125 |
126 /* Reader Access */ | |
6 | 127 dvd_reader_t *vm_get_dvd_reader(vm_t *vm); |
0 | 128 |
114 | 129 /* Basic Handling */ |
130 void vm_start(vm_t *vm); | |
131 void vm_stop(vm_t *vm); | |
132 int vm_reset(vm_t *vm, const char *dvdroot); | |
133 | |
120
66ca475e2a5a
- provide the means to make copies of the VM to try certain operations on a copy and
mroi
parents:
114
diff
changeset
|
134 /* copying and merging - useful for try-running an operation */ |
66ca475e2a5a
- provide the means to make copies of the VM to try certain operations on a copy and
mroi
parents:
114
diff
changeset
|
135 vm_t *vm_new_copy(vm_t *vm); |
66ca475e2a5a
- provide the means to make copies of the VM to try certain operations on a copy and
mroi
parents:
114
diff
changeset
|
136 void vm_merge(vm_t *target, vm_t *source); |
66ca475e2a5a
- provide the means to make copies of the VM to try certain operations on a copy and
mroi
parents:
114
diff
changeset
|
137 void vm_free_copy(vm_t *vm); |
66ca475e2a5a
- provide the means to make copies of the VM to try certain operations on a copy and
mroi
parents:
114
diff
changeset
|
138 |
114 | 139 /* regular playback */ |
140 void vm_position_get(vm_t *vm, vm_position_t *position); | |
141 void vm_get_next_cell(vm_t *vm); | |
142 | |
143 /* Jumping - all these return 1, if a hop has been performed */ | |
144 int vm_jump_pg(vm_t *vm, int pg); | |
133
d09a81cf65ce
determine correct PG and PTT numbers when seeking across PG boundaries
mroi
parents:
120
diff
changeset
|
145 int vm_jump_cell_block(vm_t *vm, int cell, int block); |
90 | 146 int vm_jump_title_part(vm_t *vm, int title, int part); |
114 | 147 int vm_jump_top_pg(vm_t *vm); |
148 int vm_jump_next_pg(vm_t *vm); | |
149 int vm_jump_prev_pg(vm_t *vm); | |
150 int vm_jump_up(vm_t *vm); | |
151 int vm_jump_menu(vm_t *vm, DVDMenuID_t menuid); | |
167 | 152 int vm_jump_resume(vm_t *vm); |
114 | 153 int vm_exec_cmd(vm_t *vm, vm_cmd_t *cmd); |
0 | 154 |
114 | 155 /* getting information */ |
157
7094c8661c05
Return details about menu number in dvdnav_current_title_info()
jcdutton
parents:
136
diff
changeset
|
156 int vm_get_current_menu(vm_t *vm, int *menuid); |
114 | 157 int vm_get_current_title_part(vm_t *vm, int *title_result, int *part_result); |
6 | 158 int vm_get_audio_stream(vm_t *vm, int audioN); |
114 | 159 int vm_get_subp_stream(vm_t *vm, int subpN, int mode); |
6 | 160 int vm_get_audio_active_stream(vm_t *vm); |
55
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
50
diff
changeset
|
161 int vm_get_subp_active_stream(vm_t *vm, int mode); |
114 | 162 void vm_get_angle_info(vm_t *vm, int *current, int *num_avail); |
163 #if 0 | |
164 /* currently unused */ | |
165 void vm_get_audio_info(vm_t *vm, int *current, int *num_avail); | |
166 void vm_get_subp_info(vm_t *vm, int *current, int *num_avail); | |
167 void vm_get_video_res(vm_t *vm, int *width, int *height); | |
168 #endif | |
169 int vm_get_video_aspect(vm_t *vm); | |
170 int vm_get_video_scale_permission(vm_t *vm); | |
171 video_attr_t vm_get_video_attr(vm_t *vm); | |
172 audio_attr_t vm_get_audio_attr(vm_t *vm, int streamN); | |
173 subp_attr_t vm_get_subp_attr(vm_t *vm, int streamN); | |
88 | 174 |
114 | 175 #ifdef TRACE |
176 /* Debug */ | |
177 void vm_position_print(vm_t *vm, vm_position_t *position); | |
178 #endif | |
179 | |
0 | 180 |
181 #endif /* VM_HV_INCLUDED */ |