diff 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
line wrap: on
line diff
--- a/vm.h	Mon Jan 13 13:33:45 2003 +0000
+++ b/vm.h	Thu Feb 20 15:32:21 2003 +0000
@@ -33,8 +33,8 @@
 /* DOMAIN enum */
 
 typedef enum {
-  FP_DOMAIN = 1,
-  VTS_DOMAIN = 2,
+  FP_DOMAIN   = 1,
+  VTS_DOMAIN  = 2,
   VMGM_DOMAIN = 4,
   VTSM_DOMAIN = 8
 } domain_t;  
@@ -45,40 +45,37 @@
 typedef struct {
   registers_t registers;
   
-  pgc_t *pgc; /*  either this or *pgc is enough? */
-  
-  domain_t domain;
-  int vtsN; /*  0 is vmgm? */
-  /*   int pgcN; // either this or *pgc is enough. Which to use? */
-  int pgN;  /*  is this needed? can allways fid pgN from cellN? */
-  int cellN;
-  int32_t cell_restart; /* get cell to restart */
-  int blockN;
+  domain_t  domain;
+  int       vtsN;         /* 0 is vmgm? */
+  pgc_t    *pgc;          /* either this or 'int pgcN' is enough? */
+  int       pgN;          /* is this needed? can allways fid pgN from cellN? */
+  int       cellN;
+  int32_t   cell_restart; /* get cell to restart */
+  int       blockN;
   
   /* Resume info */
-  int rsm_vtsN;
-  int rsm_blockN; /* of nav_packet */
-  uint16_t rsm_regs[5]; /* system registers 4-8 */
-  int rsm_pgcN;
-  int rsm_cellN;
+  int      rsm_vtsN;
+  int      rsm_blockN;    /* of nav_packet */
+  uint16_t rsm_regs[5];   /* system registers 4-8 */
+  int      rsm_pgcN;
+  int      rsm_cellN;
 } dvd_state_t;
 
 typedef struct vm_position_s {
-  int16_t button; /* Button highlighted */
-  uint32_t clut;  /* CLUT to use, not needed in this struct */
-  int32_t vts;    /* vts number to use */
-  int32_t domain; /* domain to use */
-  int32_t spu_channel; /* spu channel to use */
-  int32_t angle_channel; /* angle channel to use */
-  int32_t audio_channel; /* audio channel to use */
-  int32_t hop_channel; /* channel hopping. E.g menu button pressed */
-  int32_t title; /* title number */
-  int32_t chapter; /* chapter number */
-  int32_t cell; /* cell number */
-  int32_t cell_restart; /* get cell to restart */
-  int32_t still; /* is cell still */
-  int32_t vobu_start; /* block number of start of current VOBU in use */
-  int32_t vobu_next; /* block number within VOBU in use */
+  int16_t  button;        /* Button highlighted */
+  int32_t  vts;           /* vts number to use */
+  int32_t  domain;        /* domain to use */
+  int32_t  spu_channel;   /* spu channel to use */
+  int32_t  angle_channel; /* angle channel to use */
+  int32_t  audio_channel; /* audio channel to use */
+  int32_t  hop_channel;   /* channel hopping. E.g menu button pressed */
+  int32_t  title;         /* title number */
+  int32_t  chapter;       /* chapter number */
+  int32_t  cell;          /* cell number */
+  int32_t  cell_restart;  /* get cell to restart */
+  int32_t  cell_start;    /* sector number of start of current cell in use */
+  int32_t  still;         /* is cell still */
+  int32_t  block;         /* block number within cell in use */
 } vm_position_t;
 
 typedef struct {
@@ -86,13 +83,15 @@
   ifo_handle_t *vmgi;
   ifo_handle_t *vtsi;
   dvd_state_t   state;
-  int  badness_counter;
-  int32_t hop_channel;
-  char dvd_name[50];
-  int dvd_name_length;
-  remap_t *map;
+  int32_t       hop_channel;
+  char          dvd_name[50];
+  remap_t      *map;
+  int           stopped;
 } vm_t;
 
+/* magic number for seeking hops */
+#define HOP_SEEK 0x1000
+
 
 /*  Audio stream number */
 #define AST_REG      registers.SPRM[1]
