Mercurial > libdvdnav.hg
annotate dvdnav_internal.h.in @ 89:0fbef4901e2c src
Add a comment so I can tell which version of the CVS a user is using.
Also add a FIXME to remind me to fix the Chapter number display.
author | jcdutton |
---|---|
date | Tue, 03 Sep 2002 00:41:48 +0000 |
parents | 0e2abe7083de |
children | b2801805c433 |
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 | |
48 /* Maximum length of an error string */ | |
49 #define MAX_ERR_LEN 255 | |
50 | |
51 /* Use the POSIX PATH_MAX if available */ | |
52 #ifdef PATH_MAX | |
53 #define MAX_PATH_LEN PATH_MAX | |
54 #else | |
55 #define MAX_PATH_LEN 255 /* Arbitary */ | |
56 #endif | |
57 | |
58 #ifndef DVD_VIDEO_LB_LEN | |
59 #define DVD_VIDEO_LB_LEN 2048 | |
60 #endif | |
61 | |
76 | 62 /* where should libdvdnav write its messages (stdout/stderr) */ |
89
0fbef4901e2c
Add a comment so I can tell which version of the CVS a user is using.
jcdutton
parents:
76
diff
changeset
|
63 #define MSG_OUT stdout |
76 | 64 |
35 | 65 typedef struct read_cache_s read_cache_t; |
66 | |
67 /* | |
68 * These are defined here because they are | |
69 * not in ifo_types.h, they maybe one day | |
70 */ | |
71 | |
72 #ifndef audio_status_t | |
73 typedef struct { | |
74 #ifdef WORDS_BIGENDIAN | |
75 unsigned int available : 1; | |
76 unsigned int zero1 : 4; | |
77 unsigned int stream_number : 3; | |
78 uint8_t zero2; | |
79 #else | |
80 uint8_t zero2; | |
81 unsigned int stream_number : 3; | |
82 unsigned int zero1 : 4; | |
83 unsigned int available : 1; | |
84 #endif | |
85 } ATTRIBUTE_PACKED audio_status_t; | |
86 #endif | |
87 | |
88 #ifndef spu_status_t | |
89 typedef struct { | |
90 #ifdef WORDS_BIGENDIAN | |
91 unsigned int available : 1; | |
92 unsigned int zero1 : 2; | |
93 unsigned int stream_number_4_3 : 5; | |
94 unsigned int zero2 : 3; | |
95 unsigned int stream_number_wide : 5; | |
96 unsigned int zero3 : 3; | |
97 unsigned int stream_number_letterbox : 5; | |
98 unsigned int zero4 : 3; | |
99 unsigned int stream_number_pan_scan : 5; | |
100 #else | |
101 unsigned int stream_number_pan_scan : 5; | |
102 unsigned int zero4 : 3; | |
103 unsigned int stream_number_letterbox : 5; | |
104 unsigned int zero3 : 3; | |
105 unsigned int stream_number_wide : 5; | |
106 unsigned int zero2 : 3; | |
107 unsigned int stream_number_4_3 : 5; | |
108 unsigned int zero1 : 2; | |
109 unsigned int available : 1; | |
110 #endif | |
111 } ATTRIBUTE_PACKED spu_status_t; | |
112 #endif | |
113 | |
114 typedef struct dvdnav_vobu_s { | |
115 int32_t vobu_start; /* Logical Absolute. MAX needed is 0x300000 */ | |
116 int32_t vobu_length; /* Relative offset */ | |
117 int32_t blockN; /* Relative offset */ | |
118 int32_t vobu_next; /* Relative offset */ | |
119 } dvdnav_vobu_t; | |
120 | |
121 /* The main DVDNAV type */ | |
122 | |
123 struct dvdnav_s { | |
124 /* General data */ | |
125 char path[MAX_PATH_LEN]; /* Path to DVD device/dir */ | |
126 dvd_file_t *file; /* Currently opened file */ | |
127 int open_vtsN; /* The domain and number of the... */ | |
128 int open_domain; /* ..currently opened VOB */ | |
129 | |
130 /* Position data */ | |
131 vm_position_t position_next; | |
132 vm_position_t position_current; | |
133 dvdnav_vobu_t vobu; | |
134 | |
135 /* NAV data */ | |
136 pci_t pci; | |
137 dsi_t dsi; | |
138 | |
139 /* Flags */ | |
140 int skip_still; /* Set when skipping a still */ | |
141 int stop; /* Are we stopped? (note not paused, actually stopped) */ | |
142 int spu_clut_changed; /* The SPU CLUT changed */ | |
143 int started; /* vm_start has been called? */ | |
144 int use_read_ahead; /* 1 - use read-ahead cache, 0 - don't */ | |
145 /* VM */ | |
146 vm_t* vm; | |
147 pthread_mutex_t vm_lock; | |
148 | |
149 /* Highlight */ | |
150 int hli_state; /* State of highlight: 0 - disabled, | |
151 1 - selected, | |
152 2 - activated */ | |
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 | |
163 #define printerrf(format, args...) snprintf(this->err_str, MAX_ERR_LEN, format, ## args); | |
164 #define printerr(str) strncpy(this->err_str, str, MAX_ERR_LEN); | |
165 /* Save my typing */ | |
166 | |
167 #define S_ERR DVDNAV_STATUS_ERR | |
168 #define S_OK DVDNAV_STATUS_OK | |
169 | |
170 #endif /* DVDNAV_INTERNAL_H_INCLUDED */ |