Mercurial > libdvdnav.hg
annotate vm.h @ 114:b6834e6359cf src
big libdvdnav cleanup, quoting the ChangeLog:
* some bugfixes
* code cleanup
* build process polishing
* more sensible event order in get_next_block to ensure useful event delivery
* VOBU level resume
* fixed: seeking in a multiangle feature briefly showed the wrong angle
author | mroi |
---|---|
date | Thu, 20 Feb 2003 15:32:21 +0000 |
parents | c1dff1899bda |
children | 66ca475e2a5a |
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 | |
29 #include "decoder.h" | |
97
c1dff1899bda
First patch for personalized dvd viewing. I have not tested it yet.
jcdutton
parents:
90
diff
changeset
|
30 #include "remap.h" |
0 | 31 #include <dvd_types.h> |
32 | |
33 /* DOMAIN enum */ | |
34 | |
35 typedef enum { | |
114 | 36 FP_DOMAIN = 1, |
37 VTS_DOMAIN = 2, | |
0 | 38 VMGM_DOMAIN = 4, |
39 VTSM_DOMAIN = 8 | |
40 } domain_t; | |
41 | |
42 /** | |
43 * State: SPRM, GPRM, Domain, pgc, pgN, cellN, ? | |
44 */ | |
45 typedef struct { | |
46 registers_t registers; | |
47 | |
114 | 48 domain_t domain; |
49 int vtsN; /* 0 is vmgm? */ | |
50 pgc_t *pgc; /* either this or 'int pgcN' is enough? */ | |
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 */ | |
67 int32_t domain; /* domain to use */ | |
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 */ | |
72 int32_t title; /* title number */ | |
73 int32_t chapter; /* chapter number */ | |
74 int32_t cell; /* cell number */ | |
75 int32_t cell_restart; /* get cell to restart */ | |
76 int32_t cell_start; /* sector number of start of current cell in use */ | |
77 int32_t still; /* is cell still */ | |
78 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
|
79 } vm_position_t; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
17
diff
changeset
|
80 |
0 | 81 typedef struct { |
82 dvd_reader_t *dvd; | |
83 ifo_handle_t *vmgi; | |
84 ifo_handle_t *vtsi; | |
85 dvd_state_t state; | |
114 | 86 int32_t hop_channel; |
87 char dvd_name[50]; | |
88 remap_t *map; | |
89 int stopped; | |
0 | 90 } vm_t; |
91 | |
114 | 92 /* magic number for seeking hops */ |
93 #define HOP_SEEK 0x1000 | |
94 | |
0 | 95 |
96 /* Audio stream number */ | |
97 #define AST_REG registers.SPRM[1] | |
98 /* Subpicture stream number */ | |
99 #define SPST_REG registers.SPRM[2] | |
100 /* Angle number */ | |
101 #define AGL_REG registers.SPRM[3] | |
102 /* Title Track Number */ | |
103 #define TTN_REG registers.SPRM[4] | |
104 /* VTS Title Track Number */ | |
105 #define VTS_TTN_REG registers.SPRM[5] | |
106 /* PGC Number for this Title Track */ | |
107 #define TT_PGCN_REG registers.SPRM[6] | |
108 /* Current Part of Title (PTT) number for (One_Sequential_PGC_Title) */ | |
109 #define PTTN_REG registers.SPRM[7] | |
110 /* Highlighted Button Number (btn nr 1 == value 1024) */ | |
111 #define HL_BTNN_REG registers.SPRM[8] | |
112 /* Parental Level */ | |
113 #define PTL_REG registers.SPRM[13] | |
114 | |
115 /* Initialisation & destruction */ | |
116 vm_t* vm_new_vm(); | |
114 | 117 void vm_free_vm(vm_t *vm); |
0 | 118 |
119 /* IFO access */ | |
6 | 120 ifo_handle_t *vm_get_vmgi(vm_t *vm); |
121 ifo_handle_t *vm_get_vtsi(vm_t *vm); | |
0 | 122 |
123 /* Reader Access */ | |
6 | 124 dvd_reader_t *vm_get_dvd_reader(vm_t *vm); |
0 | 125 |
114 | 126 /* Basic Handling */ |
127 void vm_start(vm_t *vm); | |
128 void vm_stop(vm_t *vm); | |
129 int vm_reset(vm_t *vm, const char *dvdroot); | |
130 | |
131 /* regular playback */ | |
132 void vm_position_get(vm_t *vm, vm_position_t *position); | |
133 void vm_get_next_cell(vm_t *vm); | |
134 | |
135 /* Jumping - all these return 1, if a hop has been performed */ | |
136 int vm_jump_pg(vm_t *vm, int pg); | |
90 | 137 int vm_jump_title_part(vm_t *vm, int title, int part); |
114 | 138 int vm_jump_top_pg(vm_t *vm); |
139 int vm_jump_next_pg(vm_t *vm); | |
140 int vm_jump_prev_pg(vm_t *vm); | |
141 int vm_jump_up(vm_t *vm); | |
142 int vm_jump_menu(vm_t *vm, DVDMenuID_t menuid); | |
143 int vm_exec_cmd(vm_t *vm, vm_cmd_t *cmd); | |
0 | 144 |
114 | 145 /* getting information */ |
146 int vm_get_current_title_part(vm_t *vm, int *title_result, int *part_result); | |
6 | 147 int vm_get_audio_stream(vm_t *vm, int audioN); |
114 | 148 int vm_get_subp_stream(vm_t *vm, int subpN, int mode); |
6 | 149 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
|
150 int vm_get_subp_active_stream(vm_t *vm, int mode); |
114 | 151 void vm_get_angle_info(vm_t *vm, int *current, int *num_avail); |
152 #if 0 | |
153 /* currently unused */ | |
154 void vm_get_audio_info(vm_t *vm, int *current, int *num_avail); | |
155 void vm_get_subp_info(vm_t *vm, int *current, int *num_avail); | |
156 void vm_get_video_res(vm_t *vm, int *width, int *height); | |
157 #endif | |
158 int vm_get_video_aspect(vm_t *vm); | |
159 int vm_get_video_scale_permission(vm_t *vm); | |
160 video_attr_t vm_get_video_attr(vm_t *vm); | |
161 audio_attr_t vm_get_audio_attr(vm_t *vm, int streamN); | |
162 subp_attr_t vm_get_subp_attr(vm_t *vm, int streamN); | |
88 | 163 |
114 | 164 #ifdef TRACE |
165 /* Debug */ | |
166 void vm_position_print(vm_t *vm, vm_position_t *position); | |
167 #endif | |
168 | |
0 | 169 |
170 #endif /* VM_HV_INCLUDED */ |