@@ -115,7 +114,7 @@
 
 /* Initialisation & destruction */
 vm_t* vm_new_vm();
-void vm_free_vm(vm_t *vm);
+void  vm_free_vm(vm_t *vm);
 
 /* IFO access */
 ifo_handle_t *vm_get_vmgi(vm_t *vm);
@@ -124,38 +123,48 @@
 /* Reader Access */
 dvd_reader_t *vm_get_dvd_reader(vm_t *vm);
 
-/* Jumping */
-int vm_start_title(vm_t *vm, int tt);
-int vm_jump_prog(vm_t *vm, int pr);
+/* Basic Handling */
+void vm_start(vm_t *vm);
+void vm_stop(vm_t *vm);
+int  vm_reset(vm_t *vm, const char *dvdroot);
+
+/* regular playback */
+void vm_position_get(vm_t *vm, vm_position_t *position);
+void vm_get_next_cell(vm_t *vm);
+
+/* Jumping - all these return 1, if a hop has been performed */
+int vm_jump_pg(vm_t *vm, int pg);
 int vm_jump_title_part(vm_t *vm, int title, int part);
+int vm_jump_top_pg(vm_t *vm);
+int vm_jump_next_pg(vm_t *vm);
+int vm_jump_prev_pg(vm_t *vm);
+int vm_jump_up(vm_t *vm);
+int vm_jump_menu(vm_t *vm, DVDMenuID_t menuid);
+int vm_exec_cmd(vm_t *vm, vm_cmd_t *cmd);
 
-/* Other calls */
-int vm_reset(vm_t *vm, char *dvdroot); /*  , register_t regs); */
-int vm_start(vm_t *vm);
-int vm_position_get(vm_t *vm, vm_position_t *position);
-int vm_position_print(vm_t *vm, vm_position_t *position);
-int vm_eval_cmd(vm_t *vm, vm_cmd_t *cmd);
-int vm_get_next_cell(vm_t *vm);
-int vm_menu_call(vm_t *vm, DVDMenuID_t menuid, int block);
-int vm_resume(vm_t *vm);
-int vm_go_up(vm_t *vm);
-int vm_top_pg(vm_t *vm);
-int vm_next_pg(vm_t *vm);
-int vm_prev_pg(vm_t *vm);
+/* getting information */
+int vm_get_current_title_part(vm_t *vm, int *title_result, int *part_result);
 int vm_get_audio_stream(vm_t *vm, int audioN);
+int vm_get_subp_stream(vm_t *vm, int subpN, int mode);
 int vm_get_audio_active_stream(vm_t *vm);
-int vm_get_subp_stream(vm_t *vm, int subpN, int mode);
 int vm_get_subp_active_stream(vm_t *vm, int mode);
-void vm_get_angle_info(vm_t *vm, int *num_avail, int *current);
-void vm_get_audio_info(vm_t *vm, int *num_avail, int *current);
-void vm_get_subp_info(vm_t *vm, int *num_avail, int *current);
-int vm_get_current_title_part(vm_t *vm, int *title_result, int *part_result);
+void vm_get_angle_info(vm_t *vm, int *current, int *num_avail);
+#if 0
+/* currently unused */
+void vm_get_audio_info(vm_t *vm, int *current, int *num_avail);
+void vm_get_subp_info(vm_t *vm, int *current, int *num_avail);
+void vm_get_video_res(vm_t *vm, int *width, int *height);
+#endif
+int  vm_get_video_aspect(vm_t *vm);
+int  vm_get_video_scale_permission(vm_t *vm);
+video_attr_t vm_get_video_attr(vm_t *vm);
+audio_attr_t vm_get_audio_attr(vm_t *vm, int streamN);
+subp_attr_t  vm_get_subp_attr(vm_t *vm, int streamN);
 
-subp_attr_t vm_get_subp_attr(vm_t *vm, int streamN);
-audio_attr_t vm_get_audio_attr(vm_t *vm, int streamN);
-void vm_get_video_res(vm_t *vm, int *width, int *height);
-int vm_get_video_aspect(vm_t *vm);
-int vm_get_video_scale_permission(vm_t *vm);
+#ifdef TRACE
+/* Debug */
+void vm_position_print(vm_t *vm, vm_position_t *position);
+#endif
+
 
 #endif /* VM_HV_INCLUDED */
-