00001 /* 00002 * Copyright (C) 2000 Rich Wareham <richwareham@users.sourceforge.net> 00003 * 00004 * This file is part of libdvdnav, a DVD navigation library. 00005 * 00006 * libdvdnav is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * libdvdnav is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License along 00017 * with libdvdnav; if not, write to the Free Software Foundation, Inc., 00018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00019 */ 00020 00021 #ifndef LIBDVDNAV_READ_CACHE_H 00022 #define LIBDVDNAV_READ_CACHE_H 00023 00024 /* Opaque cache type -- defined in dvdnav_internal.h */ 00025 /* typedef struct read_cache_s read_cache_t; */ 00026 00027 /* EXPERIMENTAL: Setting the following to 1 will use an experimental multi-threaded 00028 * read-ahead cache. 00029 */ 00030 #define _MULTITHREAD_ 0 00031 00032 /* Constructor/destructors */ 00033 read_cache_t *dvdnav_read_cache_new(dvdnav_t* dvd_self); 00034 void dvdnav_read_cache_free(read_cache_t* self); 00035 00036 /* This function MUST be called whenever self->file changes. */ 00037 void dvdnav_read_cache_clear(read_cache_t *self); 00038 /* This function is called just after reading the NAV packet. */ 00039 void dvdnav_pre_cache_blocks(read_cache_t *self, int sector, size_t block_count); 00040 /* This function will do the cache read. 00041 * The buffer handed in must be malloced to take one dvd block. 00042 * On a cache hit, a different buffer will be returned though. 00043 * Those buffers must _never_ be freed. */ 00044 int dvdnav_read_cache_block(read_cache_t *self, int sector, size_t block_count, uint8_t **buf); 00045 00046 #endif /* LIBDVDNAV_READ_CACHE_H */
1.6.3