comparison dvdnav_internal.h.in @ 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 b2801805c433
children 4d711d0518e9
comparison
equal deleted inserted replaced
113:ec2df154be56 114:b6834e6359cf
43 #include <dvdread/dvd_reader.h> 43 #include <dvdread/dvd_reader.h>
44 #include <dvdread/ifo_read.h> 44 #include <dvdread/ifo_read.h>
45 #include <dvdread/ifo_types.h> 45 #include <dvdread/ifo_types.h>
46 46
47 47
48 /* Uncomment for VM command tracing */
49 /* #define TRACE */
50
51 /* where should libdvdnav write its messages (stdout/stderr) */
52 #define MSG_OUT stdout
53
48 /* Maximum length of an error string */ 54 /* Maximum length of an error string */
49 #define MAX_ERR_LEN 255 55 #define MAX_ERR_LEN 255
50 56
51 /* Use the POSIX PATH_MAX if available */ 57 /* Use the POSIX PATH_MAX if available */
52 #ifdef PATH_MAX 58 #ifdef PATH_MAX
53 #define MAX_PATH_LEN PATH_MAX 59 #define MAX_PATH_LEN PATH_MAX
54 #else 60 #else
55 #define MAX_PATH_LEN 255 /* Arbitary */ 61 #define MAX_PATH_LEN 255 /* Arbitrary */
56 #endif 62 #endif
57 63
58 #ifndef DVD_VIDEO_LB_LEN 64 #ifndef DVD_VIDEO_LB_LEN
59 #define DVD_VIDEO_LB_LEN 2048 65 #define DVD_VIDEO_LB_LEN 2048
60 #endif 66 #endif
61
62 /* where should libdvdnav write its messages (stdout/stderr) */
63 #define MSG_OUT stdout
64 67
65 typedef struct read_cache_s read_cache_t; 68 typedef struct read_cache_s read_cache_t;
66 69
67 /* 70 /*
68 * These are defined here because they are 71 * These are defined here because they are
110 #endif 113 #endif
111 } ATTRIBUTE_PACKED spu_status_t; 114 } ATTRIBUTE_PACKED spu_status_t;
112 #endif 115 #endif
113 116
114 typedef struct dvdnav_vobu_s { 117 typedef struct dvdnav_vobu_s {
115 int32_t vobu_start; /* Logical Absolute. MAX needed is 0x300000 */ 118 int32_t vobu_start; /* Logical Absolute. MAX needed is 0x300000 */
116 int32_t vobu_length; /* Relative offset */ 119 int32_t vobu_length;
117 int32_t blockN; /* Relative offset */ 120 int32_t blockN; /* Relative offset */
118 int32_t vobu_next; /* Relative offset */ 121 int32_t vobu_next; /* Relative offset */
119 } dvdnav_vobu_t; 122 } dvdnav_vobu_t;
120 123
121 /* The main DVDNAV type */ 124 /** The main DVDNAV type **/
122 125
123 struct dvdnav_s { 126 struct dvdnav_s {
124 /* General data */ 127 /* General data */
125 char path[MAX_PATH_LEN]; /* Path to DVD device/dir */ 128 char path[MAX_PATH_LEN]; /* Path to DVD device/dir */
126 dvd_file_t *file; /* Currently opened file */ 129 dvd_file_t *file; /* Currently opened file */
127 int open_vtsN; /* The domain and number of the... */ 130 int open_vtsN; /* The domain and number of the... */
128 int open_domain; /* ..currently opened VOB */ 131 int open_domain; /* ..currently opened VOB */
129 132
130 /* Position data */ 133 /* Position data */
131 vm_position_t position_next; 134 vm_position_t position_next;
132 vm_position_t position_current; 135 vm_position_t position_current;
133 dvdnav_vobu_t vobu; 136 dvdnav_vobu_t vobu;
135 /* NAV data */ 138 /* NAV data */
136 pci_t pci; 139 pci_t pci;
137 dsi_t dsi; 140 dsi_t dsi;
138 141
139 /* Flags */ 142 /* Flags */
140 int skip_still; /* Set when skipping a still */ 143 int skip_still; /* Set when skipping a still */
141 int stop; /* Are we stopped? (note not paused, actually stopped) */ 144 int spu_clut_changed; /* The SPU CLUT changed */
142 int spu_clut_changed; /* The SPU CLUT changed */ 145 int started; /* vm_start has been called? */
143 int started; /* vm_start has been called? */ 146 int use_read_ahead; /* 1 - use read-ahead cache, 0 - don't */
144 int use_read_ahead; /* 1 - use read-ahead cache, 0 - don't */ 147
145 /* VM */ 148 /* VM */
146 vm_t* vm; 149 vm_t *vm;
147 pthread_mutex_t vm_lock; 150 pthread_mutex_t vm_lock;
148
149 /* Highlight */
150 int hli_state; /* State of highlight: 0 - disabled,
151 1 - selected,
152 2 - activated */
153 151
154 /* Read-ahead cache */ 152 /* Read-ahead cache */
155 read_cache_t *cache; 153 read_cache_t *cache;
156 154
157 /* Errors */ 155 /* Errors */
164 #define printerrf(format, args...) snprintf(this->err_str, MAX_ERR_LEN, format, ## args); 162 #define printerrf(format, args...) snprintf(this->err_str, MAX_ERR_LEN, format, ## args);
165 #else 163 #else
166 #define printerrf(...) snprintf(this->err_str, MAX_ERR_LEN, __VA_ARGS__); 164 #define printerrf(...) snprintf(this->err_str, MAX_ERR_LEN, __VA_ARGS__);
167 #endif 165 #endif
168 #define printerr(str) strncpy(this->err_str, str, MAX_ERR_LEN); 166 #define printerr(str) strncpy(this->err_str, str, MAX_ERR_LEN);
167
169 /* Save my typing */ 168 /* Save my typing */
170
171 #define S_ERR DVDNAV_STATUS_ERR 169 #define S_ERR DVDNAV_STATUS_ERR
172 #define S_OK DVDNAV_STATUS_OK 170 #define S_OK DVDNAV_STATUS_OK
173 171
174 #endif /* DVDNAV_INTERNAL_H_INCLUDED */ 172 #endif /* DVDNAV_INTERNAL_H_INCLUDED */