xbmc
dvd_reader.h
1 /*
2  * Copyright (C) 2001, 2002 Billy Biggs <vektor@dumbterm.net>,
3  * Håkan Hjort <d95hjort@dtek.chalmers.se>,
4  * Björn Englund <d4bjorn@dtek.chalmers.se>
5  *
6  * This file is part of libdvdread.
7  *
8  * libdvdread is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * libdvdread is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with libdvdread; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22 
23 #pragma once
24 
25 #ifdef _MSC_VER
26 #include "config.h"
27 
28 #include <stdio.h>
29 #include <stdlib.h>
30 #endif
31 
32 #include <sys/types.h>
33 //#include <inttypes.h>
34 #include <stdarg.h>
35 
36 /*****************************************************************************
37 * iovec structure: vectored data entry
38 *****************************************************************************/
39 #ifdef TARGET_WINDOWS
40 struct iovec
41 {
42  void *iov_base; /* Pointer to data. */
43  size_t iov_len; /* Length of data. */
44 };
45 #else
46 # include <sys/uio.h> /* struct iovec */
47 #endif
48 
59 #define DVD_VIDEO_LB_LEN 2048
60 
64 #define MAX_UDF_FILE_NAME_LEN 2048
65 
66 #ifdef __cplusplus
67 extern "C" {
68 #endif
69 
73 typedef struct dvd_reader_s dvd_reader_t;
74 typedef struct dvd_reader_device_s dvd_reader_device_t;
75 
79 typedef struct dvd_file_s dvd_file_t;
80 
82 {
83  int (*pf_seek)(void* p_stream, uint64_t i_pos);
84  int (*pf_read)(void* p_stream, void* buffer, int i_read);
85  int (*pf_readv)(void* p_stream, void* p_iovec, int i_blocks);
86 };
87 typedef struct dvd_reader_stream_cb dvd_reader_stream_cb;
88 
97 typedef enum
98 {
99  DVD_LOGGER_LEVEL_INFO,
100  DVD_LOGGER_LEVEL_ERROR,
101  DVD_LOGGER_LEVEL_WARN,
102  DVD_LOGGER_LEVEL_DEBUG,
103 } dvd_logger_level_t;
104 
105 typedef struct
106 {
107  void (*pf_log)(void*, dvd_logger_level_t, const char*, va_list);
108 } dvd_logger_cb;
109 
113 typedef struct {
114  off_t size;
115  int nr_parts;
116  off_t parts_size[9];
117 } dvd_stat_t;
118 
146 dvd_reader_t *DVDOpen( const char * );
147 dvd_reader_t* DVDOpenStream(void*, dvd_reader_stream_cb*);
148 
161 dvd_reader_t* DVDOpen2(void*, const dvd_logger_cb*, const char*);
162 dvd_reader_t* DVDOpenStream2(void*, const dvd_logger_cb*, dvd_reader_stream_cb*);
163 
173 void DVDClose( dvd_reader_t * );
174 
178 typedef enum
179 {
180  DVD_READ_INFO_FILE,
181  DVD_READ_INFO_BACKUP_FILE,
182  DVD_READ_MENU_VOBS,
183  DVD_READ_TITLE_VOBS
186 } dvd_read_domain_t;
187 
213 int DVDFileStat(dvd_reader_t *, int, dvd_read_domain_t, dvd_stat_t *);
214 
228 dvd_file_t *DVDOpenFile( dvd_reader_t *, int, dvd_read_domain_t );
229 
237 void DVDCloseFile( dvd_file_t * );
238 
254 ssize_t DVDReadBlocks( dvd_file_t *, int, size_t, unsigned char * );
255 
268 int32_t DVDFileSeek( dvd_file_t *, int32_t );
269 
282 ssize_t DVDReadBytes( dvd_file_t *, void *, size_t );
283 
292 ssize_t DVDFileSize( dvd_file_t * );
293 
307 int DVDDiscID( dvd_reader_t *, unsigned char * );
308 
327 int DVDUDFVolumeInfo(dvd_reader_t*, char*, unsigned int, unsigned char*, unsigned int);
328 
329 int DVDFileSeekForce( dvd_file_t *, int offset, int force_size);
330 
352 int DVDISOVolumeInfo(dvd_reader_t*, char*, unsigned int, unsigned char*, unsigned int);
353 
366 int DVDUDFCacheLevel( dvd_reader_t *, int );
367 
368 #ifdef __cplusplus
369 };
370 #endif
int nr_parts
Number of file parts.
Definition: dvd_reader.h:115
Public type that is used to provide statistics on a handle.
Definition: dvd_reader.h:113
Definition: dvd_reader.h:81
Definition: dvd_reader.h:105
off_t size
Total size of file in bytes.
Definition: dvd_reader.h:114