1 /* @(#)dvd_reader.h	1.4 18/09/17 joerg */
2 
3 #ifndef	_DVD_READER_H
4 #define	_DVD_READER_H
5 
6 /*
7  * Copyright (C) 2001, 2002 Billy Biggs <vektor@dumbterm.net>,
8  *			    H�kan Hjort <d95hjort@dtek.chalmers.se
9  *			    Olaf Beck <olaf_sc@yahoo.com>
10  *			    (I only did the cut down no other contribs)
11  *
12  * Copyright (C) 2001, 2002-2015 J�rg Schilling <joerg@schily.net>
13  *
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 2 of the License, or (at
17  * your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful, but
20  * WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22  * General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, write to the Free Software
26  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
27  */
28 
29 /*
30  * NOTE: This is a cut down version of libdvdread for mkisofs, due
31  * to portability issues with the current libdvdread according to
32  * the maintainer of mkisofs.
33  * This cut down version only reads from a harddisk file structure
34  * and it only implements the functions necessary inorder to make
35  * mkisofs produce valid DVD-Video images.
36  * DON'T USE THIS LIBRARY IN ANY OTHER PROGRAM GET THE REAL
37  * LIBDVDREAD INSTEAD
38  */
39 
40 
41 #include <schily/unistd.h>	/* Make sure <sys/types.h> is included */
42 
43 /*
44  * Maximum length of filenames for UDF.
45  */
46 #define	MAX_UDF_FILE_NAME_LEN 2048
47 
48 /*
49  * The length of one Logical Block of a DVD Video.
50  */
51 #define	DVD_VIDEO_LB_LEN 2048
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
57 
58 struct dvd_reader_s {
59 	/* Information required for a directory path drive. */
60 	char	*path_root;
61 };
62 
63 
64 typedef struct dvd_reader_s	dvd_reader_t;
65 typedef struct dvd_file_s	dvd_file_t;
66 
67 
68 /*
69  * dvd = DVDOpen(path);
70  * Opens a directory name of a DVD-Video structure on HD.
71  * Returns zero if it fails.
72  * The path should be like this
73  * "path/VIDEO_TS/VTS_01_1.VOB"
74  */
75 
76 
77 extern	dvd_reader_t *DVDOpen	__PR((const char *));
78 
79 
80 /*
81  * DVDClose(dvd);
82  *
83  * Closes and cleans up the DVD reader object.  You must close all open files
84  * before calling this function.
85  */
86 
87 
88 extern	void DVDClose		__PR((dvd_reader_t *));
89 
90 /*
91  * INFO_FILE       : VIDEO_TS.IFO     (manager)
92  *                   VTS_XX_0.IFO     (title)
93  *
94  * INFO_BACKUP_FILE: VIDEO_TS.BUP     (manager)
95  *                   VTS_XX_0.BUP     (title)
96  *
97  * MENU_VOBS       : VIDEO_TS.VOB     (manager)
98  *                   VTS_XX_0.VOB     (title)
99  *
100  * TITLE_VOBS      : VTS_XX_[1-9].VOB (title)
101  *                   All files in the title set are opened and
102  *                   read as a single file.
103  */
104 typedef enum {
105 	DVD_READ_INFO_FILE,
106 	DVD_READ_INFO_BACKUP_FILE,
107 	DVD_READ_MENU_VOBS,
108 	DVD_READ_TITLE_VOBS
109 } dvd_read_domain_t;
110 
111 /*
112  * dvd_file = DVDOpenFile(dvd, titlenum, domain);
113  *
114  * Opens a file on the DVD given the title number and domain.  If the title
115  * number is 0, the video manager information is opened
116  * (VIDEO_TS.[IFO,BUP,VOB]).  Returns a file structure which may be used for
117  * reads, or 0 if the file was not found.
118  */
119 extern	dvd_file_t * DVDOpenFile	__PR((dvd_reader_t *, int, dvd_read_domain_t));
120 
121 /*
122  * DVDCloseFile(dvd_file);
123  *
124  * Closes a file and frees the associated structure.
125  */
126 extern	void DVDCloseFile		__PR((dvd_file_t *));
127 
128 
129 /*
130  * blocks = DVDFileSize(dvd_file);
131  *
132  * Returns the file size in blocks.
133  */
134 extern	ssize_t DVDFileSize		__PR((dvd_file_t *));
135 
136 
137 #ifdef __cplusplus
138 };
139 #endif
140 #endif /* _DVD_READER_H */
141