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"
|
|
30 #include <dvd_types.h>
|
|
31
|
|
32 /* DOMAIN enum */
|
|
33
|
|
34 typedef enum {
|
|
35 FP_DOMAIN = 1,
|
|
36 VTS_DOMAIN = 2,
|
|
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
|
|
47 pgc_t *pgc; /* either this or *pgc is enough? */
|
|
48
|
|
49 domain_t domain;
|
|
50 int vtsN; /* 0 is vmgm? */
|
|
51 /* int pgcN; // either this or *pgc is enough. Which to use? */
|
|
52 int pgN; /* is this needed? can allways fid pgN from cellN? */
|
|
53 int cellN;
|
|
54 int blockN;
|
|
55
|
|
56 /* Resume info */
|
|
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;
|
|
62 } dvd_state_t;
|
|
63
|
|
64 typedef struct {
|
|
65 dvd_reader_t *dvd;
|
|
66 ifo_handle_t *vmgi;
|
|
67 ifo_handle_t *vtsi;
|
|
68 dvd_state_t state;
|
|
69 int badness_counter;
|
|
70 } vm_t;
|
|
71
|
|
72
|
|
73 /* Audio stream number */
|
|
74 #define AST_REG registers.SPRM[1]
|
|
75 /* Subpicture stream number */
|
|
76 #define SPST_REG registers.SPRM[2]
|
|
77 /* Angle number */
|
|
78 #define AGL_REG registers.SPRM[3]
|
|
79 /* Title Track Number */
|
|
80 #define TTN_REG registers.SPRM[4]
|
|
81 /* VTS Title Track Number */
|
|
82 #define VTS_TTN_REG registers.SPRM[5]
|
|
83 /* PGC Number for this Title Track */
|
|
84 #define TT_PGCN_REG registers.SPRM[6]
|
|
85 /* Current Part of Title (PTT) number for (One_Sequential_PGC_Title) */
|
|
86 #define PTTN_REG registers.SPRM[7]
|
|
87 /* Highlighted Button Number (btn nr 1 == value 1024) */
|
|
88 #define HL_BTNN_REG registers.SPRM[8]
|
|
89 /* Parental Level */
|
|
90 #define PTL_REG registers.SPRM[13]
|
|
91
|
|
92 /* Initialisation & destruction */
|
|
93 vm_t* vm_new_vm();
|
|
94 void vm_free_vm(vm_t *self);
|
|
95
|
|
96 /* IFO access */
|
|
97 ifo_handle_t *vm_get_vmgi(vm_t *self);
|
|
98 ifo_handle_t *vm_get_vtsi(vm_t *self);
|
|
99
|
|
100 /* Reader Access */
|
|
101 dvd_reader_t *vm_get_dvd_reader(vm_t *self);
|
|
102
|
|
103 /* Jumping */
|
|
104 int vm_start_title(vm_t *self, int tt);
|
|
105 int vm_jump_prog(vm_t *self, int pr);
|
|
106
|
|
107 /* Other calls */
|
|
108 int vm_reset(vm_t *self, char *dvdroot); /* , register_t regs); */
|
|
109 int vm_start(vm_t *self);
|
|
110 int vm_eval_cmd(vm_t *self, vm_cmd_t *cmd);
|
|
111 int vm_get_next_cell(vm_t *self);
|
|
112 int vm_menu_call(vm_t *self, DVDMenuID_t menuid, int block);
|
|
113 int vm_resume(vm_t *self);
|
|
114 int vm_go_up(vm_t *self);
|
|
115 int vm_top_pg(vm_t *self);
|
|
116 int vm_next_pg(vm_t *self);
|
|
117 int vm_prev_pg(vm_t *self);
|
|
118 int vm_get_audio_stream(vm_t *self, int audioN);
|
|
119 int vm_get_audio_active_stream(vm_t *self);
|
|
120 int vm_get_subp_stream(vm_t *self, int subpN);
|
|
121 int vm_get_subp_active_stream(vm_t *self);
|
|
122 void vm_get_angle_info(vm_t *self, int *num_avail, int *current);
|
|
123 void vm_get_audio_info(vm_t *self, int *num_avail, int *current);
|
|
124 void vm_get_subp_info(vm_t *self, int *num_avail, int *current);
|
|
125 subp_attr_t vm_get_subp_attr(vm_t *self, int streamN);
|
|
126 audio_attr_t vm_get_audio_attr(vm_t *self, int streamN);
|
|
127 void vm_get_video_res(vm_t *self, int *width, int *height);
|
|
128
|
|
129 #endif /* VM_HV_INCLUDED */
|
|
130
|