Mercurial > libdvdnav.hg
annotate dvdnav_internal.h.in @ 116:4d711d0518e9 src
new event DVDNAV_WAIT
author | mroi |
---|---|
date | Tue, 25 Feb 2003 14:08:16 +0000 |
parents | b6834e6359cf |
children | f22458f928b8 |
rev | line source |
---|---|
35 | 1 /* |
2 * Copyright (C) 2001 Rich Wareham <richwareham@users.sourceforge.net> | |
3 * | |
4 * This file is part of libdvdnav, a DVD navigation library. | |
5 * | |
6 * libdvdnav is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * libdvdnav is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA | |
19 * | |
20 * $Id$ | |
21 * | |
22 */ | |
23 | |
24 #ifndef DVDNAV_INTERNAL_H_INCLUDED | |
25 #define DVDNAV_INTERNAL_H_INCLUDED | |
26 | |
27 #ifdef HAVE_CONFIG_H | |
28 #include "config.h" | |
29 #endif | |
30 | |
31 #include "dvdnav.h" | |
32 #include "vm.h" | |
33 | |
34 #include <stdlib.h> | |
35 #include <stdio.h> | |
36 #include <unistd.h> | |
37 #include <limits.h> | |
38 #include <string.h> | |
39 #include <pthread.h> | |
40 | |
41 @BIGENDIAN@ | |
42 | |
43 #include <dvdread/dvd_reader.h> | |
44 #include <dvdread/ifo_read.h> | |
45 #include <dvdread/ifo_types.h> | |
46 | |
47 | |
114 | 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 | |
35 | 54 /* Maximum length of an error string */ |
55 #define MAX_ERR_LEN 255 | |
56 | |
57 /* Use the POSIX PATH_MAX if available */ | |
58 #ifdef PATH_MAX | |
59 #define MAX_PATH_LEN PATH_MAX | |
60 #else | |
114 | 61 #define MAX_PATH_LEN 255 /* Arbitrary */ |
35 | 62 #endif |
63 | |
64 #ifndef DVD_VIDEO_LB_LEN | |
65 #define DVD_VIDEO_LB_LEN 2048 | |
66 #endif | |
67 | |
68 typedef struct read_cache_s read_cache_t; | |
69 | |
70 /* | |
71 * These are defined here because they are | |
72 * not in ifo_types.h, they maybe one day | |
73 */ | |
74 | |
75 #ifndef audio_status_t | |
76 typedef struct { | |
77 #ifdef WORDS_BIGENDIAN | |
78 unsigned int available : 1; | |
79 unsigned int zero1 : 4; | |
80 unsigned int stream_number : 3; | |
81 uint8_t zero2; | |
82 #else | |
83 uint8_t zero2; | |
84 unsigned int stream_number : 3; | |
85 unsigned int zero1 : 4; | |
86 unsigned int available : 1; | |
87 #endif | |
88 } ATTRIBUTE_PACKED audio_status_t; | |
89 #endif | |
90 | |
91 #ifndef spu_status_t | |
92 typedef struct { | |
93 #ifdef WORDS_BIGENDIAN | |
94 unsigned int available : 1; | |
95 unsigned int zero1 : 2; | |
96 unsigned int stream_number_4_3 : 5; | |
97 unsigned int zero2 : 3; | |
98 unsigned int stream_number_wide : 5; | |
99 unsigned int zero3 : 3; | |
100 unsigned int stream_number_letterbox : 5; | |
101 unsigned int zero4 : 3; | |
102 unsigned int stream_number_pan_scan : 5; | |
103 #else | |
104 unsigned int stream_number_pan_scan : 5; | |
105 unsigned int zero4 : 3; | |
106 unsigned int stream_number_letterbox : 5; | |
107 unsigned int zero3 : 3; | |
108 unsigned int stream_number_wide : 5; | |
109 unsigned int zero2 : 3; | |
110 unsigned int stream_number_4_3 : 5; | |
111 unsigned int zero1 : 2; | |
112 unsigned int available : 1; | |
113 #endif | |
114 } ATTRIBUTE_PACKED spu_status_t; | |
115 #endif | |
116 | |
117 typedef struct dvdnav_vobu_s { | |
114 | 118 int32_t vobu_start; /* Logical Absolute. MAX needed is 0x300000 */ |
119 int32_t vobu_length; | |
120 int32_t blockN; /* Relative offset */ | |
121 int32_t vobu_next; /* Relative offset */ | |
35 | 122 } dvdnav_vobu_t; |
123 | |
114 | 124 /** The main DVDNAV type **/ |
35 | 125 |
126 struct dvdnav_s { | |
127 /* General data */ | |
114 | 128 char path[MAX_PATH_LEN]; /* Path to DVD device/dir */ |
35 | 129 dvd_file_t *file; /* Currently opened file */ |
114 | 130 int open_vtsN; /* The domain and number of the... */ |
131 int open_domain; /* ..currently opened VOB */ | |
35 | 132 |
133 /* Position data */ | |
134 vm_position_t position_next; | |
135 vm_position_t position_current; | |
136 dvdnav_vobu_t vobu; | |
137 | |
138 /* NAV data */ | |
139 pci_t pci; | |
140 dsi_t dsi; | |
141 | |
142 /* Flags */ | |
114 | 143 int skip_still; /* Set when skipping a still */ |
116 | 144 int sync_wait; /* applications should wait till they are in sync with us */ |
145 int sync_wait_skip; /* Set when skipping wait state */ | |
114 | 146 int spu_clut_changed; /* The SPU CLUT changed */ |
147 int started; /* vm_start has been called? */ | |
148 int use_read_ahead; /* 1 - use read-ahead cache, 0 - don't */ | |
149 | |
35 | 150 /* VM */ |
114 | 151 vm_t *vm; |
35 | 152 pthread_mutex_t vm_lock; |
153 | |
154 /* Read-ahead cache */ | |
155 read_cache_t *cache; | |
156 | |
157 /* Errors */ | |
158 char err_str[MAX_ERR_LEN]; | |
159 }; | |
160 | |
161 /** USEFUL MACROS **/ | |
162 | |
107
b2801805c433
include some fixes done in xine's copy to avoid merging conflicts
mroi
parents:
89
diff
changeset
|
163 #ifdef __GNUC__ |
35 | 164 #define printerrf(format, args...) snprintf(this->err_str, MAX_ERR_LEN, format, ## args); |
107
b2801805c433
include some fixes done in xine's copy to avoid merging conflicts
mroi
parents:
89
diff
changeset
|
165 #else |
b2801805c433
include some fixes done in xine's copy to avoid merging conflicts
mroi
parents:
89
diff
changeset
|
166 #define printerrf(...) snprintf(this->err_str, MAX_ERR_LEN, __VA_ARGS__); |
b2801805c433
include some fixes done in xine's copy to avoid merging conflicts
mroi
parents:
89
diff
changeset
|
167 #endif |
35 | 168 #define printerr(str) strncpy(this->err_str, str, MAX_ERR_LEN); |
114 | 169 |
35 | 170 /* Save my typing */ |
171 #define S_ERR DVDNAV_STATUS_ERR | |
172 #define S_OK DVDNAV_STATUS_OK | |
173 | |
174 #endif /* DVDNAV_INTERNAL_H_INCLUDED */ |