Mercurial > libdvdnav.hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
113:ec2df154be56 | 114:b6834e6359cf |
---|---|
31 #include <dvd_types.h> | 31 #include <dvd_types.h> |
32 | 32 |
33 /* DOMAIN enum */ | 33 /* DOMAIN enum */ |
34 | 34 |
35 typedef enum { | 35 typedef enum { |
36 FP_DOMAIN = 1, | 36 FP_DOMAIN = 1, |
37 VTS_DOMAIN = 2, | 37 VTS_DOMAIN = 2, |
38 VMGM_DOMAIN = 4, | 38 VMGM_DOMAIN = 4, |
39 VTSM_DOMAIN = 8 | 39 VTSM_DOMAIN = 8 |
40 } domain_t; | 40 } domain_t; |
41 | 41 |
42 /** | 42 /** |
43 * State: SPRM, GPRM, Domain, pgc, pgN, cellN, ? | 43 * State: SPRM, GPRM, Domain, pgc, pgN, cellN, ? |
44 */ | 44 */ |
45 typedef struct { | 45 typedef struct { |
46 registers_t registers; | 46 registers_t registers; |
47 | 47 |
48 pgc_t *pgc; /* either this or *pgc is enough? */ | 48 domain_t domain; |
49 | 49 int vtsN; /* 0 is vmgm? */ |
50 domain_t domain; | 50 pgc_t *pgc; /* either this or 'int pgcN' is enough? */ |
51 int vtsN; /* 0 is vmgm? */ | 51 int pgN; /* is this needed? can allways fid pgN from cellN? */ |
52 /* int pgcN; // either this or *pgc is enough. Which to use? */ | 52 int cellN; |
53 int pgN; /* is this needed? can allways fid pgN from cellN? */ | 53 int32_t cell_restart; /* get cell to restart */ |
54 int cellN; | 54 int blockN; |
55 int32_t cell_restart; /* get cell to restart */ | |
56 int blockN; | |
57 | 55 |
58 /* Resume info */ | 56 /* Resume info */ |
59 int rsm_vtsN; | 57 int rsm_vtsN; |
60 int rsm_blockN; /* of nav_packet */ | 58 int rsm_blockN; /* of nav_packet */ |
61 uint16_t rsm_regs[5]; /* system registers 4-8 */ | 59 uint16_t rsm_regs[5]; /* system registers 4-8 */ |
62 int rsm_pgcN; | 60 int rsm_pgcN; |
63 int rsm_cellN; | 61 int rsm_cellN; |
64 } dvd_state_t; | 62 } dvd_state_t; |
65 | 63 |
66 typedef struct vm_position_s { | 64 typedef struct vm_position_s { |
67 int16_t button; /* Button highlighted */ | 65 int16_t button; /* Button highlighted */ |
68 uint32_t clut; /* CLUT to use, not needed in this struct */ | 66 int32_t vts; /* vts number to use */ |
69 int32_t vts; /* vts number to use */ | 67 int32_t domain; /* domain to use */ |
70 int32_t domain; /* domain to use */ | 68 int32_t spu_channel; /* spu channel to use */ |
71 int32_t spu_channel; /* spu channel to use */ | 69 int32_t angle_channel; /* angle channel to use */ |
72 int32_t angle_channel; /* angle channel to use */ | 70 int32_t audio_channel; /* audio channel to use */ |
73 int32_t audio_channel; /* audio channel to use */ | 71 int32_t hop_channel; /* channel hopping. E.g menu button pressed */ |
74 int32_t hop_channel; /* channel hopping. E.g menu button pressed */ | 72 int32_t title; /* title number */ |
75 int32_t title; /* title number */ | 73 int32_t chapter; /* chapter number */ |
76 int32_t chapter; /* chapter number */ | 74 int32_t cell; /* cell number */ |
77 int32_t cell; /* cell number */ | 75 int32_t cell_restart; /* get cell to restart */ |
78 int32_t cell_restart; /* get cell to restart */ | 76 int32_t cell_start; /* sector number of start of current cell in use */ |
79 int32_t still; /* is cell still */ | 77 int32_t still; /* is cell still */ |
80 int32_t vobu_start; /* block number of start of current VOBU in use */ | 78 int32_t block; /* block number within cell in use */ |
81 int32_t vobu_next; /* block number within VOBU in use */ | |
82 } vm_position_t; | 79 } vm_position_t; |
83 | 80 |
84 typedef struct { | 81 typedef struct { |
85 dvd_reader_t *dvd; | 82 dvd_reader_t *dvd; |
86 ifo_handle_t *vmgi; | 83 ifo_handle_t *vmgi; |
87 ifo_handle_t *vtsi; | 84 ifo_handle_t *vtsi; |
88 dvd_state_t state; | 85 dvd_state_t state; |
89 int badness_counter; | 86 int32_t hop_channel; |
90 int32_t hop_channel; | 87 char dvd_name[50]; |
91 char dvd_name[50]; | 88 remap_t *map; |
92 int dvd_name_length; | 89 int stopped; |
93 remap_t *map; | |
94 } vm_t; | 90 } vm_t; |
91 | |
92 /* magic number for seeking hops */ | |
93 #define HOP_SEEK 0x1000 | |
95 | 94 |
96 | 95 |
97 /* Audio stream number */ | 96 /* Audio stream number */ |
98 #define AST_REG registers.SPRM[1] | 97 #define AST_REG registers.SPRM[1] |
99 /* Subpicture stream number */ | 98 /* Subpicture stream number */ |
113 /* Parental Level */ | 112 /* Parental Level */ |
114 #define PTL_REG registers.SPRM[13] | 113 #define PTL_REG registers.SPRM[13] |
115 | 114 |
116 /* Initialisation & destruction */ | 115 /* Initialisation & destruction */ |
117 vm_t* vm_new_vm(); | 116 vm_t* vm_new_vm(); |
118 void vm_free_vm(vm_t *vm); | 117 void vm_free_vm(vm_t *vm); |
119 | 118 |
120 /* IFO access */ | 119 /* IFO access */ |
121 ifo_handle_t *vm_get_vmgi(vm_t *vm); | 120 ifo_handle_t *vm_get_vmgi(vm_t *vm); |
122 ifo_handle_t *vm_get_vtsi(vm_t *vm); | 121 ifo_handle_t *vm_get_vtsi(vm_t *vm); |
123 | 122 |
124 /* Reader Access */ | 123 /* Reader Access */ |
125 dvd_reader_t *vm_get_dvd_reader(vm_t *vm); | 124 dvd_reader_t *vm_get_dvd_reader(vm_t *vm); |
126 | 125 |
127 /* Jumping */ | 126 /* Basic Handling */ |
128 int vm_start_title(vm_t *vm, int tt); | 127 void vm_start(vm_t *vm); |
129 int vm_jump_prog(vm_t *vm, int pr); | 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); | |
130 int vm_jump_title_part(vm_t *vm, int title, int part); | 137 int vm_jump_title_part(vm_t *vm, int title, int part); |
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); | |
131 | 144 |
132 /* Other calls */ | 145 /* getting information */ |
133 int vm_reset(vm_t *vm, char *dvdroot); /* , register_t regs); */ | 146 int vm_get_current_title_part(vm_t *vm, int *title_result, int *part_result); |
134 int vm_start(vm_t *vm); | |
135 int vm_position_get(vm_t *vm, vm_position_t *position); | |
136 int vm_position_print(vm_t *vm, vm_position_t *position); | |
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); | 147 int vm_get_audio_stream(vm_t *vm, int audioN); |
148 int vm_get_subp_stream(vm_t *vm, int subpN, int mode); | |
146 int vm_get_audio_active_stream(vm_t *vm); | 149 int vm_get_audio_active_stream(vm_t *vm); |
147 int vm_get_subp_stream(vm_t *vm, int subpN, int mode); | |
148 int vm_get_subp_active_stream(vm_t *vm, int mode); | 150 int vm_get_subp_active_stream(vm_t *vm, int mode); |
149 void vm_get_angle_info(vm_t *vm, int *num_avail, int *current); | 151 void vm_get_angle_info(vm_t *vm, int *current, int *num_avail); |
150 void vm_get_audio_info(vm_t *vm, int *num_avail, int *current); | 152 #if 0 |
151 void vm_get_subp_info(vm_t *vm, int *num_avail, int *current); | 153 /* currently unused */ |
152 int vm_get_current_title_part(vm_t *vm, int *title_result, int *part_result); | 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); | |
153 | 163 |
154 subp_attr_t vm_get_subp_attr(vm_t *vm, int streamN); | 164 #ifdef TRACE |
155 audio_attr_t vm_get_audio_attr(vm_t *vm, int streamN); | 165 /* Debug */ |
156 void vm_get_video_res(vm_t *vm, int *width, int *height); | 166 void vm_position_print(vm_t *vm, vm_position_t *position); |
157 int vm_get_video_aspect(vm_t *vm); | 167 #endif |
158 int vm_get_video_scale_permission(vm_t *vm); | 168 |
159 | 169 |
160 #endif /* VM_HV_INCLUDED */ | 170 #endif /* VM_HV_INCLUDED */ |
161 |