annotate dvdread/dvd_reader.h @ 366:5b8539cacebf src

workaround wrong filesize indicated in the UDF; patch by unknown author posted by Alexander Roalter it
author nicodvb
date Tue, 27 May 2008 21:53:10 +0000
parents 59b5753b09d7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
225
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
1 #ifndef DVD_READER_H_INCLUDED
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
2 #define DVD_READER_H_INCLUDED
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
3
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
4 /*
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
5 * Copyright (C) 2001, 2002 Billy Biggs <vektor@dumbterm.net>,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
6 * Håkan Hjort <d95hjort@dtek.chalmers.se>,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
7 * Björn Englund <d4bjorn@dtek.chalmers.se>
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
8 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or modify
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or (at
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
12 * your option) any later version.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
13 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful, but
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
17 * General Public License for more details.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
18 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
20 * along with this program; if not, write to the Free Software
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
22 */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
23
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
24 #ifdef _MSC_VER
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
25 #include <config.h>
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
26
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
27 #include <stdio.h>
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
28 #include <stdlib.h>
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
29 #endif
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
30
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
31 #include <sys/types.h>
233
59b5753b09d7 Add support for building under MINGW.
jcdutton
parents: 225
diff changeset
32 #include <inttypes.h>
225
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
33
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
34 /**
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
35 * The DVD access interface.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
36 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
37 * This file contains the functions that form the interface to to
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
38 * reading files located on a DVD.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
39 */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
40
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
41 /**
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
42 * The current version.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
43 */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
44 #define DVDREAD_VERSION 904
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
45
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
46 /**
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
47 * The length of one Logical Block of a DVD.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
48 */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
49 #define DVD_VIDEO_LB_LEN 2048
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
50
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
51 /**
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
52 * Maximum length of filenames allowed in UDF.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
53 */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
54 #define MAX_UDF_FILE_NAME_LEN 2048
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
55
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
56 #ifdef __cplusplus
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
57 extern "C" {
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
58 #endif
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
59
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
60 /**
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
61 * Opaque type that is used as a handle for one instance of an opened DVD.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
62 */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
63 typedef struct dvd_reader_s dvd_reader_t;
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
64
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
65 /**
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
66 * Opaque type for a file read handle, much like a normal fd or FILE *.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
67 */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
68 typedef struct dvd_file_s dvd_file_t;
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
69
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
70 /**
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
71 * Opens a block device of a DVD-ROM file, or an image file, or a directory
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
72 * name for a mounted DVD or HD copy of a DVD.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
73 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
74 * If the given file is a block device, or is the mountpoint for a block
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
75 * device, then that device is used for CSS authentication using libdvdcss.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
76 * If no device is available, then no CSS authentication is performed,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
77 * and we hope that the image is decrypted.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
78 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
79 * If the path given is a directory, then the files in that directory may be
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
80 * in any one of these formats:
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
81 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
82 * path/VIDEO_TS/VTS_01_1.VOB
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
83 * path/video_ts/vts_01_1.vob
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
84 * path/VTS_01_1.VOB
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
85 * path/vts_01_1.vob
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
86 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
87 * @param path Specifies the the device, file or directory to be used.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
88 * @return If successful a a read handle is returned. Otherwise 0 is returned.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
89 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
90 * dvd = DVDOpen(path);
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
91 */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
92 dvd_reader_t *DVDOpen( const char * );
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
93
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
94 /**
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
95 * Closes and cleans up the DVD reader object.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
96 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
97 * You must close all open files before calling this function.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
98 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
99 * @param dvd A read handle that should be closed.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
100 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
101 * DVDClose(dvd);
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
102 */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
103 void DVDClose( dvd_reader_t * );
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
104
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
105 /**
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
106 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
107 */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
108 typedef enum {
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
109 DVD_READ_INFO_FILE, /**< VIDEO_TS.IFO or VTS_XX_0.IFO (title) */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
110 DVD_READ_INFO_BACKUP_FILE, /**< VIDEO_TS.BUP or VTS_XX_0.BUP (title) */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
111 DVD_READ_MENU_VOBS, /**< VIDEO_TS.VOB or VTS_XX_0.VOB (title) */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
112 DVD_READ_TITLE_VOBS /**< VTS_XX_[1-9].VOB (title). All files in
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
113 the title set are opened and read as a
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
114 single file. */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
115 } dvd_read_domain_t;
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
116
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
117 /**
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
118 * Opens a file on the DVD given the title number and domain.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
119 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
120 * If the title number is 0, the video manager information is opened
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
121 * (VIDEO_TS.[IFO,BUP,VOB]). Returns a file structure which may be
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
122 * used for reads, or 0 if the file was not found.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
123 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
124 * @param dvd A dvd read handle.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
125 * @param titlenum Which Video Title Set should be used, VIDEO_TS is 0.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
126 * @param domain Which domain.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
127 * @return If successful a a file read handle is returned, otherwise 0.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
128 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
129 * dvd_file = DVDOpenFile(dvd, titlenum, domain); */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
130 dvd_file_t *DVDOpenFile( dvd_reader_t *, int, dvd_read_domain_t );
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
131
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
132 /**
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
133 * Closes a file and frees the associated structure.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
134 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
135 * @param dvd_file The file read handle to be closed.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
136 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
137 * DVDCloseFile(dvd_file);
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
138 */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
139 void DVDCloseFile( dvd_file_t * );
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
140
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
141 /**
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
142 * Reads block_count number of blocks from the file at the given block offset.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
143 * Returns number of blocks read on success, -1 on error. This call is only
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
144 * for reading VOB data, and should not be used when reading the IFO files.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
145 * When reading from an encrypted drive, blocks are decrypted using libdvdcss
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
146 * where required.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
147 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
148 * @param dvd_file A file read handle.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
149 * @param offset Block offset from the start of the file to start reading at.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
150 * @param block_count Number of block to read.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
151 * @param data Pointer to a buffer to write the data into.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
152 * @return Returns number of blocks read on success, -1 on error.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
153 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
154 * blocks_read = DVDReadBlocks(dvd_file, offset, block_count, data);
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
155 */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
156 ssize_t DVDReadBlocks( dvd_file_t *, int, size_t, unsigned char * );
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
157
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
158 /**
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
159 * Seek to the given position in the file. Returns the resulting position in
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
160 * bytes from the beginning of the file. The seek position is only used for
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
161 * byte reads from the file, the block read call always reads from the given
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
162 * offset.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
163 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
164 * @param dvd_file A file read handle.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
165 * @param seek_offset Byte offset from the start of the file to seek to.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
166 * @return The resulting position in bytes from the beginning of the file.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
167 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
168 * offset_set = DVDFileSeek(dvd_file, seek_offset);
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
169 */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
170 int32_t DVDFileSeek( dvd_file_t *, int32_t );
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
171
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
172 /**
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
173 * Reads the given number of bytes from the file. This call can only be used
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
174 * on the information files, and may not be used for reading from a VOB. This
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
175 * reads from and increments the currrent seek position for the file.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
176 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
177 * @param dvd_file A file read handle.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
178 * @param data Pointer to a buffer to write the data into.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
179 * @param bytes Number of bytes to read.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
180 * @return Returns number of bytes read on success, -1 on error.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
181 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
182 * bytes_read = DVDReadBytes(dvd_file, data, bytes);
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
183 */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
184 ssize_t DVDReadBytes( dvd_file_t *, void *, size_t );
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
185
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
186 /**
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
187 * Returns the file size in blocks.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
188 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
189 * @param dvd_file A file read handle.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
190 * @return The size of the file in blocks, -1 on error.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
191 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
192 * blocks = DVDFileSize(dvd_file);
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
193 */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
194 ssize_t DVDFileSize( dvd_file_t * );
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
195
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
196 /**
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
197 * Get a unique 128 bit disc ID.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
198 * This is the MD5 sum of VIDEO_TS.IFO and the VTS_0?_0.IFO files
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
199 * in title order (those that exist).
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
200 * If you need a 'text' representation of the id, print it as a
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
201 * hexadecimal number, using lowercase letters, discid[0] first.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
202 * I.e. the same format as the command-line 'md5sum' program uses.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
203 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
204 * @param dvd A read handle to get the disc ID from
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
205 * @param discid The buffer to put the disc ID into. The buffer must
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
206 * have room for 128 bits (16 chars).
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
207 * @return 0 on success, -1 on error.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
208 */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
209 int DVDDiscID( dvd_reader_t *, unsigned char * );
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
210
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
211 /**
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
212 * Get the UDF VolumeIdentifier and VolumeSetIdentifier
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
213 * from the PrimaryVolumeDescriptor.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
214 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
215 * @param dvd A read handle to get the disc ID from
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
216 * @param volid The buffer to put the VolumeIdentifier into.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
217 * The VolumeIdentifier is latin-1 encoded (8bit unicode)
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
218 * null terminated and max 32 bytes (including '\0')
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
219 * @param volid_size No more than volid_size bytes will be copied to volid.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
220 * If the VolumeIdentifier is truncated because of this
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
221 * it will still be null terminated.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
222 * @param volsetid The buffer to put the VolumeSetIdentifier into.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
223 * The VolumeIdentifier is 128 bytes as
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
224 * stored in the UDF PrimaryVolumeDescriptor.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
225 * Note that this is not a null terminated string.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
226 * @param volsetid_size At most volsetid_size bytes will be copied to volsetid.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
227 * @return 0 on success, -1 on error.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
228 */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
229 int DVDUDFVolumeInfo( dvd_reader_t *, char *, unsigned int,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
230 unsigned char *, unsigned int );
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
231
366
5b8539cacebf workaround wrong filesize indicated in the UDF; patch by unknown author posted by Alexander Roalter it
nicodvb
parents: 233
diff changeset
232 int DVDFileSeekForce( dvd_file_t *, int offset, int force_size);
5b8539cacebf workaround wrong filesize indicated in the UDF; patch by unknown author posted by Alexander Roalter it
nicodvb
parents: 233
diff changeset
233
225
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
234 /**
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
235 * Get the ISO9660 VolumeIdentifier and VolumeSetIdentifier
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
236 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
237 * * Only use this function as fallback if DVDUDFVolumeInfo returns 0 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
238 * * this will happen on a disc mastered only with a iso9660 filesystem *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
239 * * All video DVD discs have UDF filesystem *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
240 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
241 * @param dvd A read handle to get the disc ID from
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
242 * @param volid The buffer to put the VolumeIdentifier into.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
243 * The VolumeIdentifier is coded with '0-9','A-Z','_'
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
244 * null terminated and max 33 bytes (including '\0')
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
245 * @param volid_size No more than volid_size bytes will be copied to volid.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
246 * If the VolumeIdentifier is truncated because of this
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
247 * it will still be null terminated.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
248 * @param volsetid The buffer to put the VolumeSetIdentifier into.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
249 * The VolumeIdentifier is 128 bytes as
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
250 * stored in the ISO9660 PrimaryVolumeDescriptor.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
251 * Note that this is not a null terminated string.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
252 * @param volsetid_size At most volsetid_size bytes will be copied to volsetid.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
253 * @return 0 on success, -1 on error.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
254 */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
255 int DVDISOVolumeInfo( dvd_reader_t *, char *, unsigned int,
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
256 unsigned char *, unsigned int );
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
257
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
258 /**
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
259 * Sets the level of caching that is done when reading from a device
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
260 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
261 * @param dvd A read handle to get the disc ID from
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
262 * @param level The level of caching wanted.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
263 * -1 - returns the current setting.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
264 * 0 - UDF Cache turned off.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
265 * 1 - (default level) Pointers to IFO files and some data from
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
266 * PrimaryVolumeDescriptor are cached.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
267 *
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
268 * @return The level of caching.
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
269 */
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
270 int DVDUDFCacheLevel( dvd_reader_t *, int );
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
271
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
272 #ifdef __cplusplus
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
273 };
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
274 #endif
9b1b740e3fc9 big build system changes
mroi
parents:
diff changeset
275 #endif /* DVD_READER_H_INCLUDED */