Mercurial > libdvdnav.hg
annotate dvdnav_internal.h.in @ 192:a3d7b149cc0f src
revert strange changes from Tim that broke compilation
(sorry, since I do not understand the purpose of this patch, I reverted it
completely)
author | mroi |
---|---|
date | Tue, 06 May 2003 20:54:59 +0000 |
parents | dbea22936623 |
children | b80dff4bef76 |
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 <stdlib.h> | |
32 #include <stdio.h> | |
33 #include <unistd.h> | |
34 #include <limits.h> | |
35 #include <string.h> | |
36 #include <pthread.h> | |
37 | |
38 @BIGENDIAN@ | |
39 | |
169 | 40 #include "dvd_reader.h" |
41 #include "ifo_read.h" | |
42 #include "ifo_types.h" | |
35 | 43 |
114 | 44 /* Uncomment for VM command tracing */ |
45 /* #define TRACE */ | |
46 | |
136
5897ff629f7c
reorganize mutual header inclusion to fix warnings when compiling with TRACE defined
mroi
parents:
132
diff
changeset
|
47 #include "decoder.h" |
5897ff629f7c
reorganize mutual header inclusion to fix warnings when compiling with TRACE defined
mroi
parents:
132
diff
changeset
|
48 #include "dvdnav.h" |
5897ff629f7c
reorganize mutual header inclusion to fix warnings when compiling with TRACE defined
mroi
parents:
132
diff
changeset
|
49 #include "vm.h" |
5897ff629f7c
reorganize mutual header inclusion to fix warnings when compiling with TRACE defined
mroi
parents:
132
diff
changeset
|
50 #include "vmcmd.h" |
5897ff629f7c
reorganize mutual header inclusion to fix warnings when compiling with TRACE defined
mroi
parents:
132
diff
changeset
|
51 |
114 | 52 /* where should libdvdnav write its messages (stdout/stderr) */ |
53 #define MSG_OUT stdout | |
54 | |
35 | 55 /* Maximum length of an error string */ |
56 #define MAX_ERR_LEN 255 | |
57 | |
58 /* Use the POSIX PATH_MAX if available */ | |
59 #ifdef PATH_MAX | |
60 #define MAX_PATH_LEN PATH_MAX | |
61 #else | |
114 | 62 #define MAX_PATH_LEN 255 /* Arbitrary */ |
35 | 63 #endif |
64 | |
65 #ifndef DVD_VIDEO_LB_LEN | |
66 #define DVD_VIDEO_LB_LEN 2048 | |
67 #endif | |
68 | |
69 typedef struct read_cache_s read_cache_t; | |
70 | |
71 /* | |
72 * These are defined here because they are | |
73 * not in ifo_types.h, they maybe one day | |
74 */ | |
75 | |
76 #ifndef audio_status_t | |
77 typedef struct { | |
78 #ifdef WORDS_BIGENDIAN | |
79 unsigned int available : 1; | |
80 unsigned int zero1 : 4; | |
81 unsigned int stream_number : 3; | |
82 uint8_t zero2; | |
83 #else | |
84 uint8_t zero2; | |
85 unsigned int stream_number : 3; | |
86 unsigned int zero1 : 4; | |
87 unsigned int available : 1; | |
88 #endif | |
89 } ATTRIBUTE_PACKED audio_status_t; | |
90 #endif | |
91 | |
92 #ifndef spu_status_t | |
93 typedef struct { | |
94 #ifdef WORDS_BIGENDIAN | |
95 unsigned int available : 1; | |
96 unsigned int zero1 : 2; | |
97 unsigned int stream_number_4_3 : 5; | |
98 unsigned int zero2 : 3; | |
99 unsigned int stream_number_wide : 5; | |
100 unsigned int zero3 : 3; | |
101 unsigned int stream_number_letterbox : 5; | |
102 unsigned int zero4 : 3; | |
103 unsigned int stream_number_pan_scan : 5; | |
104 #else | |
105 unsigned int stream_number_pan_scan : 5; | |
106 unsigned int zero4 : 3; | |
107 unsigned int stream_number_letterbox : 5; | |
108 unsigned int zero3 : 3; | |
109 unsigned int stream_number_wide : 5; | |
110 unsigned int zero2 : 3; | |
111 unsigned int stream_number_4_3 : 5; | |
112 unsigned int zero1 : 2; | |
113 unsigned int available : 1; | |
114 #endif | |
115 } ATTRIBUTE_PACKED spu_status_t; | |
116 #endif | |
117 | |
118 typedef struct dvdnav_vobu_s { | |
114 | 119 int32_t vobu_start; /* Logical Absolute. MAX needed is 0x300000 */ |
120 int32_t vobu_length; | |
121 int32_t blockN; /* Relative offset */ | |
122 int32_t vobu_next; /* Relative offset */ | |
35 | 123 } dvdnav_vobu_t; |
124 | |
114 | 125 /** The main DVDNAV type **/ |
35 | 126 |
127 struct dvdnav_s { | |
128 /* General data */ | |
114 | 129 char path[MAX_PATH_LEN]; /* Path to DVD device/dir */ |
35 | 130 dvd_file_t *file; /* Currently opened file */ |
114 | 131 int open_vtsN; /* The domain and number of the... */ |
132 int open_domain; /* ..currently opened VOB */ | |
35 | 133 |
134 /* Position data */ | |
135 vm_position_t position_next; | |
136 vm_position_t position_current; | |
137 dvdnav_vobu_t vobu; | |
138 | |
139 /* NAV data */ | |
140 pci_t pci; | |
141 dsi_t dsi; | |
191
dbea22936623
when a command has been issued to leave a menu, filter all further commands
mroi
parents:
177
diff
changeset
|
142 uint32_t last_cmd_nav_lbn; /* detects when a command is issued on an already left NAV */ |
35 | 143 |
144 /* Flags */ | |
114 | 145 int skip_still; /* Set when skipping a still */ |
116 | 146 int sync_wait; /* applications should wait till they are in sync with us */ |
147 int sync_wait_skip; /* Set when skipping wait state */ | |
114 | 148 int spu_clut_changed; /* The SPU CLUT changed */ |
149 int started; /* vm_start has been called? */ | |
150 int use_read_ahead; /* 1 - use read-ahead cache, 0 - don't */ | |
132 | 151 int pgc_based; /* positioning works PGC based instead of PG based */ |
114 | 152 |
35 | 153 /* VM */ |
114 | 154 vm_t *vm; |
35 | 155 pthread_mutex_t vm_lock; |
156 | |
157 /* Read-ahead cache */ | |
158 read_cache_t *cache; | |
159 | |
160 /* Errors */ | |
161 char err_str[MAX_ERR_LEN]; | |
162 }; | |
163 | |
164 /** USEFUL MACROS **/ | |
165 | |
107
b2801805c433
include some fixes done in xine's copy to avoid merging conflicts
mroi
parents:
89
diff
changeset
|
166 #ifdef __GNUC__ |
35 | 167 #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
|
168 #else |
177 | 169 #ifdef _MSC_VER |
170 #define printerrf(str) snprintf(this->err_str, MAX_ERR_LEN, str); | |
171 #else | |
107
b2801805c433
include some fixes done in xine's copy to avoid merging conflicts
mroi
parents:
89
diff
changeset
|
172 #define printerrf(...) snprintf(this->err_str, MAX_ERR_LEN, __VA_ARGS__); |
177 | 173 #endif /* WIN32 */ |
107
b2801805c433
include some fixes done in xine's copy to avoid merging conflicts
mroi
parents:
89
diff
changeset
|
174 #endif |
35 | 175 #define printerr(str) strncpy(this->err_str, str, MAX_ERR_LEN); |
114 | 176 |
35 | 177 /* Save my typing */ |
178 #define S_ERR DVDNAV_STATUS_ERR | |
177 | 179 |
180 #ifndef _MSC_VER | |
35 | 181 #define S_OK DVDNAV_STATUS_OK |
177 | 182 #endif /* MSC_VER */ |
35 | 183 |
184 #endif /* DVDNAV_INTERNAL_H_INCLUDED */ |