Mercurial > libdvdnav.hg
annotate vm.h @ 97:c1dff1899bda src
First patch for personalized dvd viewing. I have not tested it yet.
author | jcdutton |
---|---|
date | Tue, 17 Sep 2002 11:00:25 +0000 |
parents | eeabf5a51b2b |
children | b6834e6359cf |
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 { | |
36 FP_DOMAIN = 1, | |
37 VTS_DOMAIN = 2, | |
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 | |
48 pgc_t *pgc; /* either this or *pgc is enough? */ | |
49 | |
50 domain_t domain; | |
51 int vtsN; /* 0 is vmgm? */ | |
52 /* int pgcN; // either this or *pgc is enough. Which to use? */ | |
53 int pgN; /* is this needed? can allways fid pgN from cellN? */ | |
54 int cellN; | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
25
diff
changeset
|
55 int32_t cell_restart; /* get cell to restart */ |
0 | 56 int blockN; |
57 | |
58 /* Resume info */ | |
59 int rsm_vtsN; | |
60 int rsm_blockN; /* of nav_packet */ | |
61 uint16_t rsm_regs[5]; /* system registers 4-8 */ | |
62 int rsm_pgcN; | |
63 int rsm_cellN; | |
64 } dvd_state_t; | |
65 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
17
diff
changeset
|
66 typedef struct vm_position_s { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
17
diff
changeset
|
67 int16_t button; /* Button highlighted */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
17
diff
changeset
|
68 uint32_t clut; /* CLUT to use, not needed in this struct */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
17
diff
changeset
|
69 int32_t vts; /* vts number to use */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
17
diff
changeset
|
70 int32_t domain; /* domain to use */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
17
diff
changeset
|
71 int32_t spu_channel; /* spu channel to use */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
17
diff
changeset
|
72 int32_t angle_channel; /* angle channel to use */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
17
diff
changeset
|
73 int32_t audio_channel; /* audio channel to use */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
17
diff
changeset
|
74 int32_t hop_channel; /* channel hopping. E.g menu button pressed */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
17
diff
changeset
|
75 int32_t title; /* title number */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
17
diff
changeset
|
76 int32_t chapter; /* chapter number */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
17
diff
changeset
|
77 int32_t cell; /* cell number */ |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
25
diff
changeset
|
78 int32_t cell_restart; /* get cell to restart */ |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
17
diff
changeset
|
79 int32_t still; /* is cell still */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
17
diff
changeset
|
80 int32_t vobu_start; /* block number of start of current VOBU in use */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
17
diff
changeset
|
81 int32_t vobu_next; /* block number within VOBU in use */ |
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; | |
89 int badness_counter; | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
17
diff
changeset
|
90 int32_t hop_channel; |
97
c1dff1899bda
First patch for personalized dvd viewing. I have not tested it yet.
jcdutton
parents:
90
diff
changeset
|
91 char dvd_name[50]; |
c1dff1899bda
First patch for personalized dvd viewing. I have not tested it yet.
jcdutton
parents:
90
diff
changeset
|
92 int dvd_name_length; |
c1dff1899bda
First patch for personalized dvd viewing. I have not tested it yet.
jcdutton
parents:
90
diff
changeset
|
93 remap_t *map; |
0 | 94 } vm_t; |
95 | |
96 | |
97 /* Audio stream number */ | |
98 #define AST_REG registers.SPRM[1] | |
99 /* Subpicture stream number */ | |
100 #define SPST_REG registers.SPRM[2] | |
101 /* Angle number */ | |
102 #define AGL_REG registers.SPRM[3] | |
103 /* Title Track Number */ | |
104 #define TTN_REG registers.SPRM[4] | |
105 /* VTS Title Track Number */ | |
106 #define VTS_TTN_REG registers.SPRM[5] | |
107 /* PGC Number for this Title Track */ | |
108 #define TT_PGCN_REG registers.SPRM[6] | |
109 /* Current Part of Title (PTT) number for (One_Sequential_PGC_Title) */ | |
110 #define PTTN_REG registers.SPRM[7] | |
111 /* Highlighted Button Number (btn nr 1 == value 1024) */ | |
112 #define HL_BTNN_REG registers.SPRM[8] | |
113 /* Parental Level */ | |
114 #define PTL_REG registers.SPRM[13] | |
115 | |
116 /* Initialisation & destruction */ | |
117 vm_t* vm_new_vm(); | |
6 | 118 void vm_free_vm(vm_t *vm); |
0 | 119 |
120 /* IFO access */ | |
6 | 121 ifo_handle_t *vm_get_vmgi(vm_t *vm); |
122 ifo_handle_t *vm_get_vtsi(vm_t *vm); | |
0 | 123 |
124 /* Reader Access */ | |
6 | 125 dvd_reader_t *vm_get_dvd_reader(vm_t *vm); |
0 | 126 |
127 /* Jumping */ | |
6 | 128 int vm_start_title(vm_t *vm, int tt); |
129 int vm_jump_prog(vm_t *vm, int pr); | |
90 | 130 int vm_jump_title_part(vm_t *vm, int title, int part); |
0 | 131 |
132 /* Other calls */ | |
17 | 133 int vm_reset(vm_t *vm, char *dvdroot); /* , register_t regs); */ |
6 | 134 int vm_start(vm_t *vm); |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
17
diff
changeset
|
135 int vm_position_get(vm_t *vm, vm_position_t *position); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
17
diff
changeset
|
136 int vm_position_print(vm_t *vm, vm_position_t *position); |
6 | 137 int vm_eval_cmd(vm_t *vm, vm_cmd_t *cmd); |
138 int vm_get_next_cell(vm_t *vm); | |
139 int vm_menu_call(vm_t *vm, DVDMenuID_t menuid, int block); | |
140 int vm_resume(vm_t *vm); | |
141 int vm_go_up(vm_t *vm); | |
142 int vm_top_pg(vm_t *vm); | |
143 int vm_next_pg(vm_t *vm); | |
144 int vm_prev_pg(vm_t *vm); | |
145 int vm_get_audio_stream(vm_t *vm, int audioN); | |
146 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
|
147 int vm_get_subp_stream(vm_t *vm, int subpN, int mode); |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
50
diff
changeset
|
148 int vm_get_subp_active_stream(vm_t *vm, int mode); |
6 | 149 void vm_get_angle_info(vm_t *vm, int *num_avail, int *current); |
150 void vm_get_audio_info(vm_t *vm, int *num_avail, int *current); | |
151 void vm_get_subp_info(vm_t *vm, int *num_avail, int *current); | |
90 | 152 int vm_get_current_title_part(vm_t *vm, int *title_result, int *part_result); |
88 | 153 |
6 | 154 subp_attr_t vm_get_subp_attr(vm_t *vm, int streamN); |
155 audio_attr_t vm_get_audio_attr(vm_t *vm, int streamN); | |
156 void vm_get_video_res(vm_t *vm, int *width, int *height); | |
25
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
22
diff
changeset
|
157 int vm_get_video_aspect(vm_t *vm); |
55
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
50
diff
changeset
|
158 int vm_get_video_scale_permission(vm_t *vm); |
0 | 159 |
160 #endif /* VM_HV_INCLUDED */ | |
161 |