annotate dvd_reader.h @ 22:447c5319a522 src

